public Operation(XElement operation) : base(operation) { WebIDL = operation.Element("webidl").Value.Trim(); Name = operation.Attribute("name").Value; CapitalizedName = char.ToUpper(Name[0]) + Name.Substring(1); IsRuntime = HasExtendedAttribute("Runtime"); IsPrivate = HasExtendedAttribute("Private"); IsUnsafe = HasExtendedAttribute("Unsafe"); DisableHooks = HasExtendedAttribute("DisableHooks"); RetType = new IDLType(operation.Element("Type")); Args = from a in Numbered(operation.Element("ArgumentList").Elements("Argument")) select new Argument(a.Item2, a.Item1); // Some sanity checks. if (IsRuntime && IsPrivate) { throw new ArgumentException(String.Format("Operation {0} cannot be both Runtime and Private", Name)); } if (IsUnsafe && !IsPrivate) { throw new ArgumentException(String.Format("Operation {0} cannot be Unsafe unless it is Private", Name)); } if (!IsPrivate && Args.Any(a => a.Type.ByRef || a.Type.IsPrivate)) { throw new ArgumentException(String.Format("Operation {0} cannot have ByRef or Private arguments unless it is Private", Name)); } }
public Constant(XElement constant) : base(constant) { WebIDL = constant.Element("webidl").Value.Trim(); Name = constant.Attribute("name").Value; CapitalizedName = char.ToUpper(Name[0]) + Name.Substring(1); Type = new IDLType(constant.Element("Type")); Value = constant.Attribute("value").Value; }
public bool Equals(IDLType other) { if (object.ReferenceEquals(other, null)) { return(false); } else { return(IsPrimitive == other.IsPrimitive && Name == other.Name); } }
public Operation(XElement operation) : base(operation) { WebIDL = operation.Element("webidl").Value.Trim(); Name = operation.Attribute("name").Value; CapitalizedName = char.ToUpper(Name[0]) + Name.Substring(1); IsRuntime = HasExtendedAttribute("Runtime"); IsPrivate = HasExtendedAttribute("Private"); IsUnsafe = HasExtendedAttribute("Unsafe"); DisableHooks = HasExtendedAttribute("DisableHooks"); RetType = new IDLType(operation.Element("Type")); Args = from a in Numbered(operation.Element("ArgumentList").Elements("Argument")) select new Argument(a.Item2, a.Item1); // Some sanity checks. if (IsRuntime && IsPrivate) throw new ArgumentException(String.Format("Operation {0} cannot be both Runtime and Private", Name)); if (IsUnsafe && !IsPrivate) throw new ArgumentException(String.Format("Operation {0} cannot be Unsafe unless it is Private", Name)); if (!IsPrivate && Args.Any(a => a.Type.ByRef || a.Type.IsPrivate)) throw new ArgumentException(String.Format("Operation {0} cannot have ByRef or Private arguments unless it is Private", Name)); }
public Attribute(XElement attribute) : base(attribute) { WebIDL = attribute.Element("webidl").Value.Trim(); Name = attribute.Attribute("name").Value; CapitalizedName = char.ToUpper(Name[0]) + Name.Substring(1); GetterType = new IDLType(attribute.Element("Type")); if (HasExtendedAttribute("Setter")) { SetterType = new IDLType(GetExtendedAttribute("Setter").Element("ArgumentList").Element("Argument").Element("Type")); } else { SetterType = GetterType; } IsReadOnly = attribute.Attribute("readonly") != null; IsEventHandler = HasExtendedAttribute("EventHandler"); }
public JSDynamicType(IDLType type) : base(type) { }
public JSArgType(IDLType type) : base(type) { }
public SimpleConvertedType(IDLType type) : base(type) { }
public ConvertedType(IDLType type) { Base = type; }
public CSType(IDLType type) : base(type) { }
public bool Equals(IDLType other) { if (object.ReferenceEquals(other, null)) return false; else return IsPrimitive == other.IsPrimitive && Name == other.Name; }
public Argument(XElement arg, int index) : base(arg) { Type = new IDLType(arg.Element("Type"), this); Index = index; }
public CSInternalArgType(IDLType type) : base(type) { }
public CPPArgType(IDLType type) : base(type) { }
public CPPRetType(IDLType type) : base(type) { }
public MonoArgType(IDLType type) : base(type) { }