Exemplo n.º 1
0
        JsImplType _MakeGenericType(JsExtendedArray typeArguments)
        {
            if (_MakeGenericTypeCache == null)
            {
                _MakeGenericTypeCache = new JsObject();
            }
            var key = "";

            for (var i = 0; i < typeArguments.length; i++)
            {
                var typeArg = typeArguments[i].As <JsImplType>();
                key += typeArg._Name;
            }
            var t = _MakeGenericTypeCache[key].As <JsImplType>();

            if (t == null)
            {
                t = new JsImplType(_JsType);
                _MakeGenericTypeCache[key] = t;
                t._Name = _Name;
                t._GenericTypeDefinition = this;
                t._TypeArguments         = typeArguments;
                t._Properties            = _Properties;
                t._PropertiesByName      = _PropertiesByName;
                t._Methods          = _Methods;
                t._MethodsByName    = _MethodsByName;
                t._DeclaringType    = _DeclaringType;
                t._CustomAttributes = _CustomAttributes;
            }
            return(t);
        }
Exemplo n.º 2
0
        public object[] GetCustomAttributes(JsImplType attributeType, bool inherit)
        {
            var list = new List <object>();

            AddCustomAttributes(list, attributeType, inherit);
            return(list.ToArray());
        }
Exemplo n.º 3
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.AddCustomAttributes(list, attributeType, inherit);
			}
		}
Exemplo n.º 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.AddCustomAttributes(list, attributeType, inherit);
         }
     }
 }
Exemplo n.º 5
0
 JsImplType _MakeGenericType(JsExtendedArray typeArguments)
 {
     if (_MakeGenericTypeCache == null)
         _MakeGenericTypeCache = new JsObject();
     var key = "";
     for (var i = 0; i < typeArguments.length; i++)
     {
         var typeArg = typeArguments[i].As<JsImplType>();
         key += typeArg._Name;
     }
     var t = _MakeGenericTypeCache[key].As<JsImplType>();
     if (t == null)
     {
         t = new JsImplType(_JsType);
         _MakeGenericTypeCache[key] = t;
         t._Name = _Name;
         t._GenericTypeDefinition = this;
         t._TypeArguments = typeArguments;
         t._Properties = _Properties;
         t._PropertiesByName = _PropertiesByName;
         t._Methods = _Methods;
         t._MethodsByName = _MethodsByName;
         t._DeclaringType = _DeclaringType;
         t._CustomAttributes = _CustomAttributes;
     }
     return t;
 }
Exemplo n.º 6
0
 public bool IsAssignableFrom(JsImplType type)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 7
0
		public object[] GetCustomAttributes(JsImplType attributeType, bool inherit)
		{
			var list = new List<object>();
			AddCustomAttributes(list, attributeType, inherit);
			return list.ToArray();
		}
Exemplo n.º 8
0
 public static object CreateInstance(JsImplType type, bool nonPublic)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 9
0
 public static object CreateInstance(JsImplType type, object[] args, object[] activationAttributes)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 10
0
 public static object CreateInstance(JsImplType type, params object[] args)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 11
0
 public static object CreateInstance(JsImplType type, BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture, object[] activationAttributes)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 12
0
 public static object CreateInstance(JsImplType type)
 {
     return(JsCompiler.NewByFunc(type._JsType.ctor));
 }
Exemplo n.º 13
0
 public bool IsAssignableFrom(JsImplType type)
 {
     throw new NotImplementedException();
 }