public void AddChild(CrackNode child) { child.Parent = this; Children.Add(child); Model.OnNodesChanged(this); }
public void OnStructureChanged(CrackNode sender) { if (StructureChanged == null) { return; } StructureChanged(sender, new TreePathEventArgs(sender.GetTreePath())); }
public void OnNodesRemoved(CrackNode sender) { if (NodesRemoved == null) { return; } NodesRemoved(sender, new TreeModelEventArgs(sender.GetTreePath(), (object[])sender.Children.ToArray())); }
public TreePath GetTreePath() { List <object> parents = new List <object>(); parents.Add(this); CrackNode p = Parent; while (p != null) { parents.Add(p); p = p.Parent; } parents.Reverse(); return(new TreePath((object[])parents.ToArray())); }
public static CrackNode BuildFromElement(CrackModel model, DataElementContainer container) { CrackNode node = new CrackNode(model, container, 0, 0); if (container is Choice) { foreach (var child in ((Choice)container).choiceElements.Values) { if (child is DataElementContainer) { var childNode = BuildFromElement(model, child as DataElementContainer); childNode.Parent = node; node.Children.Add(childNode); } else { var childNode = new CrackNode(model, child, 0, 0); childNode.Parent = node; node.Children.Add(childNode); } } } foreach (var child in container) { if (child is DataElementContainer) { var childNode = BuildFromElement(model, child as DataElementContainer); childNode.Parent = node; node.Children.Add(childNode); } else { var childNode = new CrackNode(model, child, 0, 0); childNode.Parent = node; node.Children.Add(childNode); } } return(node); }
void cracker_EnterHandleNodeEvent(DataElement element, long position, BitStream data) { crackMap[element] = new CrackNode(crackModel, element, position, 0); }
public void RemoveChild(CrackNode child) { Children.Remove(child); Model.OnNodesRemoved(this); }