本文整理汇总了C#中System.Reflection.Emit.TypeBuilder.GetModuleBuilder方法的典型用法代码示例。如果您正苦于以下问题:C# TypeBuilder.GetModuleBuilder方法的具体用法?C# TypeBuilder.GetModuleBuilder怎么用?C# TypeBuilder.GetModuleBuilder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Reflection.Emit.TypeBuilder
的用法示例。
在下文中一共展示了TypeBuilder.GetModuleBuilder方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FieldBuilder
[System.Security.SecurityCritical] // auto-generated
internal FieldBuilder(TypeBuilder typeBuilder, String fieldName, Type type,
Type[] requiredCustomModifiers, Type[] optionalCustomModifiers, FieldAttributes attributes)
{
if (fieldName == null)
throw new ArgumentNullException("fieldName");
if (fieldName.Length == 0)
throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), "fieldName");
if (fieldName[0] == '\0')
throw new ArgumentException(Environment.GetResourceString("Argument_IllegalName"), "fieldName");
if (type == null)
throw new ArgumentNullException("type");
if (type == typeof(void))
throw new ArgumentException(Environment.GetResourceString("Argument_BadFieldType"));
Contract.EndContractBlock();
m_fieldName = fieldName;
m_typeBuilder = typeBuilder;
m_fieldType = type;
m_Attributes = attributes & ~FieldAttributes.ReservedMask;
SignatureHelper sigHelp = SignatureHelper.GetFieldSigHelper(m_typeBuilder.Module);
sigHelp.AddArgument(type, requiredCustomModifiers, optionalCustomModifiers);
int sigLength;
byte[] signature = sigHelp.InternalGetSignature(out sigLength);
m_fieldTok = TypeBuilder.DefineField(m_typeBuilder.GetModuleBuilder().GetNativeHandle(),
typeBuilder.TypeToken.Token, fieldName, signature, sigLength, m_Attributes);
m_tkField = new FieldToken(m_fieldTok, type);
}
示例2: TypeBuilder
// ctor for generic type parameter
private TypeBuilder(string szName, int genParamPos, TypeBuilder declType)
{
Contract.Requires(declType != null);
m_DeclaringType = declType;
m_module =declType.GetModuleBuilder();
InitAsGenericParam(szName, genParamPos);
}
示例3: TypeBuilder
private TypeBuilder(string szName, int genParamPos, TypeBuilder declType)
{
this.m_DeclaringType = declType;
this.m_module = declType.GetModuleBuilder();
this.InitAsGenericParam(szName, genParamPos);
}