C# Class Dynamo.Models.DynamoModel

The Dynamo model.
Inheritance: Dynamo.Models.ModelBase
Afficher le fichier Open project: DynamoDS/Dynamo Class Usage Examples

Méthodes publiques

Свойство Type Description
Context string
CustomNodeManager Dynamo.Utilities.CustomNodeManager
DebugSettings DebugSettings
LibraryServices LibraryServices
Loader NodeModelAssemblyLoader
Logger DynamoLogger
MigrationManager Dynamo.Models.MigrationManager
NodeFactory NodeFactory
PreferenceSettings PreferenceSettings
SearchModel NodeSearchModel

Private Properties

Свойство Type Description
AddNodeToCurrentWorkspace void
AddNodeTypeToSearch void
AddToGroup void
AddZeroTouchNodeToSearch void
AddZeroTouchNodeToSearch void
AddZeroTouchNodesToSearch void
CanDumpLibraryToXml bool
CreateOrLoadPreferences IPreferences
DeleteModelInternal void
DisplayEngineFailureMessage Dynamo.Models.TaskDialogEventArgs
DisplayFutureFileMessage bool
DisplayObsoleteFileMessage void
DumpLibrarySnapshot void
DumpLibraryToXml void
EngineController_TraceReconcliationComplete void
HideUnhideNamespace void
InitializeCustomNodeManager void
InitializeIncludedNodes void
InitializeInstrumentationLogger void
InitializeNodeLibrary void
InitializePreferences void
LibraryLoaded void
LoadExtensions IEnumerable
LoadNodeLibrary void
LogMessage void
LogWarningMessage void
MarkAllDependenciesAsModified void
OnAsyncTaskStateChanged void
OnRequestPresetNamePrompt void
OnRequestsFunctionNamePrompt void
OnShutdownCompleted void
OnShutdownStarted void
OnWorkspaceOpening void
OnWorkspacePropertyChanged void
OnWorkspaceSaved void
OpenFile bool
OpenHomeWorkspace bool
PostUIActivation void
PreferenceSettings_PropertyChanged void
RegisterCustomNodeDefinitionWithEngine void
RegisterHomeWorkspace void
RemoveExtension void
StartBackupFilesTimer void
UngroupModel void
UpdateCustomNodeDefinition void
UpdateManager_Log void

Méthodes publiques

Méthode Description
AddCustomNodeWorkspace ( Dynamo.Models.CustomNodeWorkspaceModel workspace ) : void

Add a new, visible Custom Node workspace to Dynamo

AddHomeWorkspace ( ) : void

Add a new HomeWorkspace and set as current

AddToSelection ( object parameters ) : void

Add an ISelectable object to the selection.

AddWorkspace ( Dynamo.Models.WorkspaceModel workspace ) : void

Adds a workspace to the dynamo model.

ClearCurrentWorkspace ( ) : void

Clear the workspace. Removes all nodes, notes, and connectors from the current workspace.

Copy ( ) : void

Copy selected ISelectable objects to the clipboard.

Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

ForceRun ( ) : void

Forces an evaluation of the current workspace by resetting the DesignScript VM.

OpenCustomNodeWorkspace ( System.Guid guid ) : bool

Opens an existing custom node workspace.

OpenFileFromPath ( string xmlPath, bool forceManualExecutionMode = false ) : void

Opens a Dynamo workspace from a path to an Xml file on disk.

Paste ( ) : void

Paste ISelectable objects from the clipboard to the workspace so that the nodes appear in their original location with a slight offset

Paste ( Dynamo.Utilities.Point2D targetPoint, bool useOffset = true ) : void

Paste ISelectable objects from the clipboard to the workspace at specified point.

PostTraceReconciliation ( Dictionary orphanedSerializables ) : void

Deals with orphaned serializables.

RemoveWorkspace ( Dynamo.Models.WorkspaceModel workspace ) : void

Remove a workspace from the dynamo model.

ResetEngine ( bool markNodesAsDirty = false ) : void

Call this method to reset the virtual machine, avoiding a race condition by using a thread join inside the vm executive.

