Exemplo n.º 1
0
 /// <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);
 }
Exemplo n.º 2
0
 /// <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);
 }
Exemplo n.º 3
0
 /// <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));
 }
Exemplo n.º 4
0
 /// <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);
 }
Exemplo n.º 5
0
 /// <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);
 }
Exemplo n.º 6
0
 /// <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);
 }
Exemplo n.º 7
0
 /// <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);
 }
Exemplo n.º 8
0
 /// <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));
 }
Exemplo n.º 9
0
 /// <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)));
 }
Exemplo n.º 10
0
 public bool ContainsItem(string name)
 {
     return(ContainsItem(new Queue <string>(UriUtilities.GetParts(name))));
 }
Exemplo n.º 11
0
 /// <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);
 }
Exemplo n.º 12
0
 /// <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);
 }
Exemplo n.º 13
0
 /// <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);
 }
Exemplo n.º 14
0
 /// <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));
 }