本文整理汇总了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
);
}
示例2: OrganizationRepositoriesViewModel
public OrganizationRepositoriesViewModel(IApplicationService applicationService)
: base(applicationService)
{
ShowRepositoryOwner = false;
LoadCommand.RegisterAsyncTask(t =>
Repositories.SimpleCollectionLoad(applicationService.Client.Organizations[Name].Repositories.GetAll(), t as bool?));
}
示例3: CashHomeViewModel
public CashHomeViewModel(ScreenCoordinator screenCoordinator, IApplicationService applicationService)
{
ScreenCoordinator = screenCoordinator;
ApplicationService = applicationService;
Text = new BindableCollection<string>();
}
示例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;
}
示例5: SegmentService
public SegmentService(IIdentityLogicFactory identityLogicFactory, ITraitBuilder traitBuilder, IApplicationService applicationService, ILandlordService landlordService)
{
_identityLogicFactory = identityLogicFactory;
_traitBuilder = traitBuilder;
_applicationService = applicationService;
_landlordService = landlordService;
}
示例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?));
}
示例7: ProjectController
public ProjectController(
IApplicationService service,
IReadModelFacade facade)
{
_service = service;
_facade = facade;
}
示例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;
});
}
示例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 });
}
}
});
}
示例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));
});
}
示例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;
});
}
示例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 });
};
}
示例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));
}));
}
示例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)
};
}
示例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));
}