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

C# ISessionService类代码示例

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

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



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

示例1: SessionRequestService

 public SessionRequestService(IUnitOfWork uow, Lazy<INotificationService> notificationService, ISessionService sessionService)
 {
     _sessionService = sessionService;
     _notificationService = notificationService;
     _uow = uow;
     _sessionRequest = uow.Set<SessionRequest>();
 }
开发者ID:YekanPedia,项目名称:ManagementSystem,代码行数:7,代码来源:SessionRequestService.cs


示例2: IdentityService

 public IdentityService(ILearnWithQBUow uow, IEncryptionService encryptionService, ISessionService sessionService, ICacheProvider cacheProvider)
     : base(cacheProvider)
 {
     this.uow = uow;
     this.sessionService = sessionService;
     this.encryptionService = encryptionService;
 }
开发者ID:QuinntyneBrown,项目名称:learn-with-qb,代码行数:7,代码来源:IdentityService.cs


示例3: ExploreViewModel

        public ExploreViewModel(ISessionService applicationService)
        {
            ShowRepositoryDescription = applicationService.Account.ShowRepositoryDescriptionInList;

            Title = "Explore";

            var gotoRepository = new Action<RepositoryItemViewModel>(x => {
                var vm = this.CreateViewModel<RepositoryViewModel>();
                vm.RepositoryOwner = x.Owner;
                vm.RepositoryName = x.Name;
                NavigateTo(vm);
            });

            var repositories = new ReactiveList<Octokit.Repository>();
            Repositories = repositories.CreateDerivedCollection(x => 
                new RepositoryItemViewModel(x, true, gotoRepository));

            var users = new ReactiveList<Octokit.User>();
            Users = users.CreateDerivedCollection(x => 
                new UserItemViewModel(x.Login, x.AvatarUrl, false, () => {
                    var vm = this.CreateViewModel<UserViewModel>();
                    vm.Init(x.Login);
                    NavigateTo(vm);
                }));

            this.WhenAnyValue(x => x.SearchFilter)
                .DistinctUntilChanged()
                .Subscribe(_ => {
                    SearchText = string.Empty;
                    users.Clear();
                    repositories.Clear();
                });

            var canSearch = this.WhenAnyValue(x => x.SearchText).Select(x => !string.IsNullOrEmpty(x));
            SearchCommand = ReactiveCommand.CreateAsyncTask(canSearch, async t => {
                try
                {
                    users.Clear();
                    repositories.Clear();

                    if (SearchFilter == SearchType.Repositories)
                    {
                        var request = new Octokit.SearchRepositoriesRequest(SearchText);
                        var response = await applicationService.GitHubClient.Search.SearchRepo(request);
                        repositories.Reset(response.Items);
                    }
                    else if (SearchFilter == SearchType.Users)
                    {
                        var request = new Octokit.SearchUsersRequest(SearchText);
                        var response = await applicationService.GitHubClient.Search.SearchUsers(request);
                        users.Reset(response.Items);
                    }
                }
                catch (Exception e)
                {
                    var msg = string.Format("Unable to search for {0}. Please try again.", SearchFilter.Humanize());
                    throw new Exception(msg, e);
                }
            });
        }
开发者ID:zdd910,项目名称:CodeHub,代码行数:60,代码来源:ExploreViewModel.cs


