public ObjectProxy(XObject o) { if (o is XIterator) { itr = o as XIterator; getObject = this.GetIteratorObject; getElement = this.GetIteratorElement; getType = this.GetIteratorType; } else { obj = o; ele = o as XElement; getObject = this.GetInternalObject; getElement = this.GetInternalElement; getType = this.GetInternalType; } }