当前位置: 首页>>代码示例>>C#>>正文


C# IApplicationService类代码示例

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


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

示例1: AthleteViewModel

        public AthleteViewModel(IApplicationService service)
        {
            athleteInfo = new AthleteDto() { EventParticipationk__BackingField = new List<EventAreaDto>(Constants.EVENT_AREAS) };

            this._service = service;
            this.myAthletes = new ObservableCollection<AthleteDto>();
            this.showCurrent = true;
            this.showFuture = true;
            this.showPast = false;
            this.showAllInventoryItems = false;
            this.showOnlyDefaultInventoryItems = true;
            this.totalsByStatusModel = new TotalByStatusModel();

            this.SaveAthleteCommand = new RelayCommand(SaveAthlete);
            this.ClearFieldsCommand = new RelayCommand(ClearAthleteInfo);
            this.EditSelectedAthleteCommand = new RelayCommand<AthleteDto>(athleteToEdit => LoadAthleteInfoWithSelectedAthlete(athleteToEdit));

            Genders = new ObservableCollection<Char>(Data.Constants.GENDERS);
            Statuses = new ObservableCollection<String>(Data.Constants.ATHLETE_STATUSES);

            Messenger.Default.Register<ObservableCollection<AthleteDto>>(
                this,
                (a) => MyAthletes = a
            );
        }
开发者ID:OneTechieMom,项目名称:ShoeInventoryManager_GUI,代码行数:25,代码来源:AthleteViewModel.cs

示例2: OrganizationRepositoriesViewModel

 public OrganizationRepositoriesViewModel(IApplicationService applicationService)
     : base(applicationService)
 {
     ShowRepositoryOwner = false;
     LoadCommand.RegisterAsyncTask(t => 
         Repositories.SimpleCollectionLoad(applicationService.Client.Organizations[Name].Repositories.GetAll(), t as bool?));
 }
开发者ID:GSerjo,项目名称:CodeHub,代码行数:7,代码来源:OrganizationRepositoriesViewModel.cs

示例3: CashHomeViewModel

        public CashHomeViewModel(ScreenCoordinator screenCoordinator, IApplicationService applicationService)
        {
            ScreenCoordinator = screenCoordinator;
            ApplicationService = applicationService;

            Text = new BindableCollection<string>();
        }
开发者ID:edjo23,项目名称:shop,代码行数:7,代码来源:CashHomeViewModel.cs

示例4: AboutViewModel

 /// <summary>
 /// Initializes a new instance of the <see cref="AboutViewModel" /> class.
 /// </summary>
 /// <param name="settingsService">The settings service.</param>
 /// <param name="applicationService">The application service.</param>
 public AboutViewModel(
     ISettingsService settingsService,
     IApplicationService applicationService)
 {
     this.settingsService = settingsService;
     this.applicationService = applicationService;
 }
开发者ID:asudbury,项目名称:NinjaCoderForMvvmCross,代码行数:12,代码来源:AboutViewModel.cs

示例5: SegmentService

 public SegmentService(IIdentityLogicFactory identityLogicFactory, ITraitBuilder traitBuilder, IApplicationService applicationService, ILandlordService landlordService)
 {
     _identityLogicFactory = identityLogicFactory;
     _traitBuilder = traitBuilder;
     _applicationService = applicationService;
     _landlordService = landlordService;
 }
开发者ID:letmeproperty,项目名称:AutoMessaging,代码行数:7,代码来源:SegmentService.cs

示例6: IssueAssignedToViewModel

        public IssueAssignedToViewModel(IApplicationService applicationService)
        {
            _applicationService = applicationService;
            Users = new ReactiveCollection<BasicUserModel>();

            SelectUserCommand = new ReactiveCommand();
            SelectUserCommand.RegisterAsyncTask(async t =>
            {
                var selectedUser = t as BasicUserModel;
                if (selectedUser != null)
                    SelectedUser = selectedUser;

                if (SaveOnSelect)
                {
                    var assignee = SelectedUser != null ? SelectedUser.Login : null;
                    var updateReq = _applicationService.Client.Users[RepositoryOwner].Repositories[RepositoryName].Issues[IssueId].UpdateAssignee(assignee);
                    await _applicationService.Client.ExecuteAsync(updateReq);
                }

                DismissCommand.ExecuteIfCan();
            });

            LoadCommand.RegisterAsyncTask(t => 
                Users.SimpleCollectionLoad(applicationService.Client.Users[RepositoryOwner].Repositories[RepositoryName].GetAssignees(), t as bool?));
        }