示例4: PullRequestsViewModel

        public PullRequestsViewModel(ISessionService sessionService)
		{
            _sessionService = sessionService;
            Title = "Pull Requests";

            PullRequests = _pullRequests.CreateDerivedCollection(x => {
                    var vm = new PullRequestItemViewModel(x);
                    vm.GoToCommand.Subscribe(_ => {
                        var prViewModel = this.CreateViewModel<PullRequestViewModel>();
                        prViewModel.Init(RepositoryOwner, RepositoryName, x.Number, x);
                        NavigateTo(prViewModel);

                        prViewModel.WhenAnyValue(y => y.Issue.State)
                            .DistinctUntilChanged()
                            .Skip(1)
                            .Subscribe(y => LoadCommand.ExecuteIfCan());
                    });
                    return vm;
                },
                filter: x => x.Title.ContainsKeyword(SearchKeyword),
                signalReset: this.WhenAnyValue(x => x.SearchKeyword));

            LoadCommand = ReactiveCommand.CreateAsyncTask(async t => {
                _pullRequests.Reset(await RetrievePullRequests());
            });

            this.WhenAnyValue(x => x.SelectedFilter).Skip(1).Subscribe(_ => {
                _pullRequests.Clear();
                LoadCommand.ExecuteIfCan();
            });
		}
开发者ID:jianwoo,项目名称:CodeHub,代码行数:31,代码来源:PullRequestsViewModel.cs


示例5: CreateFileViewModel

        public CreateFileViewModel(ISessionService applicationService, IAlertDialogFactory alertDialogFactory)
        {
            Title = "Create File";

            this.WhenAnyValue(x => x.Name).Subscribe(x => CommitMessage = "Created " + x);

            _canCommit = this.WhenAnyValue(x => x.Name)
                .Select(x => !string.IsNullOrEmpty(x))
                .ToProperty(this, x => x.CanCommit);

            SaveCommand = ReactiveCommand.CreateAsyncTask(
                this.WhenAnyValue(x => x.Name).Select(x => !string.IsNullOrEmpty(x)), 
                async _ =>
            {
                var content = Content ?? string.Empty;

                var path = Path;
                if (string.IsNullOrEmpty(Path))
                    path = "/";
                path = System.IO.Path.Combine(path, Name);
                var request = applicationService.Client.Users[RepositoryOwner].Repositories[RepositoryName].UpdateContentFile(path, CommitMessage, content, null, Branch);
                await applicationService.Client.ExecuteAsync(request);
                Dismiss();
            });

            DismissCommand = ReactiveCommand.CreateAsyncTask(async t =>
            {
                if (string.IsNullOrEmpty(Name) && string.IsNullOrEmpty(Content)) return true;
                return await alertDialogFactory.PromptYesNo("Discard File?", "Are you sure you want to discard this file?");
            });
            DismissCommand.Where(x => x).Subscribe(_ => Dismiss());
        }
开发者ID:zdd910,项目名称:CodeHub,代码行数:32,代码来源:CreateFileViewModel.cs


示例6: FeedbackComposerViewModel

        public FeedbackComposerViewModel(ISessionService applicationService, IAlertDialogFactory alertDialogFactory)
        {
            this.WhenAnyValue(x => x.IsFeature).Subscribe(x => Title = x ? "New Feature" : "Bug Report");

            SubmitCommand = ReactiveCommand.CreateAsyncTask(
                this.WhenAnyValue(x => x.Subject).Select(x => !string.IsNullOrEmpty(x)),
                async _ =>
            {
                if (string.IsNullOrEmpty(Subject))
                    throw new ArgumentException(string.Format("You must provide a title for this {0}!", IsFeature ? "feature" : "bug"));

                var labels = await applicationService.GitHubClient.Issue.Labels.GetAllForRepository(CodeHubOwner, CodeHubName);
                var createLabels = labels.Where(x => string.Equals(x.Name, IsFeature ? "feature request" : "bug", StringComparison.OrdinalIgnoreCase)).Select(x => x.Name).Distinct();

                var createIssueRequest = new Octokit.NewIssue(Subject) { Body = Description };
                foreach (var label in createLabels)
                    createIssueRequest.Labels.Add(label);
                var createdIssue = await applicationService.GitHubClient.Issue.Create(CodeHubOwner, CodeHubName, createIssueRequest);

                _createdIssueSubject.OnNext(createdIssue);
                Dismiss();
            });

            DismissCommand = ReactiveCommand.CreateAsyncTask(async t =>
            {
                if (string.IsNullOrEmpty(Description) && string.IsNullOrEmpty(Subject))
                    return true;
                var itemType = IsFeature ? "feature" : "bug";
                return await alertDialogFactory.PromptYesNo("Discard " + itemType.Transform(To.TitleCase) + "?", "Are you sure you want to discard this " + itemType + "?");
            });
            DismissCommand.Where(x => x).Subscribe(_ => Dismiss());
        }
