IKVM.Reflection.Type.GetGenericParameterConstraints C# (CSharp) Метод

GetGenericParameterConstraints() публичный Метод

public GetGenericParameterConstraints ( ) : Type[]
Результат Type[]
        public virtual Type[] GetGenericParameterConstraints()
        {
            throw new InvalidOperationException();
        }

Usage Example

Пример #1
0
		void ImportTypeParameterTypeConstraints (TypeParameterSpec spec, MetaType type)
		{
			var constraints = type.GetGenericParameterConstraints ();
			List<TypeSpec> tparams = null;
			foreach (var ct in constraints) {
				if (ct.IsGenericParameter) {
					if (tparams == null)
						tparams = new List<TypeSpec> ();

					tparams.Add (CreateType (ct));
					continue;
				}

				if (!IsMissingType (ct) && ct.IsClass) {
					spec.BaseType = CreateType (ct);
					continue;
				}

				spec.AddInterface (CreateType (ct));
			}

			if (spec.BaseType == null)
				spec.BaseType = module.Compiler.BuiltinTypes.Object;

			if (tparams != null)
				spec.TypeArguments = tparams.ToArray ();
		}
All Usage Examples Of IKVM.Reflection.Type::GetGenericParameterConstraints