• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IUserSession类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IUserSession的典型用法代码示例。如果您正苦于以下问题:C# IUserSession类的具体用法?C# IUserSession怎么用?C# IUserSession使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IUserSession类属于命名空间,在下文中一共展示了IUserSession类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Init

        public void Init(IInviteFriends view)
        {
            _view = view;
            _userSession = ObjectFactory.GetInstance<IUserSession>();
            _email = ObjectFactory.GetInstance<IEmail>();
            _webContext = ObjectFactory.GetInstance<IWebContext>();
            _account = _userSession.CurrentUser;

            if (_account != null)
            {
                _view.DisplayToData(_account.FirstName + " " + _account.LastName + " &lt;" + _account.Email + "&gt;");

                if (_webContext.AccoundIdToInvite > 0)
                {
                    _accountToInvite = Account.GetAccountByID(_webContext.AccoundIdToInvite);

                    if (_accountToInvite != null)
                    {
                        SendInvitation(_accountToInvite.Email,
                                       _accountToInvite.FirstName + " " + _accountToInvite.LastName + " muốn kết bạn với bạn!");
                        _view.ShowMessage(" Yêu cầu kết bạn đã được gửi đến" + _accountToInvite.Username);
                        _view.TogglePnlInvite(false);
                    }
                }
            }
        }
开发者ID:lengocluyen,项目名称:pescode,代码行数:26,代码来源:InviteFriendsPresenter.cs


示例2: 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 + " &lt;" + _account.Email + "&gt;");

                    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);
                        }
                    }
                }
            }
        }
开发者ID:SPKT,项目名称:MHX2,代码行数:35,代码来源:InviteFriend.cs


示例3: TableQueryInfo

 public TableQueryInfo(IUserSession session, TableInfo tableInfo, ObjectName tableName, ObjectName aliasName)
 {
     Session = session;
     TableInfo = tableInfo;
     TableName = tableName;
     AliasName = aliasName;
 }
开发者ID:furesoft,项目名称:deveeldb,代码行数:7,代码来源:UserSessionExtensions.cs


示例4: SaveCard

        public ICard SaveCard(IUserSession session, ICard newCard)
        {
            CardEffect effect = new CardEffect
            {
                Affected = (int)newCard.Effect.Affected,
                CardAttackChange = newCard.Effect.CardAttackChange,
                CardAttackMultiplier = newCard.Effect.CardAttackMultiplier,
                Description = newCard.Effect.Description,
                DisableOpponentEffect = newCard.Effect.DisableOpponentEffect,
                EffectTiming = (int)newCard.Effect.EffectTiming,
                LifePointsChange = newCard.Effect.LifePointsChange,
                Name = newCard.Effect.Name,
                ProbabilityOfEffect = newCard.Effect.ProbabilityOfEffect
            };

            Card created = new Card
            {
                Name = newCard.Name,
                ImageUrl = newCard.ImageUrl,
                Effect = effect,
                AttackPoints = newCard.AttackPoints,
                DefensePoints = newCard.DefensePoints
            };

            RequestContext.Model<Entities>().AddToCards(created);
            RequestContext.Model<Entities>().SaveChanges();

            return created;
        }
开发者ID:marcel-valdez,项目名称:dot_net_cop_example,代码行数:29,代码来源:CardContainer.cs


示例5: PublicController

 public PublicController(
     IMiddleManagement MiddleManagement,
     IUserSession UserSession,
     IFormsAuthentication FormAuthentication)
     : base(MiddleManagement, UserSession, FormAuthentication)
 {
 }
开发者ID:nathanpalmer,项目名称:LittleBanking,代码行数:7,代码来源:PublicController.cs


示例6: RegisterController

 /// <summary>
 /// Initializes a new instance of the <see cref="JoinController"/> class.
 /// </summary>
 /// <param name="userRepository">The user repository.</param>
 /// <param name="fileService">The file service.</param>
 /// <param name="userSession">The user session.</param>
 /// <param name="joinRepository">The join repository.</param>
 public RegisterController(IUserRepository userRepository, IStorage fileService, IUserSession<Domain.Model.User> userSession, IJoinRepository joinRepository)
 {
     _userRepository = userRepository;
     _joinRepository = joinRepository;
     _fileService = fileService;
     _userSession = userSession;
 }
开发者ID:chuckconway,项目名称:the-memorable-moments,代码行数:14,代码来源:RegisterController.cs


示例7: SessionQueryContext

        public SessionQueryContext(IUserSession session)
        {
            if (session == null)
                throw new ArgumentNullException("session");

            this.session = session;
        }
开发者ID:furesoft,项目名称:deveeldb,代码行数:7,代码来源:SessionQueryContext.cs


示例8: ValidateTheCommand

 void ValidateTheCommand(IUserSession userSession, object command)
 {
     foreach (object validator in GetMatchingCommandValidators(command))
     {
         InvokeMethod("Validate", validator, userSession, command);
     }
 }
开发者ID:rsiwady29,项目名称:Starscream,代码行数:7,代码来源:SynchronousCommandDispatcherBase.cs


