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); }
public object[] GetCustomAttributes(JsImplType attributeType, bool inherit) { var list = new List <object>(); AddCustomAttributes(list, attributeType, inherit); return(list.ToArray()); }
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); } }
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); } } }
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; }
public bool IsAssignableFrom(JsImplType type) { throw new NotImplementedException(); }
public object[] GetCustomAttributes(JsImplType attributeType, bool inherit) { var list = new List<object>(); AddCustomAttributes(list, attributeType, inherit); return list.ToArray(); }
public static object CreateInstance(JsImplType type, bool nonPublic) { throw new NotImplementedException(); }
public static object CreateInstance(JsImplType type, object[] args, object[] activationAttributes) { throw new NotImplementedException(); }
public static object CreateInstance(JsImplType type, params object[] args) { throw new NotImplementedException(); }
public static object CreateInstance(JsImplType type, BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture, object[] activationAttributes) { throw new NotImplementedException(); }
public static object CreateInstance(JsImplType type) { return(JsCompiler.NewByFunc(type._JsType.ctor)); }