C# Class Dynamo.ViewModels.DynamoViewModel

Inheritance: Dynamo.ViewModels.ViewModelBase, IWatchViewModel
显示文件 Open project: DynamoDS/Dynamo Class Usage Examples

Private Properties

Property Type Description
AddAnnotation void
AddModelsToGroup void
AddToRecentFiles void
AskUserToSaveWorkspacesOrCancel bool
CanAddAnnotation bool
CanAddModelsToGroup bool
CanAddNote bool
CanAddToSelection bool
CanAlignSelected bool
CanClear bool
CanClearLog bool
CanCloseHomeWorkspace bool
CanCopy bool
CanCreateNodeFromSelection bool
CanDelete bool
CanDisplayFunction bool
CanDisplayStartPage bool
CanDoGraphAutoLayout bool
CanEscape bool
CanExit bool
CanExportToSTL bool
CanFitView bool
CanGoHomeView bool
CanGoToSourceCode bool
CanGoToWiki bool
CanGoToWorkspace bool
CanImportLibrary bool
CanMakeNewHomeWorkspace bool
CanOpen bool
CanOpenRecent bool
CanPan bool
CanPaste bool
CanRedo bool
CanReportABug bool
CanSave bool
CanSaveAs bool
CanSaveImage bool
CanSelectAll bool
CanSelectNeighbors bool
CanSetConnectorType bool
CanSetNumberFormat bool
CanShowAboutWindow bool
CanShowConnectors bool
CanShowInfoBubble bool
CanShowInstalledPackages bool
CanShowNewFunctionDialogCommand bool
CanShowNewPresetStateDialog bool
CanShowOpenDialogAndOpenResultCommand bool
CanShowPackageManagerSearch bool
CanShowSaveDialogAndSaveResult bool
CanShowSaveDialogIfNeededAndSaveResultCommand bool
CanShowSaveImageDialogAndSaveResult bool
CanToggleBackgroundGridVisibility bool
CanToggleConsoleShowing bool
CanToggleFullscreenWatchShowing bool
CanUndo bool
CanUngroupAnnotation bool
CanUngroupModel bool
CanUpstreamVisibilityBeToggled bool
CanVisibilityBeToggled bool
CanWriteToLog bool
CanZoomIn bool
CanZoomOut bool
CancelActiveState void
CleanUp void
ClearHomeWorkspaceInternal bool
CloseHomeWorkspace void
CollectInfoManager_PropertyChanged void
CreateNodeFromSelection void
Delete void
DisplayStartPage void
DownloadDynamo void
ExportToSTL void
FitView void
FocusCustomNodeWorkspace void
ForceRunExprCmd void
GetInputNodesFromSelectionForPresets IEnumerable
InitializeAutomationSettings void
InitializeRecentFiles void
Instance_PropertyChanged void
Instance_UpdateDownloaded void
ManagePackagePaths void
ModelWorkspaceCleared void
ModelWorkspaceSaved void
MutateTestCmd void
OnNodeViewReady void
Open void
OpenIfSaved void
OpenRecent void
Pan void
Paste void
RaiseCanExecuteUndoRedo void
Redo void
RenderPackageFactoryViewModel_PropertyChanged void
Save void
Save3DImage void
SaveAs void
SaveAs void
SelectionOnCollectionChanged void
SetNumberFormat void
ShowAboutWindow void
ShowElement void
ShowInstalledPackages void
ShowNewFunctionDialogAndMakeFunction void
ShowNewPresetStateDialogAndMakePreset void
ShowOpenDialogAndOpenResult void
ShowPackageManagerSearch void
ShowSaveDialogIfNeededAndSave bool
SubscribeDispatcherHandlers void
SubscribeLoggerHandlers void
SubscribeModelChangedHandlers void
SubscribeModelCleaningUpEvent void
SubscribeModelUiEvents void
SubscribeUpdateManagerHandlers void
TogglePreviewBubblesShowing void
TryDispatcherBeginInvoke void
TryDispatcherInvoke void
Undo void
UngroupAnnotation void
UngroupModel void
UnsubscribeDispatcherEvents void
UnsubscribeLoggerEvents void
UnsubscribeModelChangedEvents void
UnsubscribeModelCleaningUpEvent void
UnsubscribeModelUiEvents void
UnsubscribeUpdateManagerEvents void
UpdateManager_ShutdownRequested void
Watch3DViewModelPropertyChanged void
WorkspaceAdded void
WorkspaceRemoved void
ZoomIn void
ZoomOut void
_model_PropertyChanged void

