Ejemplo n.º 1
0
 /// <summary>
 /// Adds to boundary.
 /// </summary>
 /// <param name="item">The item.</param>
 private void addToBoundary(CompositeShape <T, TBoundary, TExtents> item)
 {
     if (IsBaseShape())
     {
         _boundary.Reset(item.Boundary);
     }
     else
     {
         _boundary.Add(item.Boundary);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Removes the first occurrence of a specific object from the <see cref="T:System.Collections.Generic.List`1" />.
        /// </summary>
        /// <param name="item">The object to remove from the <see cref="T:System.Collections.Generic.List`1" />. The value can be null for reference types.</param>
        /// <returns>true if <paramref name="item" /> is successfully removed; otherwise, false.  This method also returns false if <paramref name="item" /> was not found in the <see cref="T:System.Collections.Generic.List`1" />.</returns>
        public new bool Remove(CompositeShape <T, TBoundary, TExtents> item)
        {
            if (!base.Remove(item))
            {
                return(false);
            }

            removeFromBoundary(item);
            updateExtents();
            return(true);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Removes from boundary.
 /// </summary>
 /// <param name="item">The item.</param>
 private void removeFromBoundary(CompositeShape <T, TBoundary, TExtents> item)
 {
     // Simple removal if last shape
     if (Count == 1 &&
         Contains(item))
     {
         _boundary.Clear();
     }
     else
     {
         _boundary.Remove(item.Boundary);
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Inserts an element into the <see cref="T:System.Collections.Generic.List`1" /> at the specified index.
 /// </summary>
 /// <param name="index">The zero-based index at which <paramref name="item" /> should be inserted.</param>
 /// <param name="item">The object to insert. The value can be null for reference types.</param>
 public new void Insert(int index, CompositeShape <T, TBoundary, TExtents> item)
 {
     addToBoundary(item);
     base.Insert(index, item);
     _extents.Add(item.Extents);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Adds an object to the end of the <see cref="T:System.Collections.Generic.List`1" />.
 /// </summary>
 /// <param name="item">The object to be added to the end of the <see cref="T:System.Collections.Generic.List`1" />. The value can be null for reference types.</param>
 public new void Add(CompositeShape <T, TBoundary, TExtents> item)
 {
     addToBoundary(item);
     base.Add(item);
     _extents.Add(item.Extents);
 }