private static void WriteElement(Element e, StreamWriter sr) { if(e==null) return; if(e.s!=null) { sr.Write(e.s); return; } WriteData(e.startTag,sr); for(int i=0;i<e.DataCount();i++) { WriteData(e.GetData(i),sr); } for(int i=0;i<e.ElementCount();i++) WriteElement(e.GetElement(i),sr); WriteData(e.endTag,sr); }
//**INTERNAL**METHODS internal int AddElement(Element e) { return this.elements.Add(e); }
internal void InsertElement(int index, Element e) { this.elements.Insert(index, e); }
internal int AddElement(Element e) { if(this.IsAccepted(e)) return this.elements.Add(e); else throw new UnexpectedElement(); }
protected bool IsAccepted(Element e) { return true; // DEBUG : trebuie modificat // return elementAcceptanceList.Contains(e); }
internal void InsertElement(int index, Element e) { if(this.IsAccepted(e)) this.elements.Insert(index,e); else throw new UnexpectedElement(); }