コード例 #1
0
 remove(ILElement removeElement)
 {
     removeElement.setOwner(null);
     m_elements.Remove(removeElement);
     if (removeElement is ILClassElement)
     {
         m_classElements.Remove(removeElement);
     }
 }
コード例 #2
0
        insertBefore(ILElement insertElement, ILElement existingElement)
        {
            for (int i = 0; i < m_elements.Count; i++)
            {
                if (m_elements[i] == existingElement)
                {
                    insertElement.setOwner(this);
                    m_elements.Insert(i, insertElement);
                    return(true);
                }
            }

            return(false);
        }
コード例 #3
0
        insertAfter(ILElement insertElement, ILElement existingElement)
        {
            for (int i = 0; i < m_elements.Count; i++)
            {
                if (m_elements[i] == existingElement)
                {
                    insertElement.setOwner(this);
                    if ((i + 1) < m_elements.Count)
                    {
                        m_elements.Insert(i + 1, insertElement);
                    }
                    else
                    {
                        m_elements.Add(insertElement);
                    }

                    return(true);
                }
            }

            return(false);
        }
コード例 #4
0
        addElement(ILElement insertElement)
        {
            if (null == m_elements)
            {
                m_elements = new ArrayList();
            }

            insertElement.setOwner(this);
            if (insertElement is ILClassElement)
            {
                if (m_classElements == null)
                {
                    // Erst versuchen, vorhandene Elemente zu finden
                    this.getAllClassElements();
                    // Keine gefunden? Neue Arraylist anlegen
                    if (m_classElements == null)
                    {
                        m_classElements = new ArrayList();
                    }
                }
                m_classElements.Add(insertElement);
            }
            m_elements.Add(insertElement);
        }