开发者ID:runt18,项目名称:CodeHub,代码行数:32,代码来源:FeedbackComposerViewModel.cs


示例7: ReadmeViewModel

        public ReadmeViewModel(
            ISessionService applicationService, 
            IActionMenuFactory actionMenuService)
        {
            Title = "Readme";

            var nonNullContentModel = this.WhenAnyValue(x => x.ContentModel).Select(x => x != null);

            ShareCommand = ReactiveCommand.Create(nonNullContentModel);
            ShareCommand.Subscribe(sender => actionMenuService.ShareUrl(sender, ContentModel.HtmlUrl));

            GoToGitHubCommand = ReactiveCommand.Create(nonNullContentModel);
            GoToGitHubCommand.Select(_ => ContentModel.HtmlUrl).Subscribe(GoToWebBrowser);

            GoToLinkCommand = ReactiveCommand.Create();
            GoToLinkCommand.OfType<string>().Subscribe(x => GoToWebBrowser(new Uri(x)));

            ShowMenuCommand = ReactiveCommand.CreateAsyncTask(nonNullContentModel, sender => {
                var menu = actionMenuService.Create();
                menu.AddButton("Share", ShareCommand);
                menu.AddButton("Show in GitHub", GoToGitHubCommand);
                return menu.Show(sender);
            });

            LoadCommand = ReactiveCommand.CreateAsyncTask(x => {
                var contentTask = applicationService.GitHubClient.Repository.Content.GetReadmeHtml(RepositoryOwner, RepositoryName)
                    .ContinueWith(t => ContentText = t.Result, TaskScheduler.FromCurrentSynchronizationContext());
                
                var modelTask = applicationService.GitHubClient.Repository.Content.GetReadme(RepositoryOwner, RepositoryName)
                    .ContinueWith(t => ContentModel = t.Result, TaskScheduler.FromCurrentSynchronizationContext());

                return Task.WhenAll(contentTask, modelTask);
            });
        }
开发者ID:crazypebble,项目名称:CodeHub,代码行数:34,代码来源:ReadmeViewModel.cs


示例8: UserGistsViewModel

        public UserGistsViewModel(ISessionService sessionService)
            : base(sessionService)
        {
            _sessionService = sessionService;
            Username = _sessionService.Account.Username;

            GoToCreateGistCommand = ReactiveCommand.Create();
            GoToCreateGistCommand.Subscribe(_ =>
            {
                var vm = this.CreateViewModel<GistCreateViewModel>();
                vm.SaveCommand
                    .Delay(TimeSpan.FromMilliseconds(200))
                    .ObserveOn(RxApp.MainThreadScheduler)
                    .Subscribe(x => InternalItems.Insert(0, x));
                NavigateTo(vm);
            });

            this.WhenAnyValue(x => x.Username).Subscribe(x =>
            {
                if (IsMine)
                    Title = "My Gists";
                else if (x == null) 
                    Title = "Gists";
                else if (x.EndsWith("s", StringComparison.OrdinalIgnoreCase))
                    Title = x + "' Gists";
                else
                    Title = x + "'s Gists";
            });
        }
开发者ID:runt18,项目名称:CodeHub,代码行数:29,代码来源:UserGistsViewModel.cs


