DynamoVisualProgramming.Core by Autodesk

<PackageReference Include="DynamoVisualProgramming.Core" Version="2.5.0-beta6104" />

.NET API 1,792,896 bytes

 WorkspaceModel

Represents base class for all kind of workspaces which contains general data such as Name, collections of nodes, notes, annotations, etc.
public sealed delegate PointEventHandler : MulticastDelegate

Function that can be used to respond to a "point event"

public sealed delegate WorkspaceSavedEvent : MulticastDelegate

Function that can be used to respond on a saved workspace.

protected Guid guid

public readonly NodeFactory NodeFactory

A NodeFactory used by this workspace to create Nodes.

Returns all of the annotations currently present in the workspace.

public string Author { get; set; }

An author of the workspace

public bool CanRedo { get; }

Determine if redo operation is currently possible.

public bool CanUndo { get; }

Determine if undo operation is currently possible.

public double CenterX { get; set; }

Implements CenterX property.

public double CenterY { get; set; }

Implements CenterY property.

All of the connectors currently in the workspace.

public HashSet<Guid> Dependencies { get; }

gathers the direct customNode workspace dependencies of this workspace.

public string Description { get; set; }

A description of the workspace

public ElementResolver ElementResolver { get; protected set; }

Returns ElementResolver. This property resolves partial class name to fully resolved name.

public string FileName { get; set; }

Path to the file this workspace is associated with. If null or empty, this workspace has never been saved.

public Guid Guid { get; }

A unique identifier for the workspace.

public bool HasUnsavedChanges { get; set; }

Are there unsaved changes in the workspace?

public double Height { get; set; }

Returns the height of the workspace's bounds.

public bool IsReadOnly { get; set; }

Returns if current workspace is readonly.

public DateTime LastSaved { get; set; }

The date of the last save.

public string Name { get; set; }

The name of this workspace.

public IEnumerable<NodeModel> Nodes { get; }

All of the nodes currently in the workspace.

public IEnumerable<NoteModel> Notes { get; }

Returns the notes NoteModel collection.

public IEnumerable<PresetModel> Presets { get; }

A set of input parameter states, this can be used to set the graph to a serialized state.

public Rect2D Rect { get; }

Returns the bounds of the workspace.

public double ScaleFactor { get; }

The geometry scale factor specific to the workspace obtained from user input when selecting the scale of the model with which he/she is working. This is used by ProtoGeometry to scale geometric values appropriately before passing them to ASM. This property is set either when reading the setting from a DYN file or when the setting is updated from the UI.

public double Width { get; set; }

Returns the width of the workspace's bounds.

public double X { get; set; }

Returns or set the X position of the workspace.

public double Y { get; set; }

Returns or set the Y position of the workspace

public double Zoom { get; set; }

Get or set the zoom value of the workspace.

Event that is fired when an annotation is added to the workspace.

Event that is fired when an annotation is removed from the workspace.

Event that is fired when annotations are cleared from the workspace.

Event that is fired when a connector is added to the workspace.

Event that is fired when a connector is deleted from a workspace.

Event that is fired every time the position offset of a workspace changes.

public event Action Disposed

Event that is fired when this workspace is disposed of.

Triggers when something needs to be logged

public event Action<NodeModel> NodeAdded

Event that is fired when a node is added to the workspace.

Event that is fired when a node is removed from the workspace.

public event Action NodesCleared

Event that is fired when nodes are cleared from the workspace.

public event Action<NoteModel> NoteAdded

Event that is fired when a note is added to the workspace.

Event that is fired when a note is removed from the workspace.

public event Action NotesCleared

Event that is fired when notes are cleared from the workspace.

Event that is fired when a workspace requests that a Node or Note model is centered.

public event Action Saved

Event that is fired when the workspace is saved.

public event Action<XmlDocument> Saving

Event that is fired during the saving of the workspace. Add additional XmlNode objects to the XmlDocument provided, in order to save data to the file.

public static WorkspaceModel FromJson(string json, LibraryServices libraryServices, EngineController engineController, DynamoScheduler scheduler, NodeFactory factory, bool isTestMode, bool verboseLogging, CustomNodeManager manager)

Load a WorkspaceModel from json. If the WorkspaceModel is a HomeWorkspaceModel it will be set as the current workspace.

public virtual void Clear()

Clears this workspace of nodes, notes, and connectors.

public void CreateModel(XmlElement modelData)

Creates ModelBase object by given xml data and adds it to corresponding collection of the workspace.

public void DeleteModel(XmlElement modelData)

Deletes ModelBase object given by XmlElement from a corresponding collection of the workspace.

public virtual void Dispose()

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

protected virtual void DisposeNode(NodeModel node)

Gets model by GUID which is contained in given Xml data.

public ModelBase GetModelInternal(Guid modelGuid)

Returns model by GUID

public virtual string GetSharedName()

Returns appropriate name of workspace for sharing.

protected void Log(ILogMessage obj)

protected void Log(string msg)

protected void Log(string msg, WarningLevel severity)

protected virtual void NodeModified(NodeModel node)

Indicates that the AST for a node in this workspace requires recompilation

protected virtual void OnAnnotationAdded(AnnotationModel annotation)

protected virtual void OnAnnotationRemoved(AnnotationModel annotation)

protected virtual void OnAnnotationsCleared()

protected virtual void OnConnectorAdded(ConnectorModel obj)

protected virtual void OnConnectorDeleted(ConnectorModel obj)

protected virtual void OnNodeAdded(NodeModel node)

protected virtual void OnNodeRemoved(NodeModel node)

protected virtual void OnNodesCleared()

protected virtual void OnNoteAdded(NoteModel note)

protected virtual void OnNoteRemoved(NoteModel note)

protected virtual void OnNotesCleared()

protected virtual void OnPopulateJSONWorkspace(JObject modelData)

protected virtual void OnSaving(XmlDocument obj)

protected virtual void OnToggleNodeFreeze(NodeModel obj)

protected virtual bool PopulateXmlDocument(XmlDocument xmlDoc)

Implement recording node modification for undo/redo.

protected virtual void RegisterNode(NodeModel node)

public void ReloadModel(XmlElement modelData)

Updates ModelBase object with given xml data

public void RemoveGroup(ModelBase model)

Deletes AnnotationModel object from annotation collection of the workspace.

public void ReportPosition()

Called when workspace position is changed. This method notifyies all the listeners when a workspace is changed.

protected virtual void ResetWorkspaceCore()

Derived workspace classes can choose to override this method to perform clean-up specific to them.

public virtual void Save(string filePath, bool isBackup = false, EngineController engine = null)

Workspace's Save method serializes the Workspace to JSON and writes it to the specified file path.

Updates a workspace model with extra view information. When loading a workspace from JSON, the data is split into two parts, model and view. This method sets the view information.