private Project(AppView app, ProjectDOM.Project doc, PathString documentPath) { _Application = app; _Source = doc; _SourceBody = doc.GetBody(false); _SourceFilePath = documentPath; _Configurations = new Configurations(doc); _ActiveConfiguration = _Configurations.RootConfiguration; SaveCmd = new RelayCommand(Save); AddTaskCmd = new RelayCommand(_AddNewTask); EditPluginsCmd = new RelayCommand(_EditPlugin); EditConfigurationsCmd = new RelayCommand(_EditConfigurations); DeleteActiveDocumentCmd = new RelayCommand <BindableBase>(_DeleteTask); CopyTaskToClipboardCmd = new RelayCommand <BindableBase>(_CopyTaskToClipboard); PasteTaskFromClipboardCmd = new RelayCommand(_PasteTaskFromClipboard); BuildAllCmd = new RelayCommand(Build); TestAllCmd = new RelayCommand(Test); ShowSourceDirectoryCmd = new RelayCommand(() => new PathString(this.SourceDirectory).TryOpenContainingFolder()); ShowTargetDirectoryCmd = new RelayCommand(() => new PathString(this.TargetDirectory).TryOpenContainingFolder()); }
public PluginsCollectionView(AppView app, Func <string, bool> check, Action <string, string> insertAssembly, Action <string> remove) { _Application = app; _CheckAction = check; _InsertAssemblyAction = insertAssembly; _RemoveAction = remove; DiscoverCmd = new RelayCommand(DiscoverPlugins); AddPluginCmd = new RelayCommand(BrowsePlugin); }
public static Project Create(AppView app, ProjectDOM.Project doc, PathString docPath) { if (doc == null || docPath == null) { return(null); } var ppp = new Project(app, doc, docPath); ppp._ReloadPlugins(); return(ppp); }
public static Project TryCreateFromCommandLine(AppView app) { var docPath = _AppConstants.StartupOpenDocumentPath; if (!docPath.HasValue) { return(null); } var prj = ProjectDOM.LoadProjectFrom(docPath.Value); var prjv = Project.Create(app, prj, docPath.Value); // var outDir = args.FirstOrDefault(item => item.StartsWith("-OutDir:")); // if (outDir != null) outDir = outDir.Substring(8).Trim('"'); // prjv.TargetDirectory = outDir; return(prjv); }
public static Project CreateNew(AppView app) { if (app == null) { return(null); } var dlg = new Microsoft.Win32.SaveFileDialog() { RestoreDirectory = true, Filter = "Über Project File|*.uberfactory" }; if (!dlg.ShowDialog().Value) { return(null); } return(Project.CreateNew(app, new PathString(dlg.FileName))); }
public static Project CreateNew(AppView app, PathString docPath) { if (docPath == null) { return(null); } if (!System.IO.Path.IsPathRooted(docPath)) { return(null); } var doc = ProjectDOM.CreateNewProject(); var ppp = new Project(app, doc, docPath); ppp._ReloadPlugins(); return(ppp); }
public static Project OpenFile(AppView app, PathString filePath) { if (app == null) { return(null); } if (!filePath.FileExists) { return(null); } try { var prj = ProjectDOM.LoadProjectFrom(filePath); return(Project.Create(app, prj, filePath)); } catch (Exception ex) { System.Windows.MessageBox.Show(ex.Message, "Error", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Error); return(null); } }
public static void ShowPluginsManagerDialog(AppView app, Func <string, bool> check, Action <string, string> insert, Action <string> remove) { _Dialogs.ShowGenericDialog <Themes.PluginsPanel>(null, "Plugins Manager", new PluginsCollectionView(app, check, insert, remove)); }
public static void ShowPluginsManagerDialog(AppView app) { _Dialogs.ShowGenericDialog <Themes.PluginsPanel>(null, "Plugins Manager", new PluginsCollectionView(app, null, null, null)); }
public HomeView(AppView parent) { _Application = parent; ShowPluginsManagerCmd = new RelayCommand(() => _Dialogs.ShowPluginsManagerDialog(_Application)); }