本文整理汇总了C#中Internal.Metadata.NativeFormat.Handle类的典型用法代码示例。如果您正苦于以下问题:C# Handle类的具体用法?C# Handle怎么用?C# Handle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Handle类属于Internal.Metadata.NativeFormat命名空间,在下文中一共展示了Handle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Read
public static uint Read(this NativeReader reader, uint offset, out Handle handle)
{
uint rawValue;
offset = reader.DecodeUnsigned(offset, out rawValue);
handle = new Handle((HandleType)(byte)rawValue, (int)(rawValue >> 8));
return offset;
}
示例2: RuntimeFatMethodParameterInfo
private RuntimeFatMethodParameterInfo(MethodBase member, MethodHandle methodHandle, int position, ParameterHandle parameterHandle, MetadataReader reader, Handle typeHandle, TypeContext typeContext)
: base(member, position, reader, typeHandle, typeContext)
{
_methodHandle = methodHandle;
_parameterHandle = parameterHandle;
_parameter = parameterHandle.GetParameter(reader);
}
示例3: NativeFormatSignatureParser
// TODO
// bool _hasModifiers;
public NativeFormatSignatureParser(NativeFormatMetadataUnit metadataUnit, Handle signatureHandle, MetadataReader metadataReader)
{
_metadataUnit = metadataUnit;
_signatureHandle = signatureHandle;
_metadataReader = metadataReader;
// _hasModifiers = false;
}
示例4: RuntimeMethodParameterInfo
protected RuntimeMethodParameterInfo(MethodBase member, int position, MetadataReader reader, Handle typeHandle, TypeContext typeContext)
: base(member, position)
{
Reader = reader;
_typeHandle = typeHandle;
_typeContext = typeContext;
}
示例5: GetAttributeTypeAndConstructor
public static bool GetAttributeTypeAndConstructor(this MetadataReader metadataReader, CustomAttributeHandle attributeHandle,
out Handle attributeType, out Handle attributeCtor)
{
CustomAttribute attribute = metadataReader.GetCustomAttribute(attributeHandle);
attributeCtor = attribute.Constructor;
attributeType = attribute.GetAttributeTypeHandle(metadataReader);
return true;
}
示例6: GetAttributeTypeNamespaceAndName
public static bool GetAttributeTypeNamespaceAndName(this MetadataReader metadataReader, Handle attributeType,
out string namespaceString, out ConstantStringValueHandle nameHandle)
{
namespaceString = null;
nameHandle = default(ConstantStringValueHandle);
if (attributeType.HandleType == HandleType.TypeReference)
{
TypeReference typeRefRow = metadataReader.GetTypeReference(attributeType.ToTypeReferenceHandle(metadataReader));
HandleType handleType = typeRefRow.ParentNamespaceOrType.HandleType;
// Nested type?
if (handleType == HandleType.TypeReference || handleType == HandleType.TypeDefinition)
return false;
nameHandle = typeRefRow.TypeName;
namespaceString = metadataReader.GetNamespaceName(typeRefRow.ParentNamespaceOrType.ToNamespaceReferenceHandle(metadataReader));
return true;
}
else if (attributeType.HandleType == HandleType.TypeDefinition)
{
var def = metadataReader.GetTypeDefinition(attributeType.ToTypeDefinitionHandle(metadataReader));
// Nested type?
if (IsNested(def.Flags))
return false;
nameHandle = def.Name;
namespaceString = metadataReader.GetNamespaceName(def.NamespaceDefinition);
return true;
}
else
{
// unsupported metadata
return false;
}
}
示例7: ToTypeSpecificationHandle
} // ToTypeReferenceHandle
internal TypeSpecificationHandle ToTypeSpecificationHandle(Handle handle)
{
return new TypeSpecificationHandle(handle._value);
} // ToTypeSpecificationHandle
示例8: ToTypeReferenceHandle
} // ToTypeInstantiationSignatureHandle
internal TypeReferenceHandle ToTypeReferenceHandle(Handle handle)
{
return new TypeReferenceHandle(handle._value);
} // ToTypeReferenceHandle
示例9: ToTypeInstantiationSignatureHandle
} // ToTypeForwarderHandle
internal TypeInstantiationSignatureHandle ToTypeInstantiationSignatureHandle(Handle handle)
{
return new TypeInstantiationSignatureHandle(handle._value);
} // ToTypeInstantiationSignatureHandle
示例10: ToNamedArgumentHandle
} // ToMethodTypeVariableSignatureHandle
internal NamedArgumentHandle ToNamedArgumentHandle(Handle handle)
{
return new NamedArgumentHandle(handle._value);
} // ToNamedArgumentHandle
示例11: Read
} // Read
public static uint Read(this NativeReader reader, uint offset, out Handle[] values)
{
uint count;
offset = reader.DecodeUnsigned(offset, out count);
if (count == 0)
{
values = s_emptyHandleArray;
}
else
{
values = new Handle[count];
for (uint i = 0; i < count; ++i)
{
Handle tmp;
offset = reader.Read(offset, out tmp);
values[i] = tmp;
}
}
return offset;
} // Read
示例12: ToParameterHandle
} // ToNamespaceReferenceHandle
internal ParameterHandle ToParameterHandle(Handle handle)
{
return new ParameterHandle(handle._value);
} // ToParameterHandle
示例13: ToNamespaceDefinitionHandle
} // ToNamedArgumentHandle
internal NamespaceDefinitionHandle ToNamespaceDefinitionHandle(Handle handle)
{
return new NamespaceDefinitionHandle(handle._value);
} // ToNamespaceDefinitionHandle
示例14: ToSZArraySignatureHandle
} // ToReturnTypeSignatureHandle
internal SZArraySignatureHandle ToSZArraySignatureHandle(Handle handle)
{
return new SZArraySignatureHandle(handle._value);
} // ToSZArraySignatureHandle
示例15: ToReturnTypeSignatureHandle
} // ToQualifiedMethodHandle
internal ReturnTypeSignatureHandle ToReturnTypeSignatureHandle(Handle handle)
{
return new ReturnTypeSignatureHandle(handle._value);
} // ToReturnTypeSignatureHandle