Public Methods

Method Description
AddNote ( object parameters ) : void

After command framework is implemented, this method should now be only called from a menu item (i.e. Ctrl + W). It should not be used as a way for any other code paths to create a note programmatically. For that we now have AddNoteInternal which takes in more configurable arguments.

AlignSelected ( object param ) : void
AskUserToSaveWorkspaceOrCancel ( Dynamo.Models.WorkspaceModel workspace, bool allowCancel = true ) : bool

Requests a message box asking the user to save the workspace and allows saving.

CanGoHome ( object _ ) : bool
ClearLog ( object parameter ) : void

Clear the UI log.

DisplayFunction ( object parameters ) : void
DoGraphAutoLayout ( object parameter ) : void
Escape ( object parameter ) : void
Exit ( object allowCancel ) : void
GetSaveDialog ( Dynamo.Models.WorkspaceModel workspace ) : FileDialog

Returns the file-save dialog with customized file types of Dynamo.

GoHome ( object _ ) : void
GoHomeView ( object parameter ) : void

Resets the offset and the zoom for a view

GoToSourceCode ( object parameter ) : void
GoToWiki ( object parameter ) : void
GoToWorkspace ( object parameter ) : void
ImportLibrary ( object parameter ) : void
MakeNewHomeWorkspace ( object parameter ) : void
PerformShutdownSequence ( ShutdownParams shutdownParams ) : bool

Call this method to initiate DynamoModel shutdown sequence. See the definition of ShutdownParams structure for more details.

ReportABug ( ) : void
ReportABug ( object parameter ) : void
SaveImage ( object parameters ) : void
SelectAll ( object parameter ) : void
SelectNeighbors ( object parameters ) : void
SetConnectorType ( object parameters ) : void
ShowConnectors ( object parameter ) : void
ShowSaveDialogAndSaveResult ( object parameter ) : void
ShowSaveDialogIfNeededAndSaveResult ( object parameter ) : void
ShowSaveImageDialogAndSaveResult ( object parameter ) : void
Start ( StartConfiguration startConfiguration = newStartConfiguration() ) : DynamoViewModel
ToggleBackgroundGridVisibility ( object parameter ) : void
ToggleConsoleShowing ( object parameter ) : void
ToggleFullscreenWatchShowing ( object parameter ) : void
WorkspaceActualSize ( double width, double height ) : void

Protected Methods

Method Description
DynamoViewModel ( StartConfiguration startConfiguration ) : Dynamo.Configuration
RegisterWatch3DViewModel ( DefaultWatch3DViewModel watch3DViewModel, IRenderPackageFactory factory ) : void

Sets up the provided DefaultWatch3DViewModel object and adds it to the Watch3DViewModels collection.

UnsubscribeAllEvents ( ) : void

Private Methods

Method Description
AddAnnotation ( object parameters ) : void
AddModelsToGroup ( object parameters ) : void
AddToRecentFiles ( string path ) : void
AskUserToSaveWorkspacesOrCancel ( bool allowCancel = true ) : bool

Ask the user if they want to save any unsaved changes.