开发者ID:GSerjo,项目名称:CodeHub,代码行数:25,代码来源:IssueAssignedToViewModel.cs

示例7: ProjectController

 public ProjectController(
     IApplicationService service, 
     IReadModelFacade facade)
 {
     _service = service;
     _facade = facade;
 }
开发者ID:mserrate,项目名称:PoorMansCQRS,代码行数:7,代码来源:ProjectController.cs

示例8: GistViewableFileViewModel

        public GistViewableFileViewModel(IApplicationService applicationService, IFilesystemService filesystemService)
        {
            GoToFileSourceCommand = ReactiveCommand.Create();

            LoadCommand = ReactiveCommand.CreateAsyncTask(async t =>
            {
                string data;
                using (var ms = new System.IO.MemoryStream())
                {
                    await applicationService.Client.DownloadRawResource(GistFile.RawUrl, ms);
                    ms.Position = 0;
                    var sr = new System.IO.StreamReader(ms);
                    data = sr.ReadToEnd();
                }
                if (GistFile.Language.Equals("Markdown"))
                    data = await applicationService.Client.Markdown.GetMarkdown(data);

                string path;
                using (var stream = filesystemService.CreateTempFile(out path, "gist.html"))
                {
                    using (var fs = new System.IO.StreamWriter(stream))
                    {
                        fs.Write(data);
                    }
                }

                FilePath = path;
            });
        }
开发者ID:nelsonnan,项目名称:CodeHub,代码行数:29,代码来源:GistViewableFileViewModel.cs

示例9: SourceTreeViewModel

        public SourceTreeViewModel(IApplicationService applicationService, IFeaturesService featuresService)
        {
            _applicationService = applicationService;
            _featuresService = featuresService;

            GoToItemCommand = ReactiveUI.ReactiveCommand.Create();
            GoToItemCommand.OfType<ContentModel>().Subscribe(x => {
                if (x.Type.Equals("dir", StringComparison.OrdinalIgnoreCase))
                {
                    ShowViewModel<SourceTreeViewModel>(new NavObject { Username = Username, Branch = Branch,
                        Repository = Repository, Path = x.Path, TrueBranch = TrueBranch });
                }
                if (x.Type.Equals("file", StringComparison.OrdinalIgnoreCase))
                {
                    if (x.DownloadUrl == null)
                    {
                        var nameAndSlug = x.GitUrl.Substring(x.GitUrl.IndexOf("/repos/", StringComparison.Ordinal) + 7);
                        var indexOfGit = nameAndSlug.LastIndexOf("/git", StringComparison.Ordinal);
                        indexOfGit = indexOfGit < 0 ? 0 : indexOfGit;
                        var repoId = RepositoryIdentifier.FromFullName(nameAndSlug.Substring(0, indexOfGit));
                        if (repoId == null)
                            return;

                        var sha = x.GitUrl.Substring(x.GitUrl.LastIndexOf("/", StringComparison.Ordinal) + 1);
                        ShowViewModel<SourceTreeViewModel>(new NavObject {Username = repoId?.Owner, Repository = repoId?.Name, Branch = sha});
                    }
                    else
                    {
                        ShowViewModel<SourceViewModel>(new SourceViewModel.NavObject {
                            Name = x.Name, Username = Username, Repository = Repository, Branch = Branch,
                            Path = x.Path, HtmlUrl = x.HtmlUrl, GitUrl = x.GitUrl, TrueBranch = TrueBranch });
                    }
                }
            });
        }
开发者ID:RaineriOS,项目名称:CodeHub,代码行数:35,代码来源:SourceTreeViewModel.cs

示例10: EditSourceViewModel

	    public EditSourceViewModel(IApplicationService applicationService)
	    {
            SaveCommand = new ReactiveCommand();
	        SaveCommand.Subscribe(_ =>
	        {
	            var vm = CreateViewModel<CommitMessageViewModel>();
	            vm.SaveCommand.RegisterAsyncTask(async t =>
	            {
                    var request = applicationService.Client.Users[Username].Repositories[Repository]
                        .UpdateContentFile(Path, vm.Message, Text, BlobSha, Branch);
                    var response = await applicationService.Client.ExecuteAsync(request);
	                Content = response.Data;
                    DismissCommand.ExecuteIfCan();
	            });
                ShowViewModel(vm);
	        });

	        LoadCommand.RegisterAsyncTask(async t =>
	        {
	            var path = Path;
                if (!path.StartsWith("/", StringComparison.Ordinal))
                    path = "/" + path;

	            var request = applicationService.Client.Users[Username].Repositories[Repository].GetContentFile(path, Branch ?? "master");
			    request.UseCache = false;
			    var data = await applicationService.Client.ExecuteAsync(request);
			    BlobSha = data.Data.Sha;
			    Text = System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(data.Data.Content));
	        });
	    }
