public void InsertObservedNode( Dictionary <string, U> observedNodes, string name, U node, UriTreeNode <U> .UriTreeNodeDelegate onNodeAdded, bool disallowDuplicates = true) { InsertObservedNode <U>( observedNodes, new Queue <string>(UriUtilities.GetParts(name)), node, onNodeAdded, disallowDuplicates); }
/// <summary> /// Set a pre-existing item with the given full name to the given value. /// </summary> /// <param name="item"></param> /// <param name="name"></param> public void SetItem(string name, U item) { AddItem(new Queue <string>(UriUtilities.GetParts(name)), item, false); }
/// <summary> /// Add an item with the given full name to this group. /// </summary> /// <param name="item"></param> /// <param name="name"></param> /// <param name="disallowDuplicates"></param> public void AddItem(string name, U item, bool disallowDuplicates = true) { AddItem(new Queue <string>(UriUtilities.GetParts(name)), item, disallowDuplicates); }
/// <summary> /// Remove an anonymous item from the subgroup of this group with the given name. /// </summary> /// <param name="name"></param> /// <param name="item"></param> /// <param name="failQuiet"></param> public bool RemoveAnonymousItem(string name, U item, bool failQuiet = true) { return(RemoveAnonymousItem(new Queue <string>(UriUtilities.GetParts(name)), item, failQuiet)); }
/// <summary> /// Insert an anonymous item into the subgroup of this group with the /// given name. Unlike AddAnonymousItem, this will automatically create /// any missing intermediate groups (i.e. adding "a.b.c.d.e" to "a.b.c" /// will create "a.b.c.d"). /// /// The type of group used is the NodeType generic parameter. For this /// method to work, the given NodeType must have a constructor that takes /// a single string argument and calls base(string). /// </summary> /// <typeparam name="NodeType"></typeparam> /// <param name="name"></param> /// <param name="item"></param> public void InsertAnonymousItem <NodeType>(string name, U item) where NodeType : UriTreeMutableGroup <T, U> { InsertAnonymousItem <NodeType>(new Queue <string>(UriUtilities.GetParts(name)), item); }
/// <summary> /// Remove the item with the given name. /// </summary> /// <param name="name"></param> /// <param name="failQuiet"></param> public void RemoveItem(string name, bool failQuiet = false) { RemoveItem(new Queue <string>(UriUtilities.GetParts(name)), failQuiet); }
/// <summary> /// Add an anonymous item to the subgroup of this group with the given name. /// </summary> /// <param name="name"></param> /// <param name="item"></param> public void AddAnonymousItem(string name, U item) { AddAnonymousItem(new Queue <string>(UriUtilities.GetParts(name)), item); }
/// <summary> /// Insert an item into the UriTree with the given full name. Inserting an item is /// different from adding an item in the sense that missing intermediate nodes will /// be automatically created (i.e. adding "a.b.c.d" to "a.b" will automatically create /// the missing node "a.b.c"). /// /// The NodeType generic parameter is the type of instance used to create missing /// intermediate nodes. For this method to work, the supplied NodeType must have a /// constructor that takes a single string argument and calls base(string). /// </summary> /// <typeparam name="NodeType"></typeparam> /// <param name="item"></param> /// <param name="name"></param> /// <param name="disallowDuplicates"></param> public void InsertItem <NodeType>(string name, U item, bool disallowDuplicates = true) where NodeType : UriTreeMutableGroup <T, U> { InsertItem <NodeType>(new Queue <string>(UriUtilities.GetParts(name)), item, disallowDuplicates); }
/// <summary> /// Return the item with the given full name. If not found, return the given /// default value. /// </summary> /// <param name="fullName"></param> /// <param name="defaultVal"></param> /// <returns></returns> public U GetItem(string fullName, U defaultVal, bool useDefault = true) { return(GetItem(new Queue <string>(UriUtilities.GetParts(fullName)), useDefault, defaultVal)); }
/// <summary> /// Return the item with the given full name. /// </summary> /// <param name="fullName"></param> /// <returns></returns> public U GetItem(string fullName, bool useDefault = false) { return(GetItem(new Queue <string>(UriUtilities.GetParts(fullName)), useDefault, default(U))); }
public bool ContainsItem(string name) { return(ContainsItem(new Queue <string>(UriUtilities.GetParts(name)))); }
/// <summary> /// Insert a subgroup into the existing tree structure, creating empty subgroups /// wherever they don't exist in the tree (similar to what AddInsertSubgroup does). /// /// Note: for this method to work the supplied NodeType class must have a constructor /// that takes a single string argument and calls base(string). /// </summary> /// <typeparam name="NodeType"></typeparam> /// <param name="fullName"></param> /// <param name="subnode"></param> /// <param name="disallowDuplicates"></param> public void InsertSubnode <NodeType>(string fullName, T subnode, bool disallowDuplicates = true) where NodeType : UriTreeNode <T> { InsertSubnode <NodeType>(new Queue <string>(UriUtilities.GetParts(fullName)), subnode, disallowDuplicates); }
/// <summary> /// Add a subnode to this node with the given full name. /// </summary> /// <param name="fullName"></param> /// <param name="subnode"></param> /// <param name="disallowDuplicates"></param> public void AddSubnode(string fullName, T subnode, bool disallowDuplicates = true) { AddSubnode(new Queue <string>(UriUtilities.GetParts(fullName)), subnode, disallowDuplicates); }
/// <summary> /// Remove a subnode with the given full asset URI (without the /// parent node name). /// </summary> /// <param name="fullName"></param> public void RemoveSubnode(string fullName, bool failQuiet = true) { RemoveSubnode(new Queue <string>(UriUtilities.GetParts(fullName)), failQuiet); }
/// <summary> /// Return a subnode of this node with the given full name. /// /// Example: /// If this node's name is "Parent", then calling GetSubnode("Child.GrandChild") /// will return the node "Parent.Child.GrandChild". /// </summary> /// <param name="fullName"></param> /// <returns></returns> public T GetSubnode(string fullName, bool failQuiet = false) { return(GetSubnode(new Queue <string>(UriUtilities.GetParts(fullName)), failQuiet)); }