CanAddAnnotation ( object parameter ) : bool
CanAddModelsToGroup ( object obj ) : bool
CanAddNote ( object parameters ) : bool
CanAddToSelection ( object parameters ) : bool
CanAlignSelected ( object param ) : bool
CanClear ( object parameter ) : bool
CanClearLog ( object parameter ) : bool
CanCloseHomeWorkspace ( object parameter ) : bool
CanCopy ( object parameters ) : bool
CanCreateNodeFromSelection ( object parameter ) : bool
CanDelete ( object parameters ) : bool
CanDisplayFunction ( object parameters ) : bool
CanDisplayStartPage ( object parameter ) : bool
CanDoGraphAutoLayout ( object parameter ) : bool
CanEscape ( object parameter ) : bool
CanExit ( object allowCancel ) : bool
CanExportToSTL ( object parameter ) : bool
CanFitView ( object parameter ) : bool
CanGoHomeView ( object parameter ) : bool
CanGoToSourceCode ( object parameter ) : bool
CanGoToWiki ( object parameter ) : bool
CanGoToWorkspace ( object parameter ) : bool
CanImportLibrary ( object parameter ) : bool
CanMakeNewHomeWorkspace ( object parameter ) : bool
CanOpen ( object parameters ) : bool
CanOpenRecent ( object path ) : bool
CanPan ( object parameter ) : bool
CanPaste ( object parameters ) : bool
CanRedo ( object parameter ) : bool
CanReportABug ( object parameter ) : bool
CanSave ( object parameter ) : bool
CanSaveAs ( object parameters ) : bool
CanSaveImage ( object parameters ) : bool
CanSelectAll ( object parameter ) : bool
CanSelectNeighbors ( object parameters ) : bool
CanSetConnectorType ( object parameters ) : bool
CanSetNumberFormat ( object parameter ) : bool
CanShowAboutWindow ( object obj ) : bool
CanShowConnectors ( object parameter ) : bool
CanShowInfoBubble ( object parameter ) : bool
CanShowInstalledPackages ( object parameters ) : bool
CanShowNewFunctionDialogCommand ( object parameter ) : bool
CanShowNewPresetStateDialog ( object parameter ) : bool
CanShowOpenDialogAndOpenResultCommand ( object parameter ) : bool
CanShowPackageManagerSearch ( object parameters ) : bool
CanShowSaveDialogAndSaveResult ( object parameter ) : bool
CanShowSaveDialogIfNeededAndSaveResultCommand ( object parameter ) : bool
CanShowSaveImageDialogAndSaveResult ( object parameter ) : bool
CanToggleBackgroundGridVisibility ( object parameter ) : bool
CanToggleConsoleShowing ( object parameter ) : bool
CanToggleFullscreenWatchShowing ( object parameter ) : bool
CanUndo ( object parameter ) : bool
CanUngroupAnnotation ( object parameter ) : bool
CanUngroupModel ( object parameter ) : bool
CanUpstreamVisibilityBeToggled ( object parameters ) : bool
CanVisibilityBeToggled ( object parameters ) : bool
CanWriteToLog ( object parameters ) : bool
CanZoomIn ( object parameter ) : bool
CanZoomOut ( object parameter ) : bool
CancelActiveState ( Dynamo.Models.NodeModel node ) : void
CleanUp ( ) : void
ClearHomeWorkspaceInternal ( ) : bool

TODO(Ben): Both "CloseHomeWorkspace" and "MakeNewHomeWorkspace" are quite close in terms of functionality, but because their callers have different expectations in different scenarios, they remain separate now. A new task has been scheduled for them to be unified into one consistent way of handling. http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-3813

CloseHomeWorkspace ( object parameter ) : void
CollectInfoManager_PropertyChanged ( object sender, PropertyChangedEventArgs e ) : void
CreateNodeFromSelection ( object parameter ) : void
Delete ( object parameters ) : void
DisplayStartPage ( object parameter ) : void
DownloadDynamo ( ) : void
ExportToSTL ( object parameter ) : void
FitView ( object parameter ) : void
FocusCustomNodeWorkspace ( System.Guid symbol ) : void

Change the currently visible workspace to a custom node's workspace

ForceRunExprCmd ( object parameters ) : void
GetInputNodesFromSelectionForPresets ( ) : IEnumerable

Returns the selected nodes that are "input" nodes, and makes an exception for CodeBlockNodes and Filename nodes as these are marked false so they do not expose a IsInput checkbox

InitializeAutomationSettings ( string commandFilePath ) : void
InitializeRecentFiles ( ) : void
Instance_PropertyChanged ( object sender, PropertyChangedEventArgs e ) : void
Instance_UpdateDownloaded ( object sender, Dynamo.UpdateManager.UpdateDownloadedEventArgs e ) : void
ManagePackagePaths ( object parameters ) : void
ModelWorkspaceCleared ( Dynamo.Models.WorkspaceModel workspace ) : void
ModelWorkspaceSaved ( Dynamo.Models.WorkspaceModel model ) : void
MutateTestCmd ( object parameters ) : void
OnNodeViewReady ( object nodeView ) : void
Open ( object parameters ) : void

Open a definition or workspace.