示例9: GetAvailableRooms

        public IEnumerable<IRoom> GetAvailableRooms(IUserSession session)
        {
            Contract.Requires(session != null, "session is null.");
            Contract.Ensures(Contract.Result<IEnumerable<IRoom>>() != null);

            return default(IEnumerable<IRoom>);
        }
开发者ID:marcel-valdez,项目名称:dot_net_cop_example,代码行数:7,代码来源:IRoomsManagerCodeContract.cs


示例10: 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();

        }
开发者ID:lengocluyen,项目名称:pescode,代码行数:31,代码来源:ProfilePresenter.cs


示例11: MyBlogsPresenter

 public MyBlogsPresenter()
 {
     _webContext = ObjectFactory.GetInstance<IWebContext>();
     _blogRepository = ObjectFactory.GetInstance<IBlogRepository>();
     _redirector = ObjectFactory.GetInstance<IRedirector>();
     _userSession = ObjectFactory.GetInstance<IUserSession>();
 }
开发者ID:SPKT,项目名称:MHX2,代码行数:7,代码来源:MyBlogsPresenter.cs


示例12: Dispatch

        public void Dispatch(IUserSession userSession, object command)
        {

            try
            {
             
                _decoratedDispatcher.Dispatch(userSession,command);

               
            }
            catch (Exception e)
            {
                var errorMessage = "1) Error calling " + command.GetType() + "\n";
              
              var properties = command.GetType().GetProperties();
              var propertiesMessage = properties.Aggregate("", (current, property) => current + ("Property Name " + property.Name + " Property Value " + property.GetValue(command)));

              errorMessage += "2) " + propertiesMessage + "\n";
                errorMessage += "3) " + e.Message; 
              _logger.Error(errorMessage);
              
              throw;

            }
        }
开发者ID:ZSnake,项目名称:backend-class,代码行数:25,代码来源:CommandDispatcherLogger.cs


示例13: ManagePrivacyPresenter

 public ManagePrivacyPresenter()
 {
     _profileService = ObjectFactory.GetInstance<IProfileService>();
     _userSession = ObjectFactory.GetInstance<IUserSession>();
     account = _userSession.CurrentUser;
     profile = _profileService.LoadProfileByAccountID(account.AccountID);
 }
开发者ID:lengocluyen,项目名称:pescode,代码行数:7,代码来源:ManagePrivacyPresenter.cs


示例14: GrantManager

        public GrantManager(IUserSession session)
        {
            Session = session;

            context = new SessionQueryContext(session);
            privCache = new MemoryCache(16, 256, 10);
        }
开发者ID:prepare,项目名称:deveeldb,代码行数:7,代码来源:GrantManager.cs


示例15: BoxFriendPresenter

 public BoxFriendPresenter()
 {
     _friendRepository = new SPKTCore.Core.DataAccess.Impl.FriendRepository();
     _userSession = new SPKTCore.Core.Impl.UserSession();
     _friendService = new FriendService();
     _friendInvite = new SPKTCore.Core.DataAccess.Impl.FriendInvitationRepository();
 }
开发者ID:SPKT,项目名称:MHX2,代码行数:7,代码来源:BoxFriendPresenter.cs


示例16: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     _usersession = new UserSession();
     _for = new FolderRepository();
     _redirect = new Redirector();
     up = new UploadAvatarPresenter();
 }
开发者ID:SPKT,项目名称:MHX2,代码行数:7,代码来源:CreateAlbum.ascx.cs


示例17: ContentMenuCommandService

 public ContentMenuCommandService(IContentMenuService contentMenuService, IUnitOfWork unitOfWork, ICommandExecutor executor)
 {
   _contentMenuService = contentMenuService;
   _unitOfWork = unitOfWork;
   _executor = executor;
   _userSession = new UserSession();
 }
开发者ID:johnpipo1712,项目名称:Misuka,代码行数:7,代码来源:ContentMenuCommandService.cs


示例18: OrderingHistoryCommandService

 public OrderingHistoryCommandService(IOrderingHistoryService orderingHistoryService, IUnitOfWork unitOfWork, ICommandExecutor executor)
 {
   _orderingHistoryService = orderingHistoryService;
   _unitOfWork = unitOfWork;
   _executor = executor;
   _userSession = new UserSession();
 }
开发者ID:johnpipo1712,项目名称:Misuka,代码行数:7,代码来源:OrderingHistoryCommandService.cs


示例19: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     re = new SPKTCore.Core.Impl.Redirector();
     _userSession = new UserSession();
     if (_userSession.LoggedIn)
         re.GotoHomePage();
 }
开发者ID:SPKT,项目名称:MHX2,代码行数:7,代码来源:Default.aspx.cs


示例20: AlertService

 public AlertService()
 {
     _userSession = new UserSession();
     _alertRepository = new AlertRepository();
     _webContext = new WebContext();
     alert = new Alert();
 }
开发者ID:SPKT,项目名称:MangXaHoi,代码行数:7,代码来源:AlertService.cs



注:本文中的IUserSession类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IUserSettingService类代码示例发布时间:2022-05-24
下一篇:
C# IUserService类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap