static private ParseAttributeArguments ( |
||
attributeBlob | ||
customAttributeCtorParameters | ||
customAttributeNamedParameters | ||
customAttributeModule | ||
return | void |
private CustomAttributeData(RuntimeModule scope, CustomAttributeRecord caRecord) { this.m_scope = scope; this.m_ctor = (RuntimeConstructorInfo)RuntimeType.GetMethodBase(scope, caRecord.tkCtor); ParameterInfo[] parametersNoCopy = this.m_ctor.GetParametersNoCopy(); this.m_ctorParams = new CustomAttributeCtorParameter[parametersNoCopy.Length]; for (int i = 0; i < parametersNoCopy.Length; i++) { this.m_ctorParams[i] = new CustomAttributeCtorParameter(CustomAttributeData.InitCustomAttributeType((RuntimeType)parametersNoCopy[i].ParameterType)); } FieldInfo[] fields = this.m_ctor.DeclaringType.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); PropertyInfo[] properties = this.m_ctor.DeclaringType.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); this.m_namedParams = new CustomAttributeNamedParameter[properties.Length + fields.Length]; for (int j = 0; j < fields.Length; j++) { this.m_namedParams[j] = new CustomAttributeNamedParameter(fields[j].Name, CustomAttributeEncoding.Field, CustomAttributeData.InitCustomAttributeType((RuntimeType)fields[j].FieldType)); } for (int k = 0; k < properties.Length; k++) { this.m_namedParams[k + fields.Length] = new CustomAttributeNamedParameter(properties[k].Name, CustomAttributeEncoding.Property, CustomAttributeData.InitCustomAttributeType((RuntimeType)properties[k].PropertyType)); } this.m_members = new MemberInfo[fields.Length + properties.Length]; fields.CopyTo(this.m_members, 0); properties.CopyTo(this.m_members, fields.Length); CustomAttributeEncodedArgument.ParseAttributeArguments(caRecord.blob, ref this.m_ctorParams, ref this.m_namedParams, this.m_scope); }
internal static void ParseAttributeArguments(ConstArray attributeBlob, ref CustomAttributeCtorParameter[] customAttributeCtorParameters, ref CustomAttributeNamedParameter[] customAttributeNamedParameters, RuntimeModule customAttributeModule) { if (customAttributeModule == null) { throw new ArgumentNullException("customAttributeModule"); } if (customAttributeCtorParameters.Length != 0 || customAttributeNamedParameters.Length != 0) { CustomAttributeEncodedArgument.ParseAttributeArguments(attributeBlob.Signature, attributeBlob.Length, ref customAttributeCtorParameters, ref customAttributeNamedParameters, (RuntimeAssembly)customAttributeModule.Assembly); } }