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; }
public AppInstaller(IAppService appService, ILog log, IAppLinksService appLinksService, IRoutes routes) { _appService = appService; _logger = log; _appLinksService = appLinksService; _routes = routes; }
public FriendListViewModel(IUserDataRepository userDataRepository, IAppService appService) { _userDataRepository = userDataRepository; _appService = appService; SelectionChanged = new RelayCommand(Go); }
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; }
/// <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 ); }
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; }
public ApiControllerBuilder() { _wordService = null; _tagService = null; _appService = null; _requestLogService = null; }
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"); }
public UserControllerBuilder() { _appService = null; _formsAuthenticationService = null; _userService = null; _wordService = null; }
public PlayerViewModel(IUserDataRepository userDataRepository, IAppService appService) { _userDataRepository = userDataRepository; _appService = appService; Messenger.Default.Register<Song>(this, PlayListChange); }
/// <summary> /// Initializes a new instance of the MainViewModel class. /// </summary> /// /// public MainViewModel(IUserDataRepository userDataRepository,IAppService appService) { _appService = appService; _appService.AuthenticateUser(); _userDataRepository = userDataRepository; }
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"); }
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; }
public AccountController(ApplicationUserManager userManager, ApplicationSignInManager signInManager, IDragonUserStore<AppMember> userStore, IFederationService federationService, IAppService appService) { _userStore = userStore; _federationService = federationService; _appService = appService; UserManager = userManager; SignInManager = signInManager; }
public AppController( IUserService userService, IFormsAuthenticationService formsAuthenticationService, IAppService appService) : base(userService, formsAuthenticationService) { _appService = appService; }
public PlayListViewModel(IUserDataRepository userDataRepository, IAppService appService) { _userDataRepository = userDataRepository; _appService = appService; SelectionChanged = new RelayCommand(Go); Messenger.Default.Register<PlayList>(this,PlayListChange); }
public AuthorizationServerProvider(IUserService userService, IAdminUserService adminUserService, IAppService appService, ICommandBus commandBus) { this.userService = userService; this.adminUserService = adminUserService; this.appService = appService; this.commandBus = commandBus; }
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")); }
public UserController( IUserService userService, IWordService wordService, IFormsAuthenticationService formsAuthenticationService, IAppService appService) : base(userService, formsAuthenticationService) { _appService = appService; _wordService = wordService; }
public UserController(IUserProfileService userProfileService, IUserFancyAppService userFancyAppService , IAppService appService, IRoleService roleService, IRoleAppService roleAppService ) { this._userProfileService = userProfileService; this._userFancyAppService = userFancyAppService; this._appService = appService; this._roleService = roleService; this._roleAppService = roleAppService; }
public ActionResult Execute(IAppService app) { Context.SetActiveSite("shell"); foreach (var troubleshooter in Troubleshooters.OrderBy(t => t.Priority)) { troubleshooter.Troubleshoot(app); } return null; }
public AuthorizeBackend() { AppService = DependencyResolver.Current.GetService(typeof(IAppService)) as IAppService; var roles = new List<RolesEnum> { RolesEnum.Backend, RolesEnum.Supporter }; Roles = string.Join(",", roles); }
public SplashViewModel(INavigationService navigationService, ISessionRepository sessionRepository, ISpeakerRepository speakerRepository, IAppService applicationService, IChangeRepository changeRepository, IChangeService changeService) : base(navigationService) { // assignments SessionRepository = sessionRepository; SpeakerRepository = speakerRepository; ChangeRepository = changeRepository; ApplicationService = applicationService; ChangeService = changeService; LoadStatus = "Preparing Application..."; }
public ApiController( IUserService userService, IWordService wordService, ITagService tagService, IAppService appService, IRequestLogService requestLogService, IFormsAuthenticationService formsAuthenticationService) : base(userService, formsAuthenticationService) { _wordService = wordService; _tagService = tagService; _appService = appService; _requestLogService = requestLogService; }
/// <summary> /// 获取应用 /// </summary> /// <param name="AppService"></param> /// <param name="key">移除当前键,当为""或null不移除</param> /// <returns></returns> public static List<ChooseDictionary> ListAllAppInfo(IAppService AppService, string key) { NameValueCollection nvc = new NameValueCollection(); nvc.Add("isvalid", "1"); NameValueCollection orderby = new NameValueCollection(); orderby.Add("appname", "asc"); List<AppInfo> datalist = AppService.ListAllByCondition(nvc, orderby); if (!string.IsNullOrEmpty(key)) { datalist.Remove(datalist.Where(x => x.Id.Equals(key)).SingleOrDefault()); } var dicApp = (from slist in datalist select new ChooseDictionary { Text = slist.AppName, Value = slist.Id, ParentId = null }).ToList(); return dicApp; }
public ActionResult Execute(IAppService app) { WebsiteDirectory = FileUtil.MapPath("/"); foreach (var mapper in PathMapper.WebsiteItemPathToProjectDirectories) { ImportItems(app, mapper); } foreach (var mapper in PathMapper.WebsiteDirectoryToProjectDirectories) { ImportFiles(app, mapper); } return null; }
/// <summary> /// Initializes a new instance of the MainViewModel class. /// </summary> public AppVM(IAppService dataService) { _dataService = dataService; _dataService.GetData( (item, error) => { if (error != null) { // TODO: Report error here return; } _appModel = item; _appModel.CurrentPageChanged += CurrentPageChanged; }); }
public ActionResult Execute(IAppService app) { Console.WriteLine("Republishing master database..."); BackgroundJob.Run("Pathfinder Republish", "Publishing", Republish); Console.WriteLine("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")); Console.WriteLine("Rebuilding link database..."); BackgroundJob.Run("Pathfinder Rebuild Link Database", "Link Database", () => RebuildLinkDatabase("master")); BackgroundJob.Run("Pathfinder Rebuild Link Database", "Link Database", () => RebuildLinkDatabase("core")); return null; }
public NewsFeedsController(IResourceService resourceService, IAppService appService, ILauncherService launcherService, IMessageService messageService, ISyndicationService syndicationService, SelectionService selectionService, Lazy<FeedListViewModel> feedListViewModel) { this.resourceService = resourceService; this.appService = appService; this.launcherService = launcherService; this.messageService = messageService; this.selectionService = selectionService; this.feedListViewModel = feedListViewModel; this.client = syndicationService.CreateClient(); this.addNewFeedCommand = new AsyncDelegateCommand(AddNewFeed); this.removeFeedCommand = new AsyncDelegateCommand(RemoveFeedAsync, CanRemoveFeed); this.refreshFeedCommand = new AsyncDelegateCommand(RefreshFeed, CanRefreshFeed); this.readUnreadCommand = new DelegateCommand(MarkAsReadUnread, CanMarkAsReadUnread); this.launchWebBrowserCommand = new AsyncDelegateCommand(LaunchWebBrowser, CanLaunchWebBrowser); this.selectionService.PropertyChanged += SelectionServicePropertyChanged; }
public static List<AppCategoryListModel> GetGroupedApp(this IList<int> source, IAppService appService) { var list = new List<AppCategoryListModel>(); foreach (var i in source) { var model = new AppCategoryListModel(); var d = appService.List().Where(m => m.IsPublic==true && m.AppCategoryId == i).ToList().Select(m => { var t = m.ToModel(); t.AppCategoryName = m.AppCategory.Name; return t; }); model.AppCategoryName = d.First().AppCategoryName; model.AppModelList = d.ToList(); list.Add(model); } return list; }
DocumentsCommand(Lazy <IUndoCommandService> undoCommandService, Lazy <IDocumentSaver> documentSaver, IAppService appService) { this.undoCommandService = undoCommandService; this.documentSaver = documentSaver; this.appService = appService; }
internal static void Execute(Lazy <IUndoCommandService> undoCommandService, Lazy <IDocumentSaver> documentSaver, IAppService appService, DocumentTreeNodeData[] nodes) { if (!CanExecute(nodes)) { return; } var asmNodes = nodes.Cast <DsDocumentNode>().ToArray(); var files = asmNodes.SelectMany(a => a.Document.GetAllChildrenAndSelf()); if (!documentSaver.Value.AskUserToSaveIfModified(files)) { return; } var keepNodes = new List <DsDocumentNode>(); var freeNodes = new List <DsDocumentNode>(); var onlyInRedoHistory = new List <DsDocumentNode>(); foreach (var info in GetUndoRedoInfo(undoCommandService.Value, asmNodes)) { if (!info.IsInUndo && !info.IsInRedo) { // This asm is safe to remove freeNodes.Add(info.Node); } else if (!info.IsInUndo && info.IsInRedo) { // If we add a RemoveAssemblyCommand, the redo history will be cleared, so this // assembly will be cleared from the history and don't need to be kept. onlyInRedoHistory.Add(info.Node); } else { // The asm is in the undo history, and maybe in the redo history. We must keep it. keepNodes.Add(info.Node); } } if (keepNodes.Count > 0 || onlyInRedoHistory.Count > 0) { // We can't free the asm since older commands might reference it so we must record // it in the history. The user can click Clear History to free everything. foreach (var node in keepNodes) { foreach (var f in node.Document.GetAllChildrenAndSelf()) { MemoryMappedIOHelper.DisableMemoryMappedIO(f); } } if (keepNodes.Count != 0) { undoCommandService.Value.Add(new RemoveAssemblyCommand(appService.DocumentTreeView, keepNodes.ToArray())); } else { undoCommandService.Value.ClearRedo(); } // Redo history was cleared FreeAssemblies(onlyInRedoHistory); } FreeAssemblies(freeNodes); if (freeNodes.Count > 0 || onlyInRedoHistory.Count > 0) { undoCommandService.Value.CallGc(); } }
DocumentsCommand(Lazy <IUndoCommandService> undoCommandService, IAppService appService) { this.undoCommandService = undoCommandService; this.appService = appService; }
EditMenuCommand(Lazy <IUndoCommandService> undoCommandService, IAppService appService) : base(appService.DocumentTreeView) { this.undoCommandService = undoCommandService; this.appService = appService; }
internal static void Execute(EditCodeVMCreator editCodeVMCreator, Lazy <IAddUpdatedNodesHelperProvider> addUpdatedNodesHelperProvider, Lazy <IUndoCommandService> undoCommandService, IAppService appService, DocumentTreeNodeData[] nodes, IList <MethodSourceStatement>?statements = null) { if (!CanExecute(editCodeVMCreator, nodes)) { return; } var node = nodes[0]; var tokNode = node as IMDTokenNode; var defToEdit = tokNode?.Reference as IMemberDef; if (defToEdit is null) { return; } TypeNode?typeNode = null; for (TreeNodeData?n = node; n is not null;) { if (n is TypeNode t) { typeNode = t; } n = n.TreeNode.Parent?.Data; } if (typeNode is null) { return; } var asmNode = nodes[0] as AssemblyDocumentNode; ModuleDocumentNode?modNode; if (asmNode is not null) { asmNode.TreeNode.EnsureChildrenLoaded(); modNode = asmNode.TreeNode.DataChildren.FirstOrDefault() as ModuleDocumentNode; } else { modNode = nodes[0].GetModuleNode(); } Debug2.Assert(modNode is not null); if (modNode is null) { return; } var vm = editCodeVMCreator.CreateEditClass(defToEdit, statements ?? Array.Empty <MethodSourceStatement>()); var win = new EditCodeDlg(); win.DataContext = vm; win.Owner = appService.MainWindow; win.Title = $"{dnSpy_AsmEditor_Resources.EditCodeEditClass} - {typeNode.ToString()}"; if (win.ShowDialog() != true) { vm.Dispose(); return; } Debug2.Assert(vm.Result is not null); undoCommandService.Value.Add(new EditClassCommand(addUpdatedNodesHelperProvider, modNode, vm.Result)); vm.Dispose(); }
static void Execute(EditCodeVMCreator editCodeVMCreator, Lazy <IAddUpdatedNodesHelperProvider> addUpdatedNodesHelperProvider, Lazy <IUndoCommandService> undoCommandService, IAppService appService, DocumentTreeNodeData[] nodes) { if (!CanExecute(editCodeVMCreator, nodes)) { return; } var asmNode = nodes[0] as AssemblyDocumentNode; ModuleDocumentNode modNode; if (asmNode != null) { asmNode.TreeNode.EnsureChildrenLoaded(); modNode = asmNode.TreeNode.DataChildren.FirstOrDefault() as ModuleDocumentNode; } else { modNode = nodes[0].GetModuleNode(); } Debug.Assert(modNode != null); if (modNode == null) { return; } var module = modNode.Document.ModuleDef; Debug.Assert(module != null); if (module == null) { throw new InvalidOperationException(); } if (module.IsManifestModule) { asmNode = modNode.TreeNode.Parent?.Data as AssemblyDocumentNode; } else { asmNode = null; } var vm = editCodeVMCreator.CreateAddClass(module); var win = new EditCodeDlg(); win.DataContext = vm; win.Owner = appService.MainWindow; win.Title = string.Format("{0} - {1}", dnSpy_AsmEditor_Resources.EditCodeAddClass, asmNode?.ToString() ?? modNode.ToString()); if (win.ShowDialog() != true) { vm.Dispose(); return; } Debug.Assert(vm.Result != null); undoCommandService.Value.Add(new AddClassCommand(addUpdatedNodesHelperProvider, modNode, vm.Result)); vm.Dispose(); }
CodeCommand(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; }
public CategoriesViewModel(INavigationService navigationService, IAppService appService) : base(navigationService) { _appService = appService; }
internal static void Execute(EditCodeVMCreator editCodeVMCreator, Lazy <IAddUpdatedNodesHelperProvider> addUpdatedNodesHelperProvider, Lazy <IUndoCommandService> undoCommandService, IAppService appService, DocumentTreeNodeData[] nodes) { if (!CanExecute(editCodeVMCreator, nodes)) { return; } var node = nodes[0]; var tokNode = node as IMDTokenNode; var defToEdit = tokNode?.Reference as IMemberDef; if (defToEdit is null) { return; } TypeNode?typeNode = null; for (TreeNodeData?n = node; !(n is null);)
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; }
public LinkController(IAppService appService) { _appService = appService; }
public ListarModel(IAppService <SistemaViewModel> sistemaAppService) { _sistemaAppService = sistemaAppService; }
static void Execute(IPickFilename pickFilename, Lazy <IAddUpdatedNodesHelperProvider> addUpdatedNodesHelperProvider, Lazy <IUndoCommandService> undoCommandService, IAppService appService, DocumentTreeNodeData[] nodes) { if (!CanExecute(nodes)) { return; } var asmNode = nodes[0] as AssemblyDocumentNode; ModuleDocumentNode modNode; if (asmNode != null) { asmNode.TreeNode.EnsureChildrenLoaded(); modNode = asmNode.TreeNode.DataChildren.FirstOrDefault() as ModuleDocumentNode; } else { modNode = nodes[0].GetModuleNode(); } Debug.Assert(modNode != null); if (modNode == null) { return; } var module = modNode.Document.ModuleDef; Debug.Assert(module != null); if (module == null) { throw new InvalidOperationException(); } var filename = pickFilename.GetFilename(null, "dll", PickFilenameConstants.DotNetAssemblyOrModuleFilter); var result = GetModuleBytes(filename); if (result == null) { return; } // This is a basic assembly merger, we don't support merging dependencies. It would require // fixing all refs to the dep and redirect them to the new defs that now exist in 'module'. var asm = module.Assembly; if (asm != null && result.Value.Assembly != null) { if (IsNonSupportedAssembly(module, asm, result.Value.Assembly)) { Contracts.App.MsgBox.Instance.Show($"Can't merge with {result.Value.Assembly} because it's a dependency"); return; } } var importer = new ModuleImporter(module); try { importer.Import(result.Value.RawBytes, result.Value.DebugFile, ModuleImporterOptions.None); } catch (Exception ex) { Contracts.App.MsgBox.Instance.Show(ex); return; } undoCommandService.Value.Add(new MergeWithAssemblyCommand(addUpdatedNodesHelperProvider, modNode, importer)); }