开发者ID:GSerjo,项目名称:CodeHub,代码行数:30,代码来源:EditSourceViewModel.cs

示例11: ChangesetViewModel

        public ChangesetViewModel(IApplicationService applicationService)
        {
            _applicationService = applicationService;

            Comments = new ReactiveList<CommentModel>();

            GoToHtmlUrlCommand = ReactiveCommand.Create(this.WhenAnyValue(x => x.Commit).Select(x => x != null));
            GoToHtmlUrlCommand.Select(x => Commit).Subscribe(GoToUrlCommand.ExecuteIfCan);

            GoToRepositoryCommand = ReactiveCommand.Create();
            GoToRepositoryCommand.Subscribe(_ =>
            {
                var vm = CreateViewModel<RepositoryViewModel>();
                vm.RepositoryOwner = RepositoryOwner;
                vm.RepositoryName = RepositoryName;
                ShowViewModel(vm);
            });

            GoToFileCommand = ReactiveCommand.Create();
            GoToFileCommand.OfType<CommitModel.CommitFileModel>().Subscribe(x =>
            {
                if (x.Patch == null)
                {
                    var vm = CreateViewModel<SourceViewModel>();
                    vm.Branch = Commit.Sha;
                    vm.Username = RepositoryOwner;
                    vm.Repository = RepositoryName;
                    vm.Items = new [] 
                    { 
                        new SourceViewModel.SourceItemModel 
                        {
                            ForceBinary = true,
                            GitUrl = x.BlobUrl,
                            Name = x.Filename,
                            Path = x.Filename,
                            HtmlUrl = x.BlobUrl
                        }
                    };
                    vm.CurrentItemIndex = 0;
                    ShowViewModel(vm);
                }
                else
                {
                    var vm = CreateViewModel<ChangesetDiffViewModel>();
                    vm.Username = RepositoryOwner;
                    vm.Repository = RepositoryName;
                    vm.Branch = Commit.Sha;
                    vm.Filename = x.Filename;
                    ShowViewModel(vm);
                }
            });

            LoadCommand = ReactiveCommand.CreateAsyncTask(t =>
            {
                var forceCacheInvalidation = t as bool?;
                var t1 = this.RequestModel(_applicationService.Client.Users[RepositoryOwner].Repositories[RepositoryName].Commits[Node].Get(), forceCacheInvalidation, response => Commit = response.Data);
                Comments.SimpleCollectionLoad(_applicationService.Client.Users[RepositoryOwner].Repositories[RepositoryName].Commits[Node].Comments.GetAll(), forceCacheInvalidation).FireAndForget();
                return t1;
            });
        }
开发者ID:nelsonnan,项目名称:CodeHub,代码行数:60,代码来源:ChangesetViewModel.cs

示例12: ApplicationModule

        public ApplicationModule(IApplicationService applicationService, IErrorService error)
            : base("/application")
        {
            Post["/register"] = _ =>
            {
                if (Params.AreMissing("SingleUseToken", "Name")) return error.MissingParameters(Response);
                if (!Params.SingleUseToken.IsGuid()) return error.InvalidParameters(Response);
                if (!applicationService.AuthoriseSingleUseToken(Params.SingleUseToken)) return error.PermissionDenied(Response);

                var application = applicationService.Register(Params.Name);
                return (application == null) ? error.InvalidParameters(Response) : Response.AsJson(new { ApplicationId = application.Id });

            };

            Post["/transfer"] = _ =>
            {
                if (Params.AreMissing("SingleUseToken", "Name", "Id")) return error.MissingParameters(Response);
                if (!Params.Id.IsGuid() || !Params.SingleUseToken.IsGuid()) return error.InvalidParameters(Response);
                if (!applicationService.AuthoriseSingleUseToken(Params.SingleUseToken)) return error.PermissionDenied(Response);

                var application = applicationService.Transfer(Params.Name, Params.Id);
                return (application == null) ? error.InvalidParameters(Response) : Response.AsJson(new { ApplicationId = application.Id });

            };
        }
开发者ID:biofractal,项目名称:ThumbsUp,代码行数:25,代码来源:ApplicationModule.cs

