本文整理汇总了C#中IKVM.Reflection.Type.__GetCustomModifiers方法的典型用法代码示例。如果您正苦于以下问题:C# Type.__GetCustomModifiers方法的具体用法?C# Type.__GetCustomModifiers怎么用?C# Type.__GetCustomModifiers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IKVM.Reflection.Type
的用法示例。
在下文中一共展示了Type.__GetCustomModifiers方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteType
protected static void WriteType(ModuleBuilder module, ByteBuffer bb, Type type)
{
while (type.HasElementType)
{
byte sigElementType = type.SigElementType;
bb.Write(sigElementType);
if (sigElementType == ELEMENT_TYPE_ARRAY)
{
// LAMESPEC the Type production (23.2.12) doesn't include CustomMod* for arrays, but the verifier allows it and ildasm also supports it
WriteCustomModifiers(module, bb, type.__GetCustomModifiers());
WriteType(module, bb, type.GetElementType());
bb.WriteCompressedUInt(type.GetArrayRank());
int[] sizes = type.__GetArraySizes();
bb.WriteCompressedUInt(sizes.Length);
for (int i = 0; i < sizes.Length; i++)
{
bb.WriteCompressedUInt(sizes[i]);
}
int[] lobounds = type.__GetArrayLowerBounds();
bb.WriteCompressedUInt(lobounds.Length);
for (int i = 0; i < lobounds.Length; i++)
{
bb.WriteCompressedInt(lobounds[i]);
}
return;
}
WriteCustomModifiers(module, bb, type.__GetCustomModifiers());
type = type.GetElementType();
}
if (type.__IsBuiltIn)
{
bb.Write(type.SigElementType);
}
else if (type.IsGenericParameter)
{
bb.Write(type.SigElementType);
bb.WriteCompressedUInt(type.GenericParameterPosition);
}
else if (!type.__IsMissing && type.IsGenericType)
{
WriteGenericSignature(module, bb, type);
}
else if (type.__IsFunctionPointer)
{
bb.Write(ELEMENT_TYPE_FNPTR);
WriteStandAloneMethodSig(module, bb, type.__MethodSignature);
}
else
{
if (type.IsValueType)
{
bb.Write(ELEMENT_TYPE_VALUETYPE);
}
else
{
bb.Write(ELEMENT_TYPE_CLASS);
}
bb.WriteTypeDefOrRefEncoded(module.GetTypeToken(type).Token);
}
}
示例2: WriteType
protected static void WriteType(ModuleBuilder module, ByteBuffer bb, Type type)
{
while (type.HasElementType)
{
if (type.__IsVector)
{
bb.Write(ELEMENT_TYPE_SZARRAY);
}
else if (type.IsArray)
{
int rank = type.GetArrayRank();
bb.Write(ELEMENT_TYPE_ARRAY);
// LAMESPEC the Type production (23.2.12) doesn't include CustomMod* for arrays, but the verifier allows it and ildasm also supports it
WriteCustomModifiers(module, bb, type.__GetCustomModifiers());
WriteType(module, bb, type.GetElementType());
bb.WriteCompressedInt(rank);
int[] sizes = type.__GetArraySizes();
bb.WriteCompressedInt(sizes.Length);
for (int i = 0; i < sizes.Length; i++)
{
bb.WriteCompressedInt(sizes[i]);
}
int[] lobounds = type.__GetArrayLowerBounds();
bb.WriteCompressedInt(lobounds.Length);
for (int i = 0; i < lobounds.Length; i++)
{
bb.WriteCompressedInt(lobounds[i]);
}
return;
}
else if (type.IsByRef)
{
bb.Write(ELEMENT_TYPE_BYREF);
}
else if (type.IsPointer)
{
bb.Write(ELEMENT_TYPE_PTR);
}
WriteCustomModifiers(module, bb, type.__GetCustomModifiers());
type = type.GetElementType();
}
Universe u = module.universe;
if (type == u.System_Void)
{
bb.Write(ELEMENT_TYPE_VOID);
}
else if (type == u.System_Int32)
{
bb.Write(ELEMENT_TYPE_I4);
}
else if (type == u.System_Boolean)
{
bb.Write(ELEMENT_TYPE_BOOLEAN);
}
else if (type == u.System_String)
{
bb.Write(ELEMENT_TYPE_STRING);
}
else if (type == u.System_Char)
{
bb.Write(ELEMENT_TYPE_CHAR);
}
else if (type == u.System_SByte)
{
bb.Write(ELEMENT_TYPE_I1);
}
else if (type == u.System_Byte)
{
bb.Write(ELEMENT_TYPE_U1);
}
else if (type == u.System_Int16)
{
bb.Write(ELEMENT_TYPE_I2);
}
else if (type == u.System_UInt16)
{
bb.Write(ELEMENT_TYPE_U2);
}
else if (type == u.System_UInt32)
{
bb.Write(ELEMENT_TYPE_U4);
}
else if (type == u.System_Int64)
{
bb.Write(ELEMENT_TYPE_I8);
}
else if (type == u.System_UInt64)
{
bb.Write(ELEMENT_TYPE_U8);
}
else if (type == u.System_Single)
{
bb.Write(ELEMENT_TYPE_R4);
}
else if (type == u.System_Double)
{
bb.Write(ELEMENT_TYPE_R8);
}
else if (type == u.System_IntPtr)
{
//.........这里部分代码省略.........