示例9: BaseUsersViewModel

        protected BaseUsersViewModel(ISessionService sessionService)
        {
            SessionService = sessionService;

            Users = _users.CreateDerivedCollection(x => {
                var isOrg = x.Type.HasValue && x.Type.Value == AccountType.Organization;
                return new UserItemViewModel(x.Login, x.AvatarUrl, isOrg, () => {
                    if (isOrg)
                    {
                        var vm = this.CreateViewModel<OrganizationViewModel>();
                        vm.Init(x.Login);
                        NavigateTo(vm);
                    }
                    else
                    {
                        var vm = this.CreateViewModel<UserViewModel>();
                        vm.Init(x.Login, x);
                        NavigateTo(vm);
                    }
                });
            },
            x => x.Login.StartsWith(SearchKeyword ?? string.Empty, StringComparison.OrdinalIgnoreCase),
            signalReset: this.WhenAnyValue(x => x.SearchKeyword));

            LoadCommand = ReactiveCommand.CreateAsyncTask(async t => {
                _users.Reset(await RetrieveUsers());
            });
        }
开发者ID:jianwoo,项目名称:CodeHub,代码行数:28,代码来源:BaseUsersViewModel.cs


示例10: OrganizationRepositoriesViewModel

 public OrganizationRepositoriesViewModel(ISessionService applicationService)
     : base(applicationService)
 {
     _applicationService = applicationService;
     this.WhenAnyValue(x => x.Name).Subscribe(x => Title = x ?? "Repositories");
     ShowRepositoryOwner = false;
 }
开发者ID:zdd910,项目名称:CodeHub,代码行数:7,代码来源:OrganizationRepositoriesViewModel.cs


示例11: AccountsViewModel

        public AccountsViewModel(ISessionService sessionService, IAccountsRepository accountsRepository)
        {
            _accountsRepository = accountsRepository;
            _sessionService = sessionService;

            Title = "Accounts";

            Accounts = _accounts.CreateDerivedCollection(CreateAccountItem);

            this.WhenAnyValue(x => x.ActiveAccount)
                .Select(x => x == null ? string.Empty : x.Key)
                .Subscribe(x =>
                {
                    foreach (var account in Accounts)
                        account.Selected = account.Id == x;
                });

            var canDismiss = this.WhenAnyValue(x => x.ActiveAccount).Select(x => x != null);
            DismissCommand = ReactiveCommand.Create(canDismiss).WithSubscription(x => Dismiss());

            GoToAddAccountCommand = ReactiveCommand.Create()
                .WithSubscription(_ => NavigateTo(this.CreateViewModel<NewAccountViewModel>()));

            // Activate immediately since WhenActivated triggers off Did* instead of Will* in iOS
            UpdateAccounts();
            this.WhenActivated(d => UpdateAccounts());
        }
开发者ID:jianwoo,项目名称:CodeHub,代码行数:27,代码来源:AccountsViewModel.cs


示例12: PullRequestRepository

 public PullRequestRepository(ISessionService sessionService, string repositoryOwner, string repositoryName, int id)
 {
     _sessionService = sessionService;
     RepositoryOwner = repositoryOwner;
     RepositoryName = repositoryName;
     Id = id;
 }
开发者ID:zdd910,项目名称:CodeHub,代码行数:7,代码来源:PullRequestRepository.cs


示例13: MainViewModel

        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        /// <param name="navigationService">
        /// The navigation Service.
        /// </param>
        /// <param name="logManager">
        /// The log manager.
        /// </param>
        /// <param name="sessionService">The session service.</param>
        public MainViewModel(INavigationService navigationService, 
            ILogManager logManager, 
            ISessionService sessionService)
        {
            _navigationService = navigationService;
            _logManager = logManager;
            _sessionService = sessionService;
            LogoutCommand = new RelayCommand(
                () =>
                {
                    _sessionService.Logout();

                    // todo navigation
                    _navigationService.Navigate<LoginView>();
                });
            AboutCommand = new RelayCommand(
                async () =>
                { 
                    Exception exception = null;
                    try
                    {
                        // todo navigation
                        // _navigationService.Navigate(new Uri(Constants.AboutView, UriKind.Relative));
                    }
                    catch (Exception ex)
                    {
                        exception = ex;
                    }

                    if (exception != null)
                    {
                        await _logManager.LogAsync(exception);
                    }
                });
        }
