GraphLinksModelNodeData
A simple representation of node data for GraphLinksModel that supports property change notification, copying, and undo via the INotifyPropertyChanged, ICloneable, and IChangeDataValue interfaces.
Implements: INotifyPropertyChanged, IChangeDataValue, ICloneable
Constructors
public GraphLinksModelNodeData()
graphLinksModelNodeData = GraphLinksModelNodeData()
The default constructor produces an empty object.
public GraphLinksModelNodeData(NodeKey key)
graphLinksModelNodeData = GraphLinksModelNodeData(key)
This constructor also initializes the Key property.
- key
Properties
public string Category { get; set; }
value = graphLinksModelNodeData.Category
graphLinksModelNodeData.Category = value
Gets or sets a String that names the category to which the node data belongs.
public bool IsLinkLabel { get; set; }
value = graphLinksModelNodeData.IsLinkLabel
graphLinksModelNodeData.IsLinkLabel = value
Gets or sets whether this node data represents a "label" on a link instead of a simple node.
public virtual bool IsSubGraph { get; set; }
value = graphLinksModelNodeData.IsSubGraph
graphLinksModelNodeData.IsSubGraph = value
Gets or sets whether this node data represents a group or "subgraph" instead of a normal "atomic" node.
public bool IsSubGraphExpanded { get; set; }
value = graphLinksModelNodeData.IsSubGraphExpanded
graphLinksModelNodeData.IsSubGraphExpanded = value
Gets or sets whether this node is in the "expanded" state.
public NodeKey Key { get; set; }
value = graphLinksModelNodeData.Key
graphLinksModelNodeData.Key = value
Gets or sets the key property for this node data.
public Point Location { get; set; }
value = graphLinksModelNodeData.Location
graphLinksModelNodeData.Location = value
Gets or sets a Point that is the location of the node in model coordinates.
public IList<NodeKey> MemberKeys { get; set; }
value = graphLinksModelNodeData.MemberKeys
graphLinksModelNodeData.MemberKeys = value
Gets or sets a list of references to member nodes.
public NodeKey SubGraphKey { get; set; }
value = graphLinksModelNodeData.SubGraphKey
graphLinksModelNodeData.SubGraphKey = value
Gets or sets a reference to the containing subgraph node, if any.
public string Text { get; set; }
value = graphLinksModelNodeData.Text
graphLinksModelNodeData.Text = value
Gets or sets a String that is associated with the node.
public bool WasSubGraphExpanded { get; set; }
value = graphLinksModelNodeData.WasSubGraphExpanded
graphLinksModelNodeData.WasSubGraphExpanded = value
Gets or sets whether this node had been "expanded" when its containing group was "collapsed".
Methods
public virtual void ChangeDataValue(ModelChangedEventArgs e, bool undo)
graphLinksModelNodeData.ChangeDataValue(e, undo)
This method implements the IChangeDataValue interface, used to perform state changes for undo and redo.
- e
- an edit describing the change to be performed
- undo
- true if undoing; false if redoing
public virtual object Clone()
result = graphLinksModelNodeData.Clone()
Create a copy of this data; this implements the ICloneable interface.
protected virtual string ConvertNodeKeyToString(NodeKey key)
result = graphLinksModelNodeData.ConvertNodeKeyToString(key)
Convert a key value to a string.
- key
Returns: a String from which String) can recover the original key value
protected virtual NodeKey ConvertStringToNodeKey(string s)
result = graphLinksModelNodeData.ConvertStringToNodeKey(s)
Convert a string to a key value.
- s
Returns: a
public virtual void LoadFromXElement(XElement e)
graphLinksModelNodeData.LoadFromXElement(e)
Initialize this node data with data held in a Linq for XML XElement.
- e
- the XElement
public virtual XElement MakeXElement(XName n)
result = graphLinksModelNodeData.MakeXElement(n)
Constructs a Linq for XML XElement holding the data of this node.
- n
- the name of the new XElement
Returns: an initialized XElement
public virtual void OnPropertyChanged(ModelChangedEventArgs e)
graphLinksModelNodeData.OnPropertyChanged(e)
Raise the PropertyChanged event.
- e
protected void RaisePropertyChanged(string pname, object oldval, object newval)
graphLinksModelNodeData.RaisePropertyChanged(pname, oldval, newval)
Call this method from property setters to raise the PropertyChanged event.
- pname
- the property name
- oldval
- the value before the property was set
- newval
- the new value
public override string ToString()
result = graphLinksModelNodeData.ToString()
For debugging, use the Key property as this object's default text rendering.
Events
public event PropertyChangedEventHandler PropertyChanged
graphLinksModelNodeData.PropertyChanged += handler
This event implements the INotifyPropertyChanged interface, so that both the model and the dependency object system can be informed of changes to property values.