/// <summary> /// This is the function to load an project file /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void LoadProject_Click(object sender, EventArgs e) { LoadProjectDialog.ShowDialog(); manager.Add(LoadProjectDialog.FileName); manager.Save(); LoadProjects(); }
/// <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. }
public FilesFolderPouch(MenuBuilder menuBuilder, IFileSystemTraverser fileSystemTraverser, LoadProjectDialog loadProject) { _fileSystemTraverser = fileSystemTraverser; _loadProject = loadProject; var menuItems = menuBuilder.Build(MenuLocation.FilesFolders); // can be null when no plugins are loaded. if (menuItems != null) { _contextMenu = new ContextMenu(menuItems); } // layout that's displayed when the actionbar's "Minimize" button is clicked. _minLayout = CreateMinimizeLayout(); // reference to the layout that is always visible _visibleLayout = new Panel(); }