本文整理汇总了C#中IWebContext类的典型用法代码示例。如果您正苦于以下问题:C# IWebContext类的具体用法?C# IWebContext怎么用?C# IWebContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IWebContext类属于命名空间,在下文中一共展示了IWebContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CachingUrlParserDecorator
public CachingUrlParserDecorator(IUrlParser inner, IPersister persister, IWebContext webContext, CacheWrapper cache)
{
this.inner = inner;
this.persister = persister;
this.webContext = webContext;
this.cache = cache;
}
示例2: XmlInstallationManager
public XmlInstallationManager(IHost host, IPersister persister, XmlContentRepository repository, ConnectionMonitor connectionContext, Importer importer, IWebContext webContext, ContentActivator activator)
: base(connectionContext, importer, webContext, persister, activator)
{
this.host = host;
this.persister = persister;
this.repository = repository;
}
示例3: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
_redirector = ObjectFactory.GetInstance<IRedirector>();
_webContext = ObjectFactory.GetInstance<IWebContext>();
_presenter = new EditPhotosPresenter();
_presenter.Init(this);
}
示例4: MyBlogsPresenter
public MyBlogsPresenter()
{
_webContext = ObjectFactory.GetInstance<IWebContext>();
_blogRepository = ObjectFactory.GetInstance<IBlogRepository>();
_redirector = ObjectFactory.GetInstance<IRedirector>();
_userSession = ObjectFactory.GetInstance<IUserSession>();
}
示例5: SearchConfigurationBuilderParticipator
public SearchConfigurationBuilderParticipator(IWebContext webContext, DatabaseSection config)
{
this.webContext = webContext;
searchEnabled = config.Search.Enabled;
asyncIndexing = config.Search.AsyncIndexing;
indexPath = config.Search.IndexPath;
}
示例6: Init
public void Init(IInviteFriends view)
{
_view = view;
//_userSession = ObjectFactory.GetInstance<IUserSession>();
//_email = ObjectFactory.GetInstance<IEmail>();
//_friendInvitationRepository = ObjectFactory.GetInstance<IFriendInvitationRepository>();
//_accountRepository = ObjectFactory.GetInstance<IAccountRepository>();
//_webContext = ObjectFactory.GetInstance<IWebContext>();
_userSession = new SPKTCore.Core.Impl.UserSession();
_friendInvitationRepository = new SPKTCore.Core.DataAccess.Impl.FriendInvitationRepository();
_email = new SPKTCore.Core.Impl.Email();
_webContext = new SPKTCore.Core.Impl.WebContext();
if (_userSession.LoggedIn)
{
_account = _userSession.CurrentUser;
_accountRepository = new SPKTCore.Core.DataAccess.Impl.AccountRepository();
if (_account != null)
{
_view.DisplayToData(_account.UserName + " <" + _account.Email + ">");
if (_webContext.AccoundIdToInvite > 0)
{
_accountToInvite = _accountRepository.GetAccountByID(_webContext.AccoundIdToInvite);
if (_accountToInvite != null)
{
SendInvitation(_accountToInvite.Email,
_account.UserName + " " + _account.UserName + " ");
_view.ShowMessage(_accountToInvite.UserName + " Đã được gửi đi!");
_view.TogglePnlInvite(false);
}
}
}
}
}
示例7: ProfilePresenter
public ProfilePresenter()
{
_redirector = ObjectFactory.GetInstance<IRedirector>();
_userSession = ObjectFactory.GetInstance<IUserSession>();
if (!_userSession.LoggedIn || _userSession.CurrentUser == null)
_redirector.GoToAccountLoginPage();
_alertService = ObjectFactory.GetInstance<IAlertService>();
_webContext = ObjectFactory.GetInstance<IWebContext>();
_accountService = ObjectFactory.GetInstance<IAccountService>();
_privacyService = ObjectFactory.GetInstance<IPrivacyService>();
_account = _userSession.CurrentUser;
if (_webContext.AccountID > 0 && _webContext.AccountID != _userSession.CurrentUser.AccountID)
{
_accountBeingViewed = _accountService.GetAccountByID(_webContext.AccountID);
_accountBeingViewed.Profile = Profile.GetProfileByAccountID(_webContext.AccountID);
}
else
{
_accountBeingViewed = _userSession.CurrentUser;
_accountBeingViewed.Profile = Profile.GetProfileByAccountID(_userSession.CurrentUser.AccountID);
}
if (_accountBeingViewed == null)
_redirector.GoToAccountLoginPage();
if (_accountBeingViewed.Profile != null && _accountBeingViewed.Profile.ProfileID > 0)
_privacyFlags = PrivacyFlag.GetPrivacyFlagsByProfileID(_accountBeingViewed.Profile.ProfileID);
else
_redirector.GoToHomePage();
}
示例8: Before
public void Before (IWebContext webContext)
{
if( !HasExtension(webContext) &&
!HasRoute(webContext) ||
IsDefault(webContext))
webContext.RewritePath("/index.html");
}
示例9: MongoInstallationManager
public MongoInstallationManager(MongoDatabaseProvider database, IHost host, IPersister persister, ConnectionMonitor connectionContext, Importer importer, IWebContext webContext, ContentActivator activator)
: base(connectionContext, importer, webContext, persister, activator)
{
this.database = database;
this.host = host;
this.persister = persister;
}
示例10: ConfirmFriendshipRequestPresenter
public ConfirmFriendshipRequestPresenter()
{
_webContext = ObjectFactory.GetInstance<IWebContext>();
_configuration = ObjectFactory.GetInstance<IConfiguration>();
_redirector = ObjectFactory.GetInstance<IRedirector>();
_friendService = ObjectFactory.GetInstance<IFriendService>();
}
示例11: LanguageInterceptor
public LanguageInterceptor(IPersister persister, IDefinitionManager definitions, IWebContext context, ILanguageGateway gateway)
{
this.persister = persister;
this.definitions = definitions;
this.context = context;
this.gateway = gateway;
}
示例12: Action
/// <summary>
/// Deconstructs the contexts request into a set of prameters for the context.
/// </summary>
/// <remarks>
/// The deafult implementation uses the convention of `/area/concern/action.aspc/tail?querystring`
/// </remarks>
/// <param name="ev">The vent that was considered for this action.</param>
/// <param name="context">The context to act upon.</param>
public override void Action(IEvent ev, IWebContext context)
{
// eliminate the app directory from the path
string path = _appDirectory.Length > 0 ? context.Request.UrlInfo.AppPath.Trim('/').Replace(_appDirectory, "") : context.Request.UrlInfo.AppPath;
path = path.Trim('/');
if (!String.IsNullOrEmpty(context.Request.UrlInfo.File)) {
context.Params["action"] = context.Request.UrlInfo.File.Split('.')[0].ToLower();
string[] parts = path.Split('/');
if (parts.Length >= 2) {
context.Params["area"] = parts[parts.Length - 2].ToLower();
context.Params["concern"] = parts[parts.Length - 1].ToLower();
} else if (parts.Length == 1) {
context.Params["area"] = parts[0];
}
}
// import query string and form values
context.Params.Import(context.Request.Params.Where(kv => !kv.Key.StartsWith("_")));
// establish flags
foreach (string flag in context.Request.Flags.Where(f => !f.StartsWith("_"))) {
context.Flags.Add(flag);
}
context.Params.Import(context.Request.Headers);
// note method and tail
context.Params["method"] = context.Request.Method;
context.Params["tail"] = context.Request.UrlInfo.Tail;
string requestViews = String.Join(";", context.Request.UrlInfo.Tail.Split(new string[] {"/"}, StringSplitOptions.RemoveEmptyEntries));
if (!String.IsNullOrEmpty(requestViews)) {
context.Params["views"] = requestViews;
}
}
示例13: CommentsPresenter
public CommentsPresenter()
{
_commentRepository = new CommentRepository();
_webContext = new WebContext();
_userSession = new UserSession();
_alertService = new AlertService();
}
示例14: ReadMessagePresenter
public ReadMessagePresenter()
{
_webContext = new WebContext();
_userSession = new UserSession();
_redirector = new Redirector();
_messageRepository = new SPKTCore.Core.DataAccess.Impl.MessageRepository();
}
示例15: NotifycationControlPresenter
public NotifycationControlPresenter()
{
_webContext = new WebContext();
_userSession = new UserSession();
_redirector = new Redirector();
_notifycationService = new NotificationService();
}