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

            return(getOwner().insertAfter(insertElement, this));
        }
Example #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);
        }
Example #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);
        }
Example #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);
        }
Example #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);
                }
            }
        }
Example #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);
 }
Example #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);
                }
            }
        }
Example #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);
        }
Example #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);
        }
Example #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);
            }
        }
Example #12
0
 private ILElementIterator(ILElement element, Type elementType, int index)
 {
     Init(element, elementType, index, false);
 }
Example #13
0
 public Iterator(ILElement element)
     : base(element, typeof(ILAssemblyElement))
 {
 }
Example #14
0
 public ILElementIterator(ILElement element, Type elementType)
 {
     Init(element, elementType, -1, false);
 }
Example #15
0
 public ILElementIterator(ILElement element, Type elementType, bool recursive)
 {
     Init(element, elementType, -1, true);
 }
Example #16
0
 public ILCatchElement(string firstLine, ILElement owner)
     : base(firstLine, owner)
 {
 }
Example #17
0
 public Iterator(ILElement element)
     : base(element, typeof(ILCatchElement))
 {
 }
Example #18
0
 public ILModuleElement(string firstLine, ILElement owner)
     : base(firstLine, owner)
 {
 }
Example #19
0
 public Iterator(ILElement element)
     : base(element, typeof(ILModuleElement))
 {
 }
Example #20
0
 public ILFieldElement(string firstLine, ILElement owner)
     : base(firstLine, owner)
 {
 }
Example #21
0
 getIterator(ILElement element)
 {
     return(new Iterator(element));
 }
Example #22
0
 public Iterator(ILElement element)
     : base(element, typeof(ILStatementElement))
 {
 }
Example #23
0
 public Iterator(ILElement element)
     : base(element, typeof(ILFieldElement))
 {
 }
Example #24
0
 public ILAssemblyElement(string firstLine, ILElement owner)
     : base(firstLine, owner)
 {
 }
Example #25
0
 public ILStatementElement(string firstLine, ILElement owner)
     : base(firstLine, owner)
 {
 }
Example #26
0
 public Iterator(ILElement element)
     : base(element, typeof(ILTryElement))
 {
 }
Example #27
0
 public Iterator(ILElement element, bool recursive)
     : base(element, typeof(ILStatementElement), recursive)
 {
 }
Example #28
0
		public ILPropertyElement( string firstLine, ILElement owner )
			: base( firstLine, owner )
		{
		}
Example #29
0
 getIterator(ILElement element, bool recursive)
 {
     return(new Iterator(element, recursive));
 }
Example #30
0
			public Iterator( ILElement element )
				: base( element, typeof( ILPropertyElement ) )
			{
			}