public override bool RemoveElement(BaseElement element)
 {
     if (element is InputOutputElement)
     {
         InputOutputElement io = (element as InputOutputElement);
         io.OnUpdateIndexChanged -= UpdateIndexChangedEventHandler;
         m_IgnoreEvents           = true;
         foreach (BaseElement be in m_Elements)
         {
             if (be is InputOutputElement)
             {
                 InputOutputElement beio = be as InputOutputElement;
                 if (beio.UpdateIndex > io.UpdateIndex)
                 {
                     beio.UpdateIndex--;
                 }
             }
         }
         m_IgnoreEvents = false;
     }
     return(base.RemoveElement(element));
 }
Exemple #2
0
 /// <summary>
 /// Checks whether an element is part of this container
 /// </summary>
 /// <param name="element">the element to check</param>
 /// <returns>true if the element is contained</returns>
 public virtual bool ContainsElement(BaseElement element)
 {
     return(m_Elements.Contains(element));
 }
Exemple #3
0
 /// <summary>
 /// Removes an element from this container
 /// </summary>
 /// <param name="element">the element to remove</param>
 /// <returns>true when removing was successful</returns>
 public virtual bool RemoveElement(BaseElement element)
 {
     return(m_Elements.Remove(element));
 }