OpenIfSaved ( object openCommand ) : void

Attempts to open a file using the passed open command, but wraps the call with a check to make sure no unsaved changes to the HomeWorkspace are lost.

OpenRecent ( object path ) : void
Pan ( object parameter ) : void
Paste ( object parameter ) : void
RaiseCanExecuteUndoRedo ( ) : void
Redo ( object parameter ) : void
RenderPackageFactoryViewModel_PropertyChanged ( object sender, PropertyChangedEventArgs e ) : void
Save ( object parameter ) : void

Attempts to save an the current workspace. Assumes that workspace has already been saved.

Save3DImage ( object parameters ) : void
SaveAs ( object parameters ) : void

Save the current workspace.

SaveAs ( string path ) : void

Save the current workspace to a specific file path, if the path is null or empty, does nothing. If successful, the CurrentWorkspace.FileName field is updated as a side effect.

SelectionOnCollectionChanged ( object sender, NotifyCollectionChangedEventArgs notifyCollectionChangedEventArgs ) : void
SetNumberFormat ( object parameter ) : void
ShowAboutWindow ( object obj ) : void
ShowElement ( NodeModel e ) : void
ShowInstalledPackages ( object parameters ) : void
ShowNewFunctionDialogAndMakeFunction ( object parameter ) : void

Present the new function dialogue and create a custom function.

ShowNewPresetStateDialogAndMakePreset ( object parameter ) : void

Present the new preset dialogue and add a new presetModel to the preset set on this graph

ShowOpenDialogAndOpenResult ( object parameter ) : void

Present the open dialog and open the workspace that is selected.

ShowPackageManagerSearch ( object parameters ) : void
ShowSaveDialogIfNeededAndSave ( WorkspaceModel workspace ) : bool

Attempts to save a given workspace. Shows a save as dialog if the workspace does not already have a path associated with it

SubscribeDispatcherHandlers ( ) : void
SubscribeLoggerHandlers ( ) : void
SubscribeModelChangedHandlers ( ) : void
SubscribeModelCleaningUpEvent ( ) : void
SubscribeModelUiEvents ( ) : void
SubscribeUpdateManagerHandlers ( ) : void
TogglePreviewBubblesShowing ( object parameter ) : void
TryDispatcherBeginInvoke ( Action action ) : void
TryDispatcherInvoke ( Action action ) : void
Undo ( object parameter ) : void
UngroupAnnotation ( object parameters ) : void
UngroupModel ( object parameters ) : void
UnsubscribeDispatcherEvents ( ) : void
UnsubscribeLoggerEvents ( ) : void
UnsubscribeModelChangedEvents ( ) : void
UnsubscribeModelCleaningUpEvent ( ) : void
UnsubscribeModelUiEvents ( ) : void
UnsubscribeUpdateManagerEvents ( ) : void
UpdateManager_ShutdownRequested ( IUpdateManager updateManager ) : void
Watch3DViewModelPropertyChanged ( object sender, PropertyChangedEventArgs e ) : void
WorkspaceAdded ( WorkspaceModel item ) : void
WorkspaceRemoved ( WorkspaceModel item ) : void
ZoomIn ( object parameter ) : void
ZoomOut ( object parameter ) : void
_model_PropertyChanged ( object sender, PropertyChangedEventArgs e ) : void

Method Details

AddNote() public method

After command framework is implemented, this method should now be only called from a menu item (i.e. Ctrl + W). It should not be used as a way for any other code paths to create a note programmatically. For that we now have AddNoteInternal which takes in more configurable arguments.
public AddNote ( object parameters ) : void
parameters object This is not used and should always be null, /// otherwise an ArgumentException will be thrown.
return void

AlignSelected() public method

public AlignSelected ( object param ) : void
param object
return void

AskUserToSaveWorkspaceOrCancel() public method

Requests a message box asking the user to save the workspace and allows saving.
public AskUserToSaveWorkspaceOrCancel ( Dynamo.Models.WorkspaceModel workspace, bool allowCancel = true ) : bool
workspace Dynamo.Models.WorkspaceModel The workspace for which to show the dialog
allowCancel bool
return bool

CanGoHome() public method

public CanGoHome ( object _ ) : bool
_ object
return bool

ClearLog() public method

