/// <summary> /// Creates a new instance from the class specified in the <see cref="Class"/> property. /// </summary> /// <returns>New instance of the class.</returns> internal XObject InitiazeFromClass() { XClass cls = (XClass)this.FindGlobal(this.Class); if (cls == null) { throw new InvalidOperationException("Could not find class: " + this.Class); } var instance = cls.CreateInstance(this); instance.InitHierarchy(); return(instance); }