public StartPageFile(ProjectFile file, IServiceProvider serviceProvider) : base(file, serviceProvider) { _editor = serviceProvider.Get <EditorViewModel>(); _serializer = serviceProvider.Get <ISerializer <string> >(); var cmdProvider = serviceProvider.Get <ICommandProvider>(); NewProjectCommand = _editor.NewProjectCommand; OpenProjectCommand = _editor.OpenProjectCommand; OpenRecentProjectCommand = cmdProvider.Create <string>(_editor.LoadProject); }
public FileEditor(ProjectFile file, IServiceProvider serviceProvider) : base(serviceProvider) { _editor = serviceProvider.Get <EditorViewModel>(); IsDirty = true; File = file; File.Editor = this; File.Renamed += OnFileRenamed; Name = File.Name; var cmdProvider = serviceProvider.Get <ICommandProvider>(); CloseCommand = cmdProvider.CreateAsync(Close); Actions.Add("Save", cmdProvider.Create(SaveContent)); Actions.Add("Save As", cmdProvider.Create(SaveAs)); Actions.Add("Close", CloseCommand); Actions.Add("Close All", cmdProvider.Create(CloseAll)); }
private Project(ProjectData project, string projectFolder, IServiceProvider serviceProvider) : base(serviceProvider) { _editor = ServiceProvider.Get <EditorViewModel>(); _errorReporter = ServiceProvider.Get <IOutputManager>(); Id = project.Id; DirectoryPath = projectFolder; Root = CreateRoot(project); var commandProvider = ServiceProvider.Get <ICommandProvider>(); AddExistingItemCommand = commandProvider.Create <ProjectDirectory>(AddExistingItem); AddFolderCommand = commandProvider.Create <ProjectDirectory>(AddFolder); AddImageGraphCommand = commandProvider.Create <ProjectDirectory>(AddImageGraph); AddTextGraphCommand = commandProvider.Create <ProjectDirectory>(AddTextGraph); AddFunctionGraphCommand = commandProvider.Create <ProjectDirectory>(AddFunctionGraph); AddTextFileCommand = commandProvider.Create <ProjectDirectory>(AddTextFile); CloseProjectCommand = commandProvider.CreateAsync <Project>(_editor.CloseProject); OpenFileCommand = commandProvider.Create <ProjectFile>(OpenFile); DeleteCommand = commandProvider.Create <ProjectEntry>(Delete); RenameCommand = commandProvider.Create <ProjectEntry>(Rename); }
public GraphProvider(Common.IServiceProvider provider) { _editor = provider.Get <EditorViewModel>(); _database = provider.Get <INodeDatabase>(); _output = provider.Get <IOutputManager>(); }