Exemplo n.º 1
0
        /// <summary>
        /// Gets the parent of a specified type. This method goes back
        /// to all parent and returns the first parent of the type T or null if no parent were found.
        /// </summary>
        /// <typeparam name="T">Type of the parent</typeparam>
        /// <returns>a valid reference to the parent T or null if no parent of this type</returns>
        public T GetParent <T>() where T : CsBase
        {
            CsBase parent = Parent;

            while (parent != null && !(parent is T))
            {
                parent = parent.Parent;
            }
            return((T)parent);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Removes the specified inner container from this container
 /// </summary>
 /// <remarks>
 /// The Parent property of the innerContainer is set to null.
 /// </remarks>
 /// <param name="innerCs">The inner container.</param>
 public void Remove(CsBase innerCs)
 {
     innerCs.Parent = null;
     _items.Remove(innerCs);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Adds the specified inner container to this container.
 /// </summary>
 /// <remarks>
 /// The Parent property of the innerContainer is set to this container.
 /// </remarks>
 /// <param name="innerCs">The inner container.</param>
 public void Add(CsBase innerCs)
 {
     innerCs.Parent = this;
     _items.Add(innerCs);
 }
Exemplo n.º 4
0
 public IReadOnlyList <T> GetList(CsBase container)
 {
     if (list is { Invalid : true })
Exemplo n.º 5
0
 /// <summary>
 /// Removes the specified inner container from this container
 /// </summary>
 /// <remarks>
 /// The Parent property of the innerContainer is set to null.
 /// </remarks>
 /// <param name="innerCs">The inner container.</param>
 public void Remove(CsBase innerCs)
 {
     Items.Remove(innerCs);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Adds the specified inner container to this container.
 /// </summary>
 /// <remarks>
 /// The Parent property of the innerContainer is set to this container.
 /// </remarks>
 /// <param name="innerCs">The inner container.</param>
 public void Add(CsBase innerCs)
 {
     Items.Add(innerCs);
 }
Exemplo n.º 7
0
 public CsNamespace(CsBase parentContainer, string nameSpace)
 {
     Name   = nameSpace;
     Parent = parentContainer;
 }