private void OpenWorkflow() { OpenFileDialog fileDialog = WorkflowFileDialogFactory.CreateOpenFileDialog(); if (fileDialog.ShowDialog() == true) { WorkflowViewModel workspaceViewModel = new WorkflowViewModel(this.disableDebugViewOutput); workspaceViewModel.FullFilePath = fileDialog.FileName; WorkflowDocumentContent content = new WorkflowDocumentContent(workspaceViewModel); ModelService modelService = workspaceViewModel.Designer.Context.Services.GetService <ModelService>(); if (modelService != null) { List <Type> referencedActivities = this.GetReferencedActivities(modelService); this.AddActivitiesToToolbox(referencedActivities); } content.Title = workspaceViewModel.DisplayNameWithModifiedIndicator; content.Show(this.dockingManager); this.dockingManager.ActiveDocument = content; content.Closing += new EventHandler <CancelEventArgs>(workspaceViewModel.Closing); } this.ViewPropertyInspector(); if (this.HasValidationErrors) { this.ViewErrors(); this.SetSelectedTab(ContentTypes.Errors); } }
private void AddReference() { OpenFileDialog fileDialog = WorkflowFileDialogFactory.CreateAddReferenceDialog(); if (fileDialog.ShowDialog() == true) { this.AddActivitiesFromAssemblies(fileDialog.FileNames); } }
public void SaveAsWorkflow() { SaveFileDialog fileDialog = WorkflowFileDialogFactory.CreateSaveFileDialog(this.DisplayName); if (fileDialog.ShowDialog() == true) { this.SaveWorkflow(fileDialog.FileName); } }
public bool SaveWorkflow() { if (!string.IsNullOrEmpty(this.FullFilePath)) { this.SaveWorkflow(this.FullFilePath); return(true); } else { SaveFileDialog fileDialog = WorkflowFileDialogFactory.CreateSaveFileDialog(this.DisplayName); if (fileDialog.ShowDialog() == true) { this.SaveWorkflow(fileDialog.FileName); return(true); } return(false); } }