/// <summary> /// Creates a new instance of <see cref="OpenOptionsDialogCommand"/> /// </summary> /// <param name="optionsDialogFactory">Factory to get an instance of an <see cref="OptionDialog"/>.</param> /// <param name="dialogHostFactory">Factory to get an instance of an <see cref="DialogHostBase"/>.</param> public OpenOptionsDialogCommand( Func <OptionDialog> optionsDialogFactory, Func <DialogHostBase> dialogHostFactory) { _optionsDialog = optionsDialogFactory(); _dialogHost = dialogHostFactory(); }
/// <summary> /// Creates a new instance of <see cref="OpenLibraryManagerDialogCommand"/> /// </summary> /// <param name="libraryManagerDialogFactory">Factory to get an instance of an <see cref="LibraryManagerDialog"/>.</param> /// <param name="dialogHostFactory">Factory to get an instance of an <see cref="DialogHostBase"/>.</param> public OpenLibraryManagerDialogCommand( Func <LibraryManagerDialog> libraryManagerDialogFactory, Func <DialogHostBase> dialogHostFactory) { _libraryManagerDialog = libraryManagerDialogFactory(); _dialogHost = dialogHostFactory(); }
/// <summary> /// Creates a new instance of <see cref="NodeHelp"/>. /// </summary> /// <param name="nodeProviderFactory">A factory that returns an instance of <see cref="INodeProvider"/>.</param> /// <param name="dialogHostFactory">A factory that returns an instance of <see cref="DialogHostBase"/>.</param> public NodeHelp( Func <INodeProvider> nodeProviderFactory, Func <DialogHostBase> dialogHostFactory) { _nodeProvider = nodeProviderFactory(); _dialogHost = dialogHostFactory(); }
/// <summary> /// Creates a new instance of <see cref="NodePalette"/>. /// </summary> /// <param name="nodeProviderFactory">A factory that returns an instance of <see cref="INodeProvider"/>.</param> /// <param name="dialogHostFactory">A factory that returns an instance of <see cref="DialogHostBase"/>.</param> public NodePalette(Func <INodeProvider> nodeProviderFactory, Func <DialogHostBase> dialogHostFactory) { _nodeProvider = nodeProviderFactory(); _dialogHost = dialogHostFactory(); if (_nodeProvider is NodeProvider provider) { provider.NodeRegistered += NodeProviderNodeRegistered; } AddNodes(); }
public AppContainerBuilder() { this.RegisterType <MessageBoxService>().As <IMessageBoxService>(); this.RegisterType <FileDialogService>().As <IFileDialogService>(); this.RegisterType <VersionChecker>().As <IVersionChecker>(); this.RegisterType <DialogProvider>().As <IDialogProvider>(); this.RegisterType <ToolInfo>().As <IToolInfo>(); this.RegisterType <UrlHelper>().As <IUrlHelper>(); this.RegisterType <MainWindowViewModel>(); DialogHostBase.RegisterDialogViewModels(this); }
public App() { var builder = new ContainerBuilder(); builder.RegisterType <MessageBoxService>().As <IMessageBoxService>(); builder.RegisterType <FileDialogService>().As <IFileDialogService>(); builder.RegisterType <VersionChecker>().As <IVersionChecker>(); builder.RegisterType <DialogProvider>().As <IDialogProvider>(); builder.RegisterType <MainWindowViewModel>(); DialogHostBase.RegisterDialogViewModels(builder); this.container = builder.Build(); }
private Shell CreateShell( ShellCommandBase shellCommand, IHotkeyHandler hotkeyCommander, ContextMenuBase contextMenuBase, ScreenHostBase screenHostBase, DialogHostBase dialogHostBase, ToolbarBase toolbarBase) { return(new Shell( CreateFactoryFor(shellCommand, "startCommand"), CreateFactoryFor(hotkeyCommander), CreateFactoryFor(contextMenuBase), CreateFactoryFor(screenHostBase), CreateFactoryFor(dialogHostBase), CreateFactoryFor(toolbarBase))); }
public App() { var builder = new ContainerBuilder(); builder.RegisterType<MessageBoxService>().As<IMessageBoxService>(); builder.RegisterType<FileDialogService>().As<IFileDialogService>(); builder.RegisterType<VersionChecker>().As<IVersionChecker>(); builder.RegisterType<DialogProvider>().As<IDialogProvider>(); builder.RegisterType<ToolInfo>().As<IToolInfo>(); builder.RegisterType<MainWindowViewModel>(); DialogHostBase.RegisterDialogViewModels(builder); this.container = builder.Build(); this.Dispatcher.UnhandledException += this.OnUnhandledException; }
/// <summary> /// Creates a new instance of <see cref="ProjectManager"/>. /// </summary> /// <param name="dialogHostFactory">A factory that returns a <see cref="DialogHostBase"/>.</param> /// <param name="diagramFactoryFactory">A factory that returns an <see cref="DiagramFactory"/>.</param> /// <param name="libraryManagerFactory">A factory that returns an <see cref="ILibraryManager"/>.</param> /// <param name="projectFileServiceFactory">A factory that returns a <see cref="IProjectFileService"/>.</param> /// <param name="nodeServiceProviderFactory">A factory that returns a <see cref="NodeServiceProvider"/>.</param> public ProjectManager( Func <DialogHostBase> dialogHostFactory, Func <DiagramFactory> diagramFactoryFactory, Func <ILibraryManager> libraryManagerFactory, Func <IProjectFileService> projectFileServiceFactory, Func <ITransactor> transactorFactory, Func <NodeServiceProvider> nodeServiceProviderFactory) { _dialogHost = dialogHostFactory(); _libraryManager = libraryManagerFactory(); _projectFileService = projectFileServiceFactory(); _transactor = transactorFactory(); _diagramFactory = diagramFactoryFactory(); _nodeServiceProvider = nodeServiceProviderFactory(); _nodeServiceProvider.RegisterService <IProjectManager>(this); _transactor.Transacted += DirtyProject; }
/// <summary> /// Creates a new instance of <see cref="ProjectFileService"/>. /// </summary> /// <param name="directoryServiceFactory">A factory that returns an <see cref="IDirectoryService"/>.</param> /// <param name="loadSaveFactory">A factory that returns an <see cref="IProjectLoadSave"/>.</param> /// <param name="saveProjectDialogFactory">A factory that returns a <see cref="SaveProjectDialog"/>.</param> /// <param name="loadProjectDialogFactory">A factory that returns a <see cref="LoadProjectDialog"/>.</param> /// <param name="dialogHostFactory">A factory that returns a <see cref="DialogHostBase"/>.</param> public ProjectFileService( Func <IDirectoryService> directoryServiceFactory, Func <IProjectLoadSave> loadSaveFactory, Func <SaveProjectDialog> saveProjectDialogFactory, Func <LoadProjectDialog> loadProjectDialogFactory, Func <DialogHostBase> dialogHostFactory) { _directoryService = directoryServiceFactory(); _loadSave = loadSaveFactory(); _saveProjectDialog = saveProjectDialogFactory(); _loadProjectDialog = loadProjectDialogFactory(); _dialogHost = dialogHostFactory(); // TODO: Get rid of all three of these lines. ProjectsSaveDirectoryPath = _directoryService.GetCurrentDirectory() + "\\" + "Projects"; TemplatesSaveDirectoryPath = _directoryService.GetCurrentDirectory() + "\\" + "Templates"; DirectoryToService = ProjectsSaveDirectoryPath; // Default to the project directory. Probably want to remove this. }