private void HandleRegularCommand(StartPageListItem item) { var dvm = this.DynamoViewModel; switch (item.ContextData) { case ButtonNames.NewWorkspace: dvm.NewHomeWorkspaceCommand.Execute(null); break; case ButtonNames.OpenWorkspace: dvm.ShowOpenDialogAndOpenResultCommand.Execute(null); break; case ButtonNames.NewCustomNodeWorkspace: dvm.ShowNewFunctionDialogCommand.Execute(null); break; case ButtonNames.ShowGallery: dvm.ShowGalleryCommand.Execute(null); break; default: throw new ArgumentException( string.Format("Invalid command: {0}", item.ContextData)); } }
private void HandleFilePath(StartPageListItem item) { var path = item.ContextData; if (string.IsNullOrEmpty(path) || (File.Exists(path) == false)) { MessageBox.Show(string.Format(Resources.MessageFileNotFound, path)); return; } var dvm = this.DynamoViewModel; if (dvm.OpenCommand.CanExecute(path)) { dvm.OpenCommand.Execute(path); } }
internal void HandleListItemClicked(StartPageListItem clicked) { if (clicked != null) { switch (clicked.ClickAction) { case StartPageListItem.Action.RegularCommand: HandleRegularCommand(clicked); break; case StartPageListItem.Action.FilePath: HandleFilePath(clicked); break; case StartPageListItem.Action.ExternalUrl: HandleExternalUrl(clicked); break; } } }
private void HandleExternalUrl(StartPageListItem item) { System.Diagnostics.Process.Start(item.ContextData); }
private void HandleFilePath(StartPageListItem item) { var path = item.ContextData; this.DynamoViewModel.OpenCommand.Execute(path); }
private void HandleExternalUrl(StartPageListItem item) { System.Diagnostics.Process.Start(item.ContextData); }
private void HandleFilePath(StartPageListItem item) { var path = item.ContextData; if (string.IsNullOrEmpty(path) || (File.Exists(path) == false)) { MessageBox.Show(string.Format("File not found: {0}", path)); return; } var dvm = this.DynamoViewModel; if (dvm.OpenCommand.CanExecute(path)) dvm.OpenCommand.Execute(path); }
private void HandleRegularCommand(StartPageListItem item) { var dvm = this.DynamoViewModel; switch (item.ContextData) { case ButtonNames.NewWorkspace: dvm.NewHomeWorkspaceCommand.Execute(null); break; case ButtonNames.OpenWorkspace: dvm.ShowOpenDialogAndOpenResultCommand.Execute(null); break; default: throw new ArgumentException( string.Format("Invalid command: {0}", item.ContextData)); } }
internal void HandleListItemClicked(StartPageListItem clicked) { if (clicked != null) { switch (clicked.ClickAction) { case StartPageListItem.Action.RegularCommand: HandleRegularCommand(clicked); break; case StartPageListItem.Action.FilePath: HandleFilePath(clicked); break; case StartPageListItem.Action.ExternalUrl: HandleExternalUrl(clicked); break; } } }
private void HandleFilePath(StartPageListItem item) { var path = item.ContextData; this.DynamoViewModel.OpenCommand.Execute(path); }