public void AddRange(GenericParameterCollection value) { for (int i = 0; i < value.Count; i++) { List.Add(value[i]); } }
public static Collection <GenericParameter> GetGenericParameters( IGenericParameterProvider self, ref Collection <GenericParameter> collection, ModuleDefinition module) { return(Mixin.HasImage(module) ? module.Read(ref collection, self, (provider, reader) => reader.ReadGenericParameters(provider)) : collection = new GenericParameterCollection(self)); }
public static Collection<GenericParameter> GetGenericParameters ( this IGenericParameterProvider self, ref Collection<GenericParameter> collection, ModuleDefinition module) { return module.HasImage () ? module.Read (ref collection, self, (provider, reader) => reader.ReadGenericParameters (provider)) : collection = new GenericParameterCollection (self); }
public static Collection <GenericParameter> GetGenericParameters( this IGenericParameterProvider self, /*Telerik Authorship*/ ref Collection <GenericParameter> collection, ModuleDefinition module) { /*Telerik Authorship*/ return(module.HasImage() ? module.Read(ref collection, self, (provider, reader) => reader.ReadGenericParameters(provider)) : collection = new GenericParameterCollection(self)); }
public static Collection <GenericParameter> GetGenericParameters(this IGenericParameterProvider self, ref Collection <GenericParameter> collection, ModuleDefinition module) { if (!module.HasImage()) { Collection <GenericParameter> collection2; collection = collection2 = new GenericParameterCollection(self); return(collection2); } return(module.Read <IGenericParameterProvider, Collection <GenericParameter> >(ref collection, self, (provider, reader) => reader.ReadGenericParameters(provider))); }
public override void VisitGenericParameterCollection(GenericParameterCollection genparams) { }
public virtual void VisitGenericParameterCollection(GenericParameterCollection genparams) { }
public override void VisitGenericParameterCollection(GenericParameterCollection parameters) { if (parameters.Count == 0) return; foreach (GenericParameter gp in parameters) m_genericParamStack.Add (gp); }
public virtual void VisitGenericParameterCollection(GenericParameterCollection genparams) { foreach (GenericParameter param in genparams) { VisitGenericParameter(param); } }
public void AddRange(GenericParameterCollection value) { for (int i = 0; i < value.Count; i++) List.Add(value[i]); }
private void InitializeGenericParameters(DefineGenericParametersDelegate defineGenericParameters, GenericParameterCollection genericParameters) { if (genericParameters.Count == 0) return; string[] names = CollectionUtils.ConvertAllToArray<GenericParameter, string>(genericParameters, delegate(GenericParameter genericParameter) { return genericParameter.Name; }); GenericTypeParameterBuilder[] genericTypeParameterBuilders = defineGenericParameters(names); for (int i = 0; i < genericParameters.Count; i++) { GenericTypeParameterBuilder genericTypeParameterBuilder = genericTypeParameterBuilders[i]; GenericParameter genericParameter = genericParameters[i]; genericTypeParameterBuilder.SetGenericParameterAttributes( (System.Reflection.GenericParameterAttributes) genericParameter.Attributes); if (genericParameter.Constraints.Count != 0) { Type classConstraint = null; List<Type> interfaceConstraints = new List<Type>(); foreach (TypeReference typeReference in genericParameter.Constraints) { Type type = ResolveType(typeReference); if (type.IsInterface) interfaceConstraints.Add(type); else classConstraint = type; } if (classConstraint != null) genericTypeParameterBuilder.SetBaseTypeConstraint(classConstraint); if (interfaceConstraints.Count != 0) genericTypeParameterBuilder.SetInterfaceConstraints(interfaceConstraints.ToArray()); } } metadataPass.Add(delegate { for (int i = 0; i < genericParameters.Count; i++) { InitializeCustomAttributes(genericTypeParameterBuilders[i].SetCustomAttribute, genericParameters[i].CustomAttributes); } }); }
public static List<string> ExamineGenericParameters(GenericParameterCollection genericParameters, TypeReference declaringType, out List<MyGenericParameterInfo> myGenericParameters, bool returnAllGenericParametersNames) { Debug.Assert(genericParameters != null && genericParameters.Count > 0, "Impossible!"); myGenericParameters = new List<MyGenericParameterInfo>(); int startIndex = declaringType != null ? declaringType.GenericParameters.Count : 0; for (int i = startIndex; i < genericParameters.Count; i++) { myGenericParameters.Add(new MyGenericParameterInfo(genericParameters[i])); } if (returnAllGenericParametersNames) { List<string> allGenericParametersNames = null; if (genericParameters.Count > 0) { allGenericParametersNames = new List<string>(); for (int i = 0; i < genericParameters.Count; i++) { allGenericParametersNames.Add(genericParameters[i].Name); } } return allGenericParametersNames; } return null; }
public static List<string> ExamineGenericParameters(GenericParameterCollection genericParameters, TypeReference declaringType, out List<MyGenericParameterInfo> myGenericParameters) { return ExamineGenericParameters(genericParameters, declaringType, out myGenericParameters, false); }
private void Visit(GenericParameterCollection genericParameterCollection) { foreach (GenericParameter parameter in genericParameterCollection) { foreach (TypeReference reference in parameter.Constraints) { _modelCreator.UseType(reference.ToTypeKey()); } _modelCreator.UseType(parameter.ToTypeKey()); } }