开发者ID:Aadeelyoo,项目名称:MyMSDNSamples,代码行数:45,代码来源:MainViewModel.cs


示例14: BugsController

 public BugsController(ISessionService sessionService, IFindBugsByUserEmail findByUserEmail, ICreateNewBug createNewBug, IRemoveBug removeBug)
 {
     this.sessionService = sessionService;
     this.findByUserEmail = findByUserEmail;
     this.createNewBug = createNewBug;
     this.removeBug = removeBug;
 }
开发者ID:seymourpoler,项目名称:PetProjects,代码行数:7,代码来源:BugsController.rest.cs


示例15: CreateFileViewModel

        public CreateFileViewModel(ISessionService sessionService, IAlertDialogFactory alertDialogFactory)
        {
            Title = "Create File";

            this.WhenAnyValue(x => x.Name)
                .Subscribe(x => CommitMessage = "Created " + x);

            GoToCommitMessageCommand = ReactiveCommand.Create(
                this.WhenAnyValue(x => x.Name, x => !string.IsNullOrEmpty(x)));

            SaveCommand = ReactiveCommand.CreateAsyncTask(
                this.WhenAnyValue(x => x.Name).Select(x => !string.IsNullOrEmpty(x)), async _ => {
                    var content = Content ?? string.Empty;
                    var path = System.IO.Path.Combine(Path ?? string.Empty, Name);
                    var request = new Octokit.CreateFileRequest(CommitMessage, content) { Branch = Branch };
                    using (alertDialogFactory.Activate("Commiting..."))
                        return await sessionService.GitHubClient.Repository.Content.CreateFile(RepositoryOwner, RepositoryName, path, request);
                });
            SaveCommand.Subscribe(x => Dismiss());

            DismissCommand = ReactiveCommand.CreateAsyncTask(async t => {
                if (string.IsNullOrEmpty(Name) && string.IsNullOrEmpty(Content)) return true;
                return await alertDialogFactory.PromptYesNo("Discard File?", "Are you sure you want to discard this file?");
            });
            DismissCommand.Where(x => x).Subscribe(_ => Dismiss());
        }
开发者ID:runt18,项目名称:CodeHub,代码行数:26,代码来源:CreateFileViewModel.cs


示例16: MyIssuesViewModel

        public MyIssuesViewModel(ISessionService sessionService)
            : base(sessionService)
        {
            _sessionService = sessionService;

            Title = "My Issues";
            Filter = MyIssuesFilterModel.CreateOpenFilter();

            _selectedFilter = this.WhenAnyValue(x => x.Filter)
                .Select(x =>
                {
                    if (x == null || _openFilter.Equals(x))
                        return 0;
                    return _closedFilter.Equals(x) ? 1 : -1;
                })
                .ToProperty(this, x => x.SelectedFilter);

            this.WhenAnyValue(x => x.Filter).Skip(1).Subscribe(filter => {
                InternalItems.Clear();
                LoadCommand.ExecuteIfCan();
                CustomFilterEnabled = !(filter == _closedFilter || filter == _openFilter);
            });

            GoToFilterCommand = ReactiveCommand.Create();
            GoToFilterCommand.Subscribe(_ => {
                var vm = this.CreateViewModel<MyIssuesFilterViewModel>();
                vm.Init(Filter);
                vm.SaveCommand.Subscribe(filter => Filter = filter);
                NavigateTo(vm);
            });
        }
开发者ID:runt18,项目名称:CodeHub,代码行数:31,代码来源:MyIssuesViewModel.cs


