Esempio n. 1
0
 public override Node AddChild(NodeType type, string Name)
 {
     uint NewId = TableUtils.GetLowestAvailableID();
     //creating node:
     NodeData n = new NodeData() { Name = ValidateName(Name), type = type, ParentID = Id };
     TableUtils.WriteToTable(new TableKey() { Table = TableType.Nodes, Node = NewId, Section = 0 }, n);
     //adding to child list:
     List<UInt32> Children = TableUtils.GetChildren((uint)Id).ToList();
     Children.Add(NewId);
     TableUtils.SetChildren((uint)Id, Children.ToArray());
     return new LocalNode() { Id = (int)NewId };
 }
Esempio n. 2
0
 public static void SetNodeData(UInt32 Node, NodeData data)
 {
     WriteToTable(new TableKey() { Table = TableType.Nodes, Node = Node, Section = 0 }, data);
 }