Exemple #1
0
 remove(ILElement removeElement)
 {
     removeElement.setOwner(null);
     m_elements.Remove(removeElement);
     if (removeElement is ILClassElement)
     {
         m_classElements.Remove(removeElement);
     }
 }
Exemple #2
0
        insertAfter(ILElement insertElement)
        {
            if (null == getOwner())
            {
                return(false);
            }

            return(getOwner().insertAfter(insertElement, this));
        }
Exemple #3
0
        createElement(string firstLine, ILElement owner)
        {
            if (null == m_type)
            {
                return(null);
            }

            Type[]          ptype = { typeof(string), typeof(ILElement) };
            object[]        param = { firstLine, owner };
            ConstructorInfo ctor  = m_type.GetConstructor(ptype);

            return(ctor.Invoke(param) as ILElement);
        }
Exemple #4
0
        public ILElement getPredecessorOf(ILElement elementToSearch)
        {
            ILElement lastEl = null;

            for (int i = 0; i < m_elements.Count; i++)
            {
                if (m_elements[i] == elementToSearch)
                {
                    return(lastEl);
                }
                lastEl = (ILElement)m_elements[i];
            }
            return(null);
        }
Exemple #5
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);
        }
Exemple #6
0
        private void AddRecursive(ILElement parent)
        {
            for (int i = 0; i < parent.getSubElementCount(); i++)
            {
                ILElement element = parent.getElement(i);

                if (element.GetType().Equals(m_elementType) ||
                    element.GetType().IsSubclassOf(m_elementType))
                {
                    elementList.Add(element);
                }
                if (element.getSubElementCount() > 0)
                {
                    AddRecursive(element);
                }
            }
        }
Exemple #7
0
 getSuccessorOf(ILElement elementToSearch)
 {
     for (int i = 0; i < m_elements.Count; i++)
     {
         if (m_elements[i] == elementToSearch)
         {
             if (i == m_elements.Count - 1)
             {
                 return(null);
             }
             else
             {
                 return((ILElement)m_elements[i + 1]);
             }
         }
     }
     return(null);
 }
Exemple #8
0
        parseSubElements(ILFile ilfile)
        {
            m_elements = new ArrayList();

            for (string line = ilfile.popLine(); null != line; line = ilfile.popLine())
            {
                if (line.StartsWith("}"))
                {
                    return;
                }

                ILElement element = getElement(line);

                if (null != element)
                {
                    m_elements.Add(element);
                    element.parse(ilfile);
                }
            }
        }
Exemple #9
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);
        }
Exemple #10
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);
        }
Exemple #11
0
        private void Init(ILElement parent, Type elementType, int index, bool recursive)
        {
            m_recursive   = recursive;
            m_elementType = elementType;
            m_index       = index;
            elementList   = new ArrayList();
            if (!recursive)
            {
                for (int i = 0; i < parent.getSubElementCount(); i++)
                {
                    ILElement element = parent.getElement(i);

                    if (element.GetType().Equals(m_elementType) ||
                        element.GetType().IsSubclassOf(m_elementType))
                    {
                        elementList.Add(element);
                    }
                }
            }
            else
            {
                AddRecursive(parent);
            }
        }
Exemple #12
0
 private ILElementIterator(ILElement element, Type elementType, int index)
 {
     Init(element, elementType, index, false);
 }
Exemple #13
0
 public Iterator(ILElement element)
     : base(element, typeof(ILAssemblyElement))
 {
 }
Exemple #14
0
 public ILElementIterator(ILElement element, Type elementType)
 {
     Init(element, elementType, -1, false);
 }
Exemple #15
0
 public ILElementIterator(ILElement element, Type elementType, bool recursive)
 {
     Init(element, elementType, -1, true);
 }
Exemple #16
0
 public ILCatchElement(string firstLine, ILElement owner)
     : base(firstLine, owner)
 {
 }
Exemple #17
0
 public Iterator(ILElement element)
     : base(element, typeof(ILCatchElement))
 {
 }
Exemple #18
0
 public ILModuleElement(string firstLine, ILElement owner)
     : base(firstLine, owner)
 {
 }
Exemple #19
0
 public Iterator(ILElement element)
     : base(element, typeof(ILModuleElement))
 {
 }
Exemple #20
0
 public ILFieldElement(string firstLine, ILElement owner)
     : base(firstLine, owner)
 {
 }
Exemple #21
0
 getIterator(ILElement element)
 {
     return(new Iterator(element));
 }
Exemple #22
0
 public Iterator(ILElement element)
     : base(element, typeof(ILStatementElement))
 {
 }
Exemple #23
0
 public Iterator(ILElement element)
     : base(element, typeof(ILFieldElement))
 {
 }
Exemple #24
0
 public ILAssemblyElement(string firstLine, ILElement owner)
     : base(firstLine, owner)
 {
 }
Exemple #25
0
 public ILStatementElement(string firstLine, ILElement owner)
     : base(firstLine, owner)
 {
 }
Exemple #26
0
 public Iterator(ILElement element)
     : base(element, typeof(ILTryElement))
 {
 }
Exemple #27
0
 public Iterator(ILElement element, bool recursive)
     : base(element, typeof(ILStatementElement), recursive)
 {
 }
Exemple #28
0
		public ILPropertyElement( string firstLine, ILElement owner )
			: base( firstLine, owner )
		{
		}
Exemple #29
0
 getIterator(ILElement element, bool recursive)
 {
     return(new Iterator(element, recursive));
 }
Exemple #30
0
			public Iterator( ILElement element )
				: base( element, typeof( ILPropertyElement ) )
			{
			}