Clear the UI log.
public ClearLog ( object parameter ) : void
parameter object
return void

DisplayFunction() public method

public DisplayFunction ( object parameters ) : void
parameters object
return void

DoGraphAutoLayout() public method

public DoGraphAutoLayout ( object parameter ) : void
parameter object
return void

DynamoViewModel() protected method

protected DynamoViewModel ( StartConfiguration startConfiguration ) : Dynamo.Configuration
startConfiguration StartConfiguration
return Dynamo.Configuration

Escape() public method

public Escape ( object parameter ) : void
parameter object
return void

Exit() public method

public Exit ( object allowCancel ) : void
allowCancel object
return void

GetSaveDialog() public method

Returns the file-save dialog with customized file types of Dynamo.
public GetSaveDialog ( Dynamo.Models.WorkspaceModel workspace ) : FileDialog
workspace Dynamo.Models.WorkspaceModel
return System.Windows.Forms.FileDialog

GoHome() public method

public GoHome ( object _ ) : void
_ object
return void

GoHomeView() public method

Resets the offset and the zoom for a view
public GoHomeView ( object parameter ) : void
parameter object
return void

GoToSourceCode() public method

public GoToSourceCode ( object parameter ) : void
parameter object
return void

GoToWiki() public method

public GoToWiki ( object parameter ) : void
parameter object
return void

GoToWorkspace() public method

public GoToWorkspace ( object parameter ) : void
parameter object
return void

ImportLibrary() public method

public ImportLibrary ( object parameter ) : void
parameter object
return void

MakeNewHomeWorkspace() public method

public MakeNewHomeWorkspace ( object parameter ) : void
parameter object
return void

PerformShutdownSequence() public method

Call this method to initiate DynamoModel shutdown sequence. See the definition of ShutdownParams structure for more details.
public PerformShutdownSequence ( ShutdownParams shutdownParams ) : bool
shutdownParams ShutdownParams A set of parameters that control the /// way in which shutdown sequence is to be performed. See ShutdownParams /// for more details.
return bool

RegisterWatch3DViewModel() protected method

Sets up the provided DefaultWatch3DViewModel object and adds it to the Watch3DViewModels collection.
protected RegisterWatch3DViewModel ( DefaultWatch3DViewModel watch3DViewModel, IRenderPackageFactory factory ) : void
watch3DViewModel DefaultWatch3DViewModel
factory IRenderPackageFactory
return void

ReportABug() public static method

public static ReportABug ( ) : void
return void

ReportABug() public static method

public static ReportABug ( object parameter ) : void
parameter object
return void

SaveImage() public method

public SaveImage ( object parameters ) : void
parameters object
return void

SelectAll() public method

public SelectAll ( object parameter ) : void
parameter object
return void

SelectNeighbors() public method

public SelectNeighbors ( object parameters ) : void
parameters object
return void

SetConnectorType() public method

public SetConnectorType ( object parameters ) : void
parameters object
return void

ShowConnectors() public method

public ShowConnectors ( object parameter ) : void
parameter object
return void

ShowSaveDialogAndSaveResult() public method

public ShowSaveDialogAndSaveResult ( object parameter ) : void
parameter object
return void

ShowSaveDialogIfNeededAndSaveResult() public method

public ShowSaveDialogIfNeededAndSaveResult ( object parameter ) : void
parameter object
return void

ShowSaveImageDialogAndSaveResult() public method

public ShowSaveImageDialogAndSaveResult ( object parameter ) : void
parameter object
return void

Start() public static method

public static Start ( StartConfiguration startConfiguration = newStartConfiguration() ) : DynamoViewModel
startConfiguration StartConfiguration
return DynamoViewModel

ToggleBackgroundGridVisibility() public method

public ToggleBackgroundGridVisibility ( object parameter ) : void
parameter object
return void

ToggleConsoleShowing() public method

public ToggleConsoleShowing ( object parameter ) : void
parameter object
return void

ToggleFullscreenWatchShowing() public method

public ToggleFullscreenWatchShowing ( object parameter ) : void
parameter object
return void

UnsubscribeAllEvents() protected method

protected UnsubscribeAllEvents ( ) : void
return void

WorkspaceActualSize() public method

public WorkspaceActualSize ( double width, double height ) : void
width double
height double
return void