remove(ILElement removeElement) { removeElement.setOwner(null); m_elements.Remove(removeElement); if (removeElement is ILClassElement) { m_classElements.Remove(removeElement); } }
insertAfter(ILElement insertElement) { if (null == getOwner()) { return(false); } return(getOwner().insertAfter(insertElement, this)); }
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); }
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); }
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); }
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); } } }
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); }
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); } } }
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); }
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); }
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); } }
private ILElementIterator(ILElement element, Type elementType, int index) { Init(element, elementType, index, false); }
public Iterator(ILElement element) : base(element, typeof(ILAssemblyElement)) { }
public ILElementIterator(ILElement element, Type elementType) { Init(element, elementType, -1, false); }
public ILElementIterator(ILElement element, Type elementType, bool recursive) { Init(element, elementType, -1, true); }
public ILCatchElement(string firstLine, ILElement owner) : base(firstLine, owner) { }
public Iterator(ILElement element) : base(element, typeof(ILCatchElement)) { }
public ILModuleElement(string firstLine, ILElement owner) : base(firstLine, owner) { }
public Iterator(ILElement element) : base(element, typeof(ILModuleElement)) { }
public ILFieldElement(string firstLine, ILElement owner) : base(firstLine, owner) { }
getIterator(ILElement element) { return(new Iterator(element)); }
public Iterator(ILElement element) : base(element, typeof(ILStatementElement)) { }
public Iterator(ILElement element) : base(element, typeof(ILFieldElement)) { }
public ILAssemblyElement(string firstLine, ILElement owner) : base(firstLine, owner) { }
public ILStatementElement(string firstLine, ILElement owner) : base(firstLine, owner) { }
public Iterator(ILElement element) : base(element, typeof(ILTryElement)) { }
public Iterator(ILElement element, bool recursive) : base(element, typeof(ILStatementElement), recursive) { }
public ILPropertyElement( string firstLine, ILElement owner ) : base( firstLine, owner ) { }
getIterator(ILElement element, bool recursive) { return(new Iterator(element, recursive)); }
public Iterator( ILElement element ) : base( element, typeof( ILPropertyElement ) ) { }