ShutDown ( bool shutdownHost ) : void

External components call this method to shutdown DynamoModel. This method marks 'ShutdownRequested' property to 'true'. This method is used rather than a public virtual method to ensure that the value of ShutdownRequested is set to true.

Start ( ) : DynamoModel

Start DynamoModel with all default configuration options

Start ( IStartConfiguration configuration ) : DynamoModel

Start DynamoModel with custom configuration. Defaults will be assigned not provided.

Méthodes protégées

Méthode Description
DynamoModel ( IStartConfiguration config ) : Dynamo.Configuration

Default constructor for DynamoModel

PostShutdownCore ( bool shutdownHost ) : void
PreShutdownCore ( bool shutdownHost ) : void
ResetEngineInternal ( ) : void
SaveBackupFiles ( object state ) : void

Backup all the files

ShutDownCore ( bool shutdownHost ) : void

Private Methods

Méthode Description
AddNodeToCurrentWorkspace ( Dynamo.Models.NodeModel node, bool centered, bool addToSelection = true ) : void

Adds a node to the current workspace.

AddNodeTypeToSearch ( Dynamo.Models.TypeLoadData typeLoadData ) : void
AddToGroup ( List modelsToAdd ) : void
AddZeroTouchNodeToSearch ( Dynamo.DSEngine.FunctionDescriptor functionDescriptor ) : void
AddZeroTouchNodeToSearch ( Dynamo.Engine.FunctionGroup funcGroup ) : void
AddZeroTouchNodesToSearch ( IEnumerable functionGroups ) : void
CanDumpLibraryToXml ( object obj ) : bool
CreateOrLoadPreferences ( IPreferences preferences ) : IPreferences
DeleteModelInternal ( List modelsToDelete ) : void
DisplayEngineFailureMessage ( Exception exception ) : Dynamo.Models.TaskDialogEventArgs

Call this method to display an error message in an event when live runner throws an exception that is not handled anywhere else. This message instructs user to save their work and restart Dynamo.

DisplayFutureFileMessage ( string fullFilePath, System.Version fileVersion, System.Version currVersion ) : bool

Displays file open error dialog if the file is of a future version than the currently installed version

DisplayObsoleteFileMessage ( string fullFilePath, System.Version fileVersion, System.Version currVersion ) : void

Call this method to display a message box when a file of an older version cannot be opened by the current version of Dynamo.

DumpLibrarySnapshot ( IEnumerable functionGroups ) : void
DumpLibraryToXml ( object parameter ) : void
EngineController_TraceReconcliationComplete ( Dynamo.DSEngine.TraceReconciliationEventArgs obj ) : void
HideUnhideNamespace ( bool hide, string library, string namespc ) : void

This method updates the node search library to either hide or unhide nodes that belong to a specified assembly name and namespace. These nodes will be hidden from the node library sidebar and from the node search.

InitializeCustomNodeManager ( ) : void
InitializeIncludedNodes ( ) : void
InitializeInstrumentationLogger ( ) : void
InitializeNodeLibrary ( IPreferences preferences ) : void
InitializePreferences ( IPreferences preferences ) : void
LibraryLoaded ( object sender, LibraryServices e ) : void

LibraryLoaded event handler.

LoadExtensions ( ) : IEnumerable
LoadNodeLibrary ( Assembly assem ) : void
LogMessage ( ILogMessage obj ) : void
LogWarningMessage ( LogWarningMessageEventArgs args ) : void

This warning message is displayed on the node associated with the FFI dll

MarkAllDependenciesAsModified ( CustomNodeDefinition def ) : void

Returns all function instances directly or indirectly depends on the specified function definition and mark them as modified so that their values will be re-queried.

OnAsyncTaskStateChanged ( DynamoScheduler sender, TaskStateChangedEventArgs e ) : void

This event handler is invoked when DynamoScheduler changes the state of an AsyncTask object. See TaskStateChangedEventArgs.State for more details of these state changes.

