Beispiel #1
0
        public object[] GetCustomAttributes(JsImplType attributeType, bool inherit)
        {
            var list = new List <object>();

            AddCustomAttributes(list, attributeType, inherit);
            return(list.ToArray());
        }
Beispiel #2
0
 private static JsImplType Typeof(object jsTypeOrName)
 {
     if (jsTypeOrName == null)
     {
         throw new JsError("Unknown type.").As <Exception>();
     }
     if (JsContext.@typeof(jsTypeOrName) == "string")
     {
         return(JsImplType.GetType(jsTypeOrName.As <string>(), true));
     }
     return(JsImplType._TypeOf(jsTypeOrName.As <JsType>()));
 }
Beispiel #3
0
 private static JsImplType Typeof(object jsTypeOrName)
 {
     if (jsTypeOrName == null)
     {
         throw new JsError("Unknown type.").As <Exception>();
     }
     if (JsTypeOf(jsTypeOrName) == JavaScript.JsTypes.function)
     {
         jsTypeOrName = JsTypeHelper.GetType(jsTypeOrName);
     }
     if (JsTypeOf(jsTypeOrName) == JavaScript.JsTypes.@string)
     {
         return(JsImplType.GetType(jsTypeOrName.As <string>(), true));
     }
     return(JsImplType._TypeOf(jsTypeOrName.As <JsType>()));
 }
Beispiel #4
0
 private void AddCustomAttributes(List <object> list, JsImplType attributeType, bool inherit)
 {
     VerifyCustomAttributes();
     if (_CustomAttributes != null)
     {
         for (var i = 0; i < _CustomAttributes.length; i++)
         {
             var att = _CustomAttributes[i];
             if (attributeType.IsInstanceOfType(att))
             {
                 list.Add(att);
             }
         }
     }
     if (inherit)
     {
         var bm = GetBaseMember();
         if (bm != null)
         {
             bm.As <JsImplMemberInfo>().AddCustomAttributes(list, attributeType, inherit);
         }
     }
 }