Interface IModel
- Namespace
- Northwoods.Go.Models
- Assembly
- Northwoods.GoDiagram.WinForms.dll
Interface describing a Model<TNodeData, TNodeKey, TSharedData>.
public interface IModel
Properties
DataFormat
Gets or sets the name of the format of the diagram data.
string DataFormat { get; set; }
Property Value
- See Also
IsReadOnly
Gets or sets whether this model may be modified, such as adding nodes.
bool IsReadOnly { get; set; }
Property Value
- See Also
Name
Gets or sets the name of this model.
string Name { get; set; }
Property Value
- See Also
NodeDataSource
Gets or sets the collection of node data objects that correspond to Nodes, Groups, or non-Link Parts in the Diagram.
IEnumerable<object> NodeDataSource { get; set; }
Property Value
- See Also
NodeKeyProperty
Gets or sets the name of the data property that returns a unique key for each node data object.
string NodeKeyProperty { get; set; }
Property Value
- See Also
SharedData
Gets an object that can hold programmer-defined property values for the model as a whole, rather than just for one node or one link.
object SharedData { get; set; }
Property Value
- See Also
SkipsUndoManager
Gets or sets whether ChangedEvents are not recorded by the UndoManager.
bool SkipsUndoManager { get; set; }
Property Value
- See Also
UndoManager
Gets or sets the UndoManager for this Model.
UndoManager UndoManager { get; set; }
Property Value
- See Also
Methods
AddNodeData(object)
When you want to add a node or group to the diagram, call this method with a new data object.
void AddNodeData(object nodedata)
Parameters
nodedata
object
- See Also
-
AddNodeData(TNodeData)
ApplyIncrementalJson(string)
Modify this model by applying the changes given in an "incremental" model change in JSON format generated by ToIncrementalJson(ChangedEvent).
void ApplyIncrementalJson(string s)
Parameters
s
string
- See Also
Clear()
Clear out all references to any model data.
void Clear()
- See Also
-
Clear()
Commit(Action<IModel>, string)
Starts a new transaction, calls the provided function, and commits the transaction.
void Commit(Action<IModel> func, string tname = "")
Parameters
- See Also
CommitTransaction(string)
Commit the changes of the current transaction.
bool CommitTransaction(string tname)
Parameters
tname
string
Returns
- See Also
ContainsNodeData(object)
Decide if a given node data object is in this model, using reference equality.
bool ContainsNodeData(object nodedata)
Parameters
nodedata
object
Returns
- See Also
-
ContainsNodeData(TNodeData)
CopyNodeData(object)
Make a copy of a node data object.
object CopyNodeData(object nodedata)
Parameters
nodedata
object
Returns
- See Also
-
CopyNodeData(TNodeData)
FindNodeDataForKey(object)
Given a key, find the node data object in this model that uses the given value as its unique key.
object FindNodeDataForKey(object key)
Parameters
key
object
Returns
- See Also
-
FindNodeDataForKey(TNodeKey)
GetCategoryForNodeData(object)
Find the category of a given node data, a string naming the node template or group template or part template that the Diagram should use to represent the node data.
string GetCategoryForNodeData(object nodedata)
Parameters
nodedata
object
Returns
- See Also
-
GetCategoryForNodeData(TNodeData)
GetKeyForNodeData(object)
Given a node data object return its unique key.
object GetKeyForNodeData(object nodedata)
Parameters
nodedata
object
Returns
- See Also
-
GetKeyForNodeData(TNodeData)
InsertListItem(IList, int, object)
Add an item to a data list that may be data bound by a Panel as its ItemList, given a new data value and the index at which to insert the new value, in a manner that can be undone/redone and that automatically updates any bindings.
void InsertListItem(IList list, int idx, object val)
Parameters
- See Also
RemoveListItem(IList, int)
Remove an item from a data list that may be data bound by a Panel as its ItemList, given the index at which to remove a data value, in a manner that can be undone/redone and that automatically updates any bindings.
void RemoveListItem(IList list, int idx = -1)
Parameters
- See Also
RemoveNodeData(object)
When you want to remove a node or group from the diagram, call this method with an existing data object.
void RemoveNodeData(object nodedata)
Parameters
nodedata
object
- See Also
-
RemoveNodeData(TNodeData)
RollbackTransaction()
Rollback the current transaction, undoing any recorded changes.
bool RollbackTransaction()
Returns
- See Also
Set(object, string, object)
Change the value of some property of a node data, a link data, an item data, or the SharedData, given a string naming the property and the new value, in a manner that can be undone/redone and that automatically updates any bindings.
void Set(object data, string propname, object val)
Parameters
- See Also
SetCategoryForNodeData(object, string)
Change the category of a given node data, a string naming the node template or group template or part template that the Diagram should use to represent the node data.
void SetCategoryForNodeData(object nodedata, string cat)
Parameters
- See Also
-
SetCategoryForNodeData(TNodeData, string)
SetKeyForNodeData(object, object)
Change the unique key of a given node data that is already in this model.
void SetKeyForNodeData(object nodedata, object key)
Parameters
- See Also
-
SetKeyForNodeData(TNodeData, TNodeKey)
StartTransaction(string)
Begin a transaction, where the changes are held by a Transaction object in the UndoManager.
bool StartTransaction(string tname)
Parameters
tname
string
Returns
- See Also
ToIncrementalJson(ChangedEvent)
Produce a JSON-format string representing the changes in the most recent Transaction.
string ToIncrementalJson(ChangedEvent e)
Parameters
Returns
- See Also
ToJson()
Generate a string representation of the persistent data in this model, in JSON format, that can be read in later with a call to FromJson<T>(string).
string ToJson()
Returns
- See Also
-
ToJson()
Events
Changed
Register or unregister an event handler that is called when there is a ChangedEvent.
event EventHandler<ChangedEvent> Changed
Event Type
- See Also