private void GlobalSettings_SelectedNodesChanged(object sender, object e) { if (graph != null) { graph.StatusChanged -= Parent_StatusChanged; graph = null; } if (e is GraphNode) { var node = (e as GraphNode).Node; graph = node.Parent; graph.StatusChanged += Parent_StatusChanged; attrObject = node; } else if (e is NodeSystemLib2.Graph) { graph = (NodeSystemLib2.Graph)e; graph.StatusChanged += Parent_StatusChanged; attrObject = graph; } else { grid.Properties.Clear(); return; } LoadAttributes(attrObject.Attributes); }
public void ShowForObject(NodeSystemLib2.Generic.NodeAttributes.IAttributable o) { if (graph != null) { graph.StatusChanged -= Parent_StatusChanged; } attrObject = o; if (attrObject is NodeSystemLib2.Node) { graph = ((NodeSystemLib2.Node)attrObject).Parent; } else if (attrObject is NodeSystemLib2.Graph) { graph = (NodeSystemLib2.Graph)attrObject; } else { graph = null; } LoadAttributes(o.Attributes); Show(); }