WorkspaceModel
public abstract class WorkspaceModel : NotificationObject, ILocatable, IUndoRedoRecorderClient, ILogSource, IDisposable, IWorkspaceModel
Represents base class for all kind of workspaces which contains general data
such as Name, collections of nodes, notes, annotations, etc.
Function that can be used to respond to a "point event"
Function that can be used to respond on a saved workspace.
A NodeFactory used by this workspace to create Nodes.
Returns all of the annotations currently present in the workspace.
An author of the workspace
Determine if redo operation is currently possible.
Determine if undo operation is currently possible.
Implements CenterX property.
Implements CenterY property.
All of the connectors currently in the workspace.
gathers the direct customNode workspace dependencies of this workspace.
A description of the workspace
Returns ElementResolver. This property resolves partial class name to fully resolved name.
Path to the file this workspace is associated with. If null or empty, this workspace has never been saved.
A unique identifier for the workspace.
Are there unsaved changes in the workspace?
Returns the height of the workspace's bounds.
Returns if current workspace is readonly.
The date of the last save.
The name of this workspace.
All of the nodes currently in the workspace.
Returns the notes NoteModel collection.
A set of input parameter states, this can be used to set the graph to a serialized state.
Returns the bounds of the workspace.
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.
Returns the width of the workspace's bounds.
Returns or set the X position of the workspace.
Returns or set the Y position of the workspace
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.
Event that is fired when this workspace is disposed of.
Triggers when something needs to be logged
Event that is fired when a node is added to the workspace.
Event that is fired when a node is removed from the workspace.
Event that is fired when nodes are cleared from the workspace.
Event that is fired when a note is added to the workspace.
Event that is fired when a note is removed from the workspace.
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.
Event that is fired when the workspace is saved.
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.
protected WorkspaceModel(IEnumerable<NodeModel> nodes, IEnumerable<NoteModel> notes, IEnumerable<AnnotationModel> annotations, WorkspaceInfo info, NodeFactory factory, IEnumerable<PresetModel> presets, ElementResolver resolver)
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.
Clears this workspace of nodes, notes, and connectors.
Creates ModelBase object by given xml data and
adds it to corresponding collection of the workspace.
Deletes ModelBase object given by XmlElement
from a corresponding collection of the workspace.
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Gets model by GUID which is contained in given Xml data.
Returns model by GUID
Returns appropriate name of workspace for sharing.
Indicates that the AST for a node in this workspace requires recompilation
Implement recording node modification for undo/redo.
Updates ModelBase object with given xml data
Deletes AnnotationModel object from annotation collection of the workspace.
Called when workspace position is changed. This method notifyies all the listeners when a workspace is changed.
Derived workspace classes can choose to override
this method to perform clean-up specific to them.
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.