public IDLType(XElement type, IDLElement ownerElement = null) : base(type) { IsPrimitive = Elem.Attribute("type") != null; IsObject = Elem.Attribute("name") != null; IsString = IsPrimitive && Elem.Attribute("type").Value == "DOMString"; IsVoid = IsPrimitive && Elem.Attribute("type").Value == "void"; IsNullable = IsString || IsObject; Name = IsPrimitive ? Elem.Attribute("type").Value : Elem.Attribute("name").Value; // Some attributes on the owner element make sense as type annotations. ByRef = ownerElement != null?ownerElement.HasExtendedAttribute("ByRef") : false; IsPrivate = ownerElement != null?ownerElement.HasExtendedAttribute("Private") : false; }