示例17: IssuesViewModel

        public IssuesViewModel(ISessionService sessionService)
            : base(sessionService)
	    {
            _sessionService = sessionService;
            Filter = new IssuesFilterModel();

            Title = "Issues";

            GoToNewIssueCommand = ReactiveCommand.Create();
	        GoToNewIssueCommand.Subscribe(_ => {
	            var vm = this.CreateViewModel<IssueAddViewModel>();
                vm.RepositoryOwner = RepositoryOwner;
	            vm.RepositoryName = RepositoryName;
                vm.SaveCommand.Subscribe(x => LoadCommand.ExecuteIfCan());
                NavigateTo(vm);
	        });

            this.WhenAnyValue(x => x.Filter).Skip(1).Subscribe(filter => {
                InternalItems.Clear();
                LoadCommand.ExecuteIfCan();
                //CustomFilterEnabled = !(filter == _closedFilter || filter == _openFilter);
            });

            GoToFilterCommand = ReactiveCommand.Create();
            GoToFilterCommand.Subscribe(_ => {
                var vm = this.CreateViewModel<RepositoryIssuesFilterViewModel>();
                vm.Init(RepositoryOwner, RepositoryName, Filter);
                vm.SaveCommand.Subscribe(filter => {
                    Filter = filter;
                    FilterSelection = IssueFilterSelection.Custom;
                });
                NavigateTo(vm);
            });
	    }
开发者ID:runt18,项目名称:CodeHub,代码行数:34,代码来源:IssuesViewModel.cs


示例18: IdentityService

 public IdentityService(IVideoOnDemandUow uow, IEncryptionService encryptionService, ISessionService sessionService, ICacheProvider cacheProvider)
     : base(cacheProvider)
 {
     this.uow = uow;
     this.sessionService = sessionService;
     this.encryptionService = encryptionService;
 }
开发者ID:QuinntyneBrown,项目名称:VideoOnDemandApi,代码行数:7,代码来源:IdentityService.cs


示例19: BaseRepositoriesViewModel

        protected BaseRepositoriesViewModel(ISessionService applicationService)
        {
            ApplicationService = applicationService;
            ShowRepositoryOwner = true;
            Title = "Repositories";

            var gotoRepository = new Action<RepositoryItemViewModel>(x => {
                var vm = this.CreateViewModel<RepositoryViewModel>();
                vm.Init(x.Owner, x.Name);
                NavigateTo(vm);
            });

            var repositories = new ReactiveList<RepositoryItemViewModel>();
            Repositories = repositories.CreateDerivedCollection(
                x => x, 
                filter: x => x.Name.ContainsKeyword(SearchKeyword),
                signalReset: this.WhenAnyValue(x => x.SearchKeyword));

            //Filter = applicationService.Account.Filters.GetFilter<RepositoriesFilterModel>(filterKey);

            LoadCommand = ReactiveCommand.CreateAsyncTask(t =>
                repositories.SimpleCollectionLoad(CreateRequest(),
                    x => new RepositoryItemViewModel(x.Name, x.Owner.Login, x.Owner.AvatarUrl, 
                        ShowRepositoryDescription ? x.Description : string.Empty, x.StargazersCount, x.ForksCount, 
                        ShowRepositoryOwner, gotoRepository),
                    x => LoadMoreCommand = x == null ? null : ReactiveCommand.CreateAsyncTask(_ => x())));

//			_repositories.FilteringFunction = x => Repositories.Filter.Ascending ? x.OrderBy(y => y.Name) : x.OrderByDescending(y => y.Name);
//            _repositories.GroupingFunction = CreateGroupedItems;
        }
开发者ID:hoku85,项目名称:CodeHub,代码行数:30,代码来源:BaseRepositoriesViewModel.cs


示例20: PhotosController

 public PhotosController(ISessionService sessionService, IAlbumService albumService, IPhotoService photoService, ITagService tagService)
 {
     this.mSessionService = sessionService;
     this.mAlbumService = albumService;
     this.mPhotoService = photoService;
     this.mTagService = tagService;
 }
开发者ID:janstadt,项目名称:anstadtfamily,代码行数:7,代码来源:PhotosController.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# ISessionStorage类代码示例发布时间:2022-05-24
下一篇:
C# ISessionProvider类代码示例发布时间: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