本文整理汇总了C#中IAppService类的典型用法代码示例。如果您正苦于以下问题:C# IAppService类的具体用法?C# IAppService怎么用?C# IAppService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IAppService类属于命名空间,在下文中一共展示了IAppService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProjectViewModel
/// <summary>
/// Create a new project
/// </summary>
public ProjectViewModel(IAppService appService)
{
this._AppService = appService;
Project = new Model.TranslationProject();
Groups = new ObservableCollection<GroupViewModel>();
Editors = new ObservableCollection<TranslationEditorViewModel>();
OpenTranslationCommand = new RelayCommand<TranslationFileViewModel>(
async file => {
Exception error = null;
try
{
await OpenTranslationAsync(file);
}
catch (Exception ex)
{
error = ex;
}
if (error != null)
await _AppService.ShowError(error);
},
file => file != null
);
CloseEditorCommand = new RelayCommand<TranslationEditorViewModel>(
async editor => await CloseEditorAsync(editor),
editor => editor != null
);
}
示例2: AppInstaller
public AppInstaller(IAppService appService, ILog log, IAppLinksService appLinksService, IRoutes routes)
{
_appService = appService;
_logger = log;
_appLinksService = appLinksService;
_routes = routes;
}
示例3: EditMenuCommand
EditMenuCommand(Lazy<IUndoCommandService> undoCommandService, Lazy<IAddUpdatedNodesHelperProvider> addUpdatedNodesHelperProvider, IAppService appService, IPickFilename pickFilename)
: base(appService.DocumentTreeView) {
this.undoCommandService = undoCommandService;
this.addUpdatedNodesHelperProvider = addUpdatedNodesHelperProvider;
this.appService = appService;
this.pickFilename = pickFilename;
}
示例4: CodeCommand
CodeCommand(Lazy<IUndoCommandService> undoCommandService, Lazy<IAddUpdatedNodesHelperProvider> addUpdatedNodesHelperProvider, IAppService appService, EditCodeVMCreator editCodeVMCreator)
: base(appService.DocumentTreeView) {
this.undoCommandService = undoCommandService;
this.addUpdatedNodesHelperProvider = addUpdatedNodesHelperProvider;
this.appService = appService;
this.editCodeVMCreator = editCodeVMCreator;
}
示例5: Execute
public ActionResult Execute(IAppService app)
{
WebsiteDirectory = FileUtil.MapPath("/");
FileSystem = app.CompositionService.Resolve<IFileSystemService>();
Trace = app.CompositionService.Resolve<ITraceService>();
Factory = app.CompositionService.Resolve<IFactoryService>();
foreach (var pair in app.Configuration.GetSubKeys("import-website"))
{
var key = "import-website:" + pair.Key;
var databaseName = app.Configuration.GetString(key + ":database");
if (key == "import-website:exclude-fields")
{
continue;
}
if (!string.IsNullOrEmpty(databaseName))
{
ImportItems(app, key);
}
else
{
ImportFiles(app, key);
}
}
return null;
}
示例6: MainViewModel
/// <summary>
/// Initializes a new instance of the MainViewModel class.
/// </summary>
///
///
public MainViewModel(IUserDataRepository userDataRepository,IAppService appService)
{
_appService = appService;
_appService.AuthenticateUser();
_userDataRepository = userDataRepository;
}
示例7: PlayerViewModel
public PlayerViewModel(IUserDataRepository userDataRepository, IAppService appService)
{
_userDataRepository = userDataRepository;
_appService = appService;
Messenger.Default.Register<Song>(this, PlayListChange);
}
示例8: Execute
public ActionResult Execute(IAppService app)
{
TempFolder.EnsureFolder();
var tempDirectory = Path.Combine(FileUtil.MapPath(TempFolder.Folder), "Pathfinder.Exports");
if (Directory.Exists(tempDirectory))
{
FileUtil.DeleteDirectory(tempDirectory, true);
}
Directory.CreateDirectory(tempDirectory);
var exportFileName = Path.Combine(FileUtil.MapPath(tempDirectory), "Pathfinder.Exports.zip");
using (var zip = new ZipWriter(exportFileName))
{
foreach (var index in app.Configuration.GetSubKeys("write-website-exports"))
{
var entryName = app.Configuration.GetString("write-website-exports:" + index.Key + ":filename");
var fileKey = "write-website-exports:" + index.Key + ":";
var fileName = Path.Combine(tempDirectory, PathHelper.NormalizeFilePath(entryName).TrimStart('\\'));
Directory.CreateDirectory(Path.GetDirectoryName(fileName) ?? string.Empty);
WriteFile(app.Configuration, tempDirectory, fileName, fileKey);
zip.AddEntry(entryName, fileName);
}
}
return new FilePathResult(exportFileName, "application/zip");
}
示例9: Execute
public ActionResult Execute(IAppService app)
{
TempFolder.EnsureFolder();
var fileName = FileUtil.MapPath(TempFolder.GetFilename("Pathfinder.Resources.zip"));
using (var zip = new ZipWriter(fileName))
{
foreach (var pair in app.Configuration.GetSubKeys("sync-website:files"))
{
var configKey = "sync-website:files:" + pair.Key + ":";
var syncFileName = app.Configuration.GetString(configKey + "file");
foreach (var synchronizer in Synchronizers)
{
if (synchronizer.CanSynchronize(app.Configuration, syncFileName))
{
synchronizer.Synchronize(app.Configuration, zip, syncFileName, configKey);
}
}
}
}
return new FilePathResult(fileName, "application/zip");
}
示例10: Execute
public ActionResult Execute(IAppService app)
{
SerializingDataProvider.Disabled = true;
try
{
foreach (var mapper in PathMapper.WebsiteItemPathToProjectDirectories)
{
DeleteItems(mapper);
}
foreach (var mapper in PathMapper.WebsiteDirectoryToProjectDirectories)
{
DeleteFiles(app.ProjectDirectory, mapper);
}
var fileSystem = app.CompositionService.Resolve<IFileSystemService>();
foreach (var pair in app.Configuration.GetSubKeys("reset-website"))
{
var key = "reset-website:" + pair.Key;
ResetItems(app, key);
ResetFiles(app, fileSystem, key);
}
}
finally
{
SerializingDataProvider.Disabled = false;
}
return null;
}
示例11: FriendListViewModel
public FriendListViewModel(IUserDataRepository userDataRepository, IAppService appService)
{
_userDataRepository = userDataRepository;
_appService = appService;
SelectionChanged = new RelayCommand(Go);
}
示例12: Troubleshoot
public override void Troubleshoot(IAppService app)
{
Console.WriteLine(Texts.Rebuilding_indexes___);
BackgroundJob.Run("Pathfinder Rebuild ContentSearch Indexes", "Indexing", RebuildContentSearchIndexes);
BackgroundJob.Run("Pathfinder Rebuild Classic Indexes", "Indexing", () => RebuildClassicIndex("master"));
BackgroundJob.Run("Pathfinder Rebuild Classic Indexes", "Indexing", () => RebuildClassicIndex("core"));
}
示例13: AppController
public AppController(
IUserService userService,
IFormsAuthenticationService formsAuthenticationService,
IAppService appService)
: base(userService, formsAuthenticationService)
{
_appService = appService;
}
示例14: PlayListViewModel
public PlayListViewModel(IUserDataRepository userDataRepository, IAppService appService)
{
_userDataRepository = userDataRepository;
_appService = appService;
SelectionChanged = new RelayCommand(Go);
Messenger.Default.Register<PlayList>(this,PlayListChange);
}
示例15: AuthorizationServerProvider
public AuthorizationServerProvider(IUserService userService, IAdminUserService adminUserService,
IAppService appService, ICommandBus commandBus)
{
this.userService = userService;
this.adminUserService = adminUserService;
this.appService = appService;
this.commandBus = commandBus;
}