OnRequestPresetNamePrompt ( Dynamo.Models.PresetsNamePromptEventArgs e ) : void
OnRequestsFunctionNamePrompt ( Object sender, Dynamo.Models.FunctionNamePromptEventArgs e ) : void
OnShutdownCompleted ( ) : void
OnShutdownStarted ( ) : void
OnWorkspaceOpening ( XmlDocument obj ) : void
OnWorkspacePropertyChanged ( object sender, PropertyChangedEventArgs args ) : void
OnWorkspaceSaved ( Dynamo.Models.WorkspaceModel model ) : void
OpenFile ( Dynamo.Models.WorkspaceInfo workspaceInfo, XmlDocument xmlDoc, Dynamo.Models.WorkspaceModel &workspace ) : bool
OpenHomeWorkspace ( XmlDocument xmlDoc, Dynamo.Models.WorkspaceInfo workspaceInfo, Dynamo.Models.WorkspaceModel &workspace ) : bool
PostUIActivation ( object parameter ) : void
PreferenceSettings_PropertyChanged ( object sender, PropertyChangedEventArgs e ) : void

Responds to property update notifications on the preferences, and synchronizes with the Units Manager.

RegisterCustomNodeDefinitionWithEngine ( CustomNodeDefinition definition ) : void

Registers (or re-registers) a Custom Node definition with the DesignScript VM, so that instances of the custom node can be evaluated.

RegisterHomeWorkspace ( Dynamo.Models.HomeWorkspaceModel newWorkspace ) : void
RemoveExtension ( IExtension ext ) : void
StartBackupFilesTimer ( ) : void

Start the timer to backup files periodically

UngroupModel ( List modelsToUngroup ) : void
UpdateCustomNodeDefinition ( CustomNodeDefinition definition ) : void

Register custom node defintion and execute all custom node instances.

UpdateManager_Log ( LogEventArgs args ) : void

Method Details

AddCustomNodeWorkspace() public méthode

Add a new, visible Custom Node workspace to Dynamo
public AddCustomNodeWorkspace ( Dynamo.Models.CustomNodeWorkspaceModel workspace ) : void
workspace Dynamo.Models.CustomNodeWorkspaceModel to add
Résultat void

AddHomeWorkspace() public méthode

Add a new HomeWorkspace and set as current
public AddHomeWorkspace ( ) : void
Résultat void

AddToSelection() public méthode

Add an ISelectable object to the selection.
public AddToSelection ( object parameters ) : void
parameters object The object to add to the selection.
Résultat void

AddWorkspace() public méthode

Adds a workspace to the dynamo model.
public AddWorkspace ( Dynamo.Models.WorkspaceModel workspace ) : void
workspace Dynamo.Models.WorkspaceModel
Résultat void

ClearCurrentWorkspace() public méthode

Clear the workspace. Removes all nodes, notes, and connectors from the current workspace.
public ClearCurrentWorkspace ( ) : void
Résultat void

Copy() public méthode

Copy selected ISelectable objects to the clipboard.
public Copy ( ) : void
Résultat void

Dispose() public méthode

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
Résultat void

DynamoModel() protected méthode

Default constructor for DynamoModel
protected DynamoModel ( IStartConfiguration config ) : Dynamo.Configuration
config IStartConfiguration Start configuration
Résultat Dynamo.Configuration

ForceRun() public méthode

Forces an evaluation of the current workspace by resetting the DesignScript VM.
public ForceRun ( ) : void
Résultat void

OpenCustomNodeWorkspace() public méthode

Opens an existing custom node workspace.
public OpenCustomNodeWorkspace ( System.Guid guid ) : bool
guid System.Guid Identifier of the workspace to open
Résultat bool

OpenFileFromPath() public méthode

Opens a Dynamo workspace from a path to an Xml file on disk.
public OpenFileFromPath ( string xmlPath, bool forceManualExecutionMode = false ) : void
xmlPath string Path to file
forceManualExecutionMode bool Set this to true to discard /// execution mode specified in the file and set manual mode
Résultat void

Paste() public méthode

Paste ISelectable objects from the clipboard to the workspace so that the nodes appear in their original location with a slight offset
public Paste ( ) : void
Résultat void

Paste() public méthode

