Esempio n. 1
0
        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));
            }
        }
Esempio n. 2
0
 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;
 }
Esempio n. 3
0
    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;
    }
Esempio n. 4
0
 public bool Equals(IDLType other)
 {
     if (object.ReferenceEquals(other, null))
     {
         return(false);
     }
     else
     {
         return(IsPrimitive == other.IsPrimitive && Name == other.Name);
     }
 }
Esempio n. 5
0
    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));
    }
Esempio n. 6
0
        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");
        }
Esempio n. 7
0
 public JSDynamicType(IDLType type) : base(type) { }
Esempio n. 8
0
 public JSArgType(IDLType type) : base(type) { }
Esempio n. 9
0
 public SimpleConvertedType(IDLType type) : base(type) { }
Esempio n. 10
0
 public ConvertedType(IDLType type) { Base = type; }
Esempio n. 11
0
 public CSType(IDLType type) : base(type) { }
Esempio n. 12
0
 public bool Equals(IDLType other)
 {
   if (object.ReferenceEquals(other, null)) return false;
   else                                     return IsPrimitive == other.IsPrimitive && Name == other.Name;
 }
Esempio n. 13
0
 public Argument(XElement arg, int index)
   : base(arg)
 {
   Type = new IDLType(arg.Element("Type"), this);
   Index = index;
 }
Esempio n. 14
0
 public Argument(XElement arg, int index)
     : base(arg)
 {
     Type  = new IDLType(arg.Element("Type"), this);
     Index = index;
 }
Esempio n. 15
0
 public CSInternalArgType(IDLType type) : base(type) { }
Esempio n. 16
0
 public CPPArgType(IDLType type) : base(type) { }
Esempio n. 17
0
 public CPPRetType(IDLType type) : base(type) { }
Esempio n. 18
0
 public MonoArgType(IDLType type) : base(type) { }