public void AddToExistingCopyInfo(TreeNode copyInfo, string key, string value) { TreeNode deviceList = copyInfo.FindKeyChild(Tree.Failover_GoldCopy.DeviceList.NAME); TreeNode devicePair = new DevicePair(); deviceList.AddChild(devicePair); TreeNode source = new Source(key); TreeNode target = new Target(value); devicePair.AddChild(source); devicePair.AddChild(target); }
public bool CopyInfoContainsDeviceSource(TreeNode copyInfo, string key) { TreeNode deviceList = copyInfo.FindKeyChild(Tree.Failover_GoldCopy.DeviceList.NAME); foreach(TreeNode devicePair in deviceList.Children) { string source = devicePair.FindKeyChildValue(Source.NAME); if (source == key) return true; } return false; }
private void AddXmlChildren(XmlElement elem, TreeNode node, XmlDocument document) { foreach (TreeNode child in node.Children) { XmlElement subElem = document.CreateElement(child.Name); if(!child.Value.Equals(string.Empty)) subElem.InnerText = child.Value; elem.AppendChild(subElem); AddXmlChildren(subElem, child, document); } }
public Context(string type) { if (type.Equals(OpenCmd.FAILOVER) || type.Equals(OpenCmd.GOLDCOPY)) { node = new TestFailoverInfo(); node.AddChild(new Tree.Version(Tree.Version.DEFAULT_VERSION)); } else { node = new MaskViewList(); node.AddChild(new Tree.Version(Tree.Version.DEFAULT_VERSION)); } Type = type; }
public bool CopyInfoContainsDeviceTarget(TreeNode copyInfo, string value) { TreeNode deviceList = copyInfo.FindKeyChild(Tree.Failover_GoldCopy.DeviceList.NAME); foreach (TreeNode devicePair in deviceList.Children) { string target = devicePair.FindKeyChildValue(Target.NAME); if (target == value) return true; } return false; }
public Context(TreeNode root, string type) { node = root; Type = type; }
public void RemoveChild(TreeNode child) { children.Remove(child); }
public void AddChild(TreeNode child) { children.Add(child); }