Paste ISelectable objects from the clipboard to the workspace at specified point.
public Paste ( Dynamo.Utilities.Point2D targetPoint, bool useOffset = true ) : void
targetPoint Dynamo.Utilities.Point2D Location where data will be pasted
useOffset bool Indicates whether we will use current workspace offset or paste nodes /// directly in this point.
Résultat void

PostShutdownCore() protected méthode

protected PostShutdownCore ( bool shutdownHost ) : void
shutdownHost bool
Résultat void

PostTraceReconciliation() public méthode

Deals with orphaned serializables.
public PostTraceReconciliation ( Dictionary orphanedSerializables ) : void
orphanedSerializables Dictionary Collection of orphaned serializables.
Résultat void

PreShutdownCore() protected méthode

protected PreShutdownCore ( bool shutdownHost ) : void
shutdownHost bool
Résultat void

RemoveWorkspace() public méthode

Remove a workspace from the dynamo model.
public RemoveWorkspace ( Dynamo.Models.WorkspaceModel workspace ) : void
workspace Dynamo.Models.WorkspaceModel Workspace to remove
Résultat void

ResetEngine() public méthode

Call this method to reset the virtual machine, avoiding a race condition by using a thread join inside the vm executive.
public ResetEngine ( bool markNodesAsDirty = false ) : void
markNodesAsDirty bool Set this parameter to true to force /// reset of the execution substrait. Note that setting this parameter /// to true will have a negative performance impact.
Résultat void

ResetEngineInternal() protected méthode

protected ResetEngineInternal ( ) : void
Résultat void

SaveBackupFiles() protected méthode

Backup all the files
protected SaveBackupFiles ( object state ) : void
state object
Résultat void

ShutDown() public méthode

External components call this method to shutdown DynamoModel. This method marks 'ShutdownRequested' property to 'true'. This method is used rather than a public virtual method to ensure that the value of ShutdownRequested is set to true.
public ShutDown ( bool shutdownHost ) : void
shutdownHost bool Set this parameter to true to shutdown /// the host application.
Résultat void

ShutDownCore() protected méthode

protected ShutDownCore ( bool shutdownHost ) : void
shutdownHost bool
Résultat void

Start() public static méthode

Start DynamoModel with all default configuration options
public static Start ( ) : DynamoModel
Résultat DynamoModel

Start() public static méthode

Start DynamoModel with custom configuration. Defaults will be assigned not provided.
public static Start ( IStartConfiguration configuration ) : DynamoModel
configuration IStartConfiguration Start configuration
Résultat DynamoModel

Property Details

Context public_oe property

The context that Dynamo is running under.
public string Context
Résultat string

CustomNodeManager public_oe property

Custom Node Manager instance, manages all loaded custom nodes.
public CustomNodeManager,Dynamo.Utilities CustomNodeManager
Résultat Dynamo.Utilities.CustomNodeManager

DebugSettings public_oe property

Debugging settings for this instance of Dynamo.
public DebugSettings DebugSettings
Résultat DebugSettings

LibraryServices public_oe property

Manages all loaded ZeroTouch libraries.
public LibraryServices LibraryServices
Résultat LibraryServices

Loader public_oe property

Manages all loaded NodeModel libraries.
public NodeModelAssemblyLoader Loader
Résultat NodeModelAssemblyLoader

Logger public_oe property

The Dynamo Logger, receives and manages all log messages.
public DynamoLogger Logger
Résultat DynamoLogger

MigrationManager public_oe property

Migration Manager, upgrades old Dynamo file formats to the current version.
public MigrationManager,Dynamo.Models MigrationManager
Résultat Dynamo.Models.MigrationManager

NodeFactory public_oe property

Node Factory, used for creating and intantiating loaded Dynamo nodes.
public NodeFactory NodeFactory
Résultat NodeFactory

PreferenceSettings public_oe property

Preference settings for this instance of Dynamo.
public PreferenceSettings PreferenceSettings
Résultat PreferenceSettings

SearchModel public_oe property

The Dynamo Node Library, complete with Search.
public NodeSearchModel SearchModel
Résultat NodeSearchModel