示例#1
0
 protected XmlNodeBase(XObject @object, ElementNode parent, Options options) : base(parent)
 {
     Options = options;
     if (@object is XAttribute)
     {
         XmlType = XmlObjectType.Attribute;
         Attribute = @object.As<XAttribute>();
     }
     else if (@object is XElement)
     {
         XmlType = XmlObjectType.Element;
         Element = @object.As<XElement>();
     }
     else throw new XObjectNotSupportedException(@object);
 }
示例#2
0
 protected XmlNodeBase(XObject @object, ElementNode parent, Options options) : base(parent)
 {
     Options = options;
     if (@object is XAttribute)
     {
         XmlType   = XmlObjectType.Attribute;
         Attribute = @object.As <XAttribute>();
     }
     else if (@object is XElement)
     {
         XmlType = XmlObjectType.Element;
         Element = @object.As <XElement>();
     }
     else
     {
         throw new XObjectNotSupportedException(@object);
     }
 }