示例13: BaseEventsViewModel

        protected BaseEventsViewModel(IApplicationService applicationService)
        {
            ApplicationService = applicationService;
            Events = new ReactiveCollection<Tuple<EventModel, EventBlock>>();
            ReportRepository = true;

            GoToRepositoryCommand = new ReactiveCommand();
            GoToRepositoryCommand.OfType<EventModel.RepoModel>().Subscribe(x =>
            {
                var repoId = new RepositoryIdentifier(x.Name);
                var vm = CreateViewModel<RepositoryViewModel>();
                vm.RepositoryOwner = repoId.Owner;
                vm.RepositoryName = repoId.Name;
                ShowViewModel(vm);
            });

            GoToGistCommand = new ReactiveCommand();
            GoToGistCommand.OfType<EventModel.GistEvent>().Subscribe(x =>
            {
                var vm = CreateViewModel<GistViewModel>();
                vm.Id = x.Gist.Id;
                vm.Gist = x.Gist;
                ShowViewModel(vm);
            });

            LoadCommand.RegisterAsyncTask(t => 
                this.RequestModel(CreateRequest(0, 100), t as bool?, response =>
                {
                    this.CreateMore(response, m => Events.MoreTask = m, d => Events.AddRange(CreateDataFromLoad(d)));
                    Events.Reset(CreateDataFromLoad(response.Data));
                }));
        }
开发者ID:GSerjo,项目名称:CodeHub,代码行数:32,代码来源:BaseEventsViewModel.cs

示例14: CampaignLogicFactory

        public CampaignLogicFactory(
            ISubscriberTrackingService<ApplicationSummary> applicationSubscriberTrackingService,
            IDataGatherFactory<ApplicationSummary> applicationGatherFactory,
            IDataGatherFactory<LandlordSummary> landlordGatherFactory,
            ISubscriberTrackingService<LandlordSummary> landlordSubscriberTrackingService,
            IApplicationService applicationService,
            ILetMeServiceUrlSettings letMeServiceUrlSettings,
            ISubscriberRecordService subscriberRecordService,
            ILogger logger
            )
        {
            Check.If(landlordSubscriberTrackingService).IsNotNull();
            Check.If(applicationService).IsNotNull();
            Check.If(applicationGatherFactory).IsNotNull();
            Check.If(letMeServiceUrlSettings).IsNotNull();
            Check.If(landlordSubscriberTrackingService).IsNotNull();

            _campaignLogic = new List<ICampaignLogic>
            {
                new AddApplicationNoGuarantorEventLogic(applicationGatherFactory, applicationSubscriberTrackingService, logger),
                new NewPropertyAddedEventLogic(applicationGatherFactory, applicationSubscriberTrackingService, letMeServiceUrlSettings, subscriberRecordService, logger),
                new BookAViewingCampaignLogic(applicationGatherFactory, applicationSubscriberTrackingService),
                new DeclinedGuarantorCampaignLogic(applicationGatherFactory, applicationSubscriberTrackingService),
                new NewPropertySubmissionCampaignLogic(landlordGatherFactory,landlordSubscriberTrackingService)
            };
        }
开发者ID:letmeproperty,项目名称:AutoMessaging,代码行数:26,代码来源:CampaignLogicFactory.cs

示例15: AddInterestViewModel

        public AddInterestViewModel(IApplicationService applicationService)
        {
            DoneCommand = ReactiveCommand.CreateAsyncTask(async _ =>
            {
                if (SelectedLanguage == null)
                    throw new Exception("You must select a language for your interest!");
                if (string.IsNullOrEmpty(Keyword))
                    throw new Exception("Please specify a keyword to go with your interest!");

                applicationService.Account.Interests.Insert(new Interest
                {
                    Language = _selectedLanguage.Name,
                    LanguageId = _selectedLanguage.Slug,
                    Keyword = _keyword
                });

                await DismissCommand.ExecuteAsync();
            });

            GoToLanguagesCommand = ReactiveCommand.Create();
            GoToLanguagesCommand.Subscribe(_ =>
            {
                var vm = CreateViewModel<LanguagesViewModel>();
                vm.SelectedLanguage = SelectedLanguage;
                vm.WhenAnyValue(x => x.SelectedLanguage).Skip(1).Subscribe(x =>
                {
                    SelectedLanguage = x;
                    vm.DismissCommand.ExecuteIfCan();
                });
                ShowViewModel(vm);
            });

            var str = System.IO.File.ReadAllText(PopularInterestsPath, System.Text.Encoding.UTF8);
            PopularInterests = new ReactiveList<PopularInterest>(JsonConvert.DeserializeObject<List<PopularInterest>>(str));
        }
开发者ID:memopower,项目名称:RepoStumble,代码行数:35,代码来源:AddInterestViewModel.cs


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