本文整理汇总了C#中HeapIndexToken类的典型用法代码示例。如果您正苦于以下问题:C# HeapIndexToken类的具体用法?C# HeapIndexToken怎么用?C# HeapIndexToken使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HeapIndexToken类属于命名空间,在下文中一共展示了HeapIndexToken类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenericParamRow
/// <summary>
/// Initializes a new instance of the <see cref="GenericParamRow"/> struct.
/// </summary>
/// <param name="number">The number.</param>
/// <param name="flags">The flags.</param>
/// <param name="owner">The owner table idx.</param>
/// <param name="nameStringIdx">The name string idx.</param>
public GenericParamRow(ushort number, GenericParameterAttributes flags, Token owner, HeapIndexToken nameStringIdx)
{
this.number = number;
this.flags = flags;
this.owner = owner;
this.nameStringIdx = nameStringIdx;
}
示例2: RuntimeAttribute
/// <summary>
/// Initializes a new instance of the <see cref="RuntimeAttribute"/> class.
/// </summary>
/// <param name="typeModule">The type module.</param>
/// <param name="ctor">The ctor.</param>
/// <param name="ctorMethod">The ctor method.</param>
/// <param name="blobIndex">Index of the blob.</param>
public RuntimeAttribute(ITypeModule typeModule, Token ctor, RuntimeMethod ctorMethod, HeapIndexToken blobIndex)
{
this.typeModule = typeModule;
this.ctorMethod = ctorMethod;
this.ctor = ctor;
this.blobIndex = blobIndex;
}
示例3: ReadString
/// <summary>
/// Retrieves the string at the requested offset.
/// </summary>
/// <param name="token">The offset into the heap, where the string starts.</param>
/// <returns>The string at the given offset.</returns>
public string ReadString(HeapIndexToken token)
{
Debug.Assert((HeapIndexToken.TableMask & token) == HeapIndexToken.UserString);
if ((HeapIndexToken.TableMask & token) != HeapIndexToken.UserString)
throw new ArgumentException(@"Invalid token value.", @"token");
int offset = (int)(token & HeapIndexToken.RowIndexMask);
// Argument checks
if (0 == offset)
{
token += 1;
return String.Empty;
}
// Validate the offset & calculate the real offset
int realOffset = ValidateOffset(offset);
int length = CalculatePrefixLength(ref realOffset);
Debug.Assert(1 == (length & 1), @"Invalid string length read from Metadata - corrupt string?");
if (0 == length)
return String.Empty;
byte[] buffer = this.Metadata;
return Encoding.Unicode.GetString(buffer, realOffset, length - 1);
}
示例4: CheckName
protected int CheckName(HeapIndexToken nameIndex)
{
if (nameIndex == 0)
{
return 1;
}
else
{
if (!IsValidStringIndex(nameIndex))
{
return 2;
}
else
{
string name = metadata.ReadString(nameIndex);
if (string.IsNullOrEmpty(name))
{
return 3;
}
}
}
return 0;
}
示例5: GenericParamRow
/// <summary>
/// Initializes a new instance of the <see cref="GenericParamRow" /> struct.
/// </summary>
/// <param name="number">The number.</param>
/// <param name="flags">The flags.</param>
/// <param name="owner">The owner.</param>
/// <param name="nameString">The name string.</param>
public GenericParamRow(ushort number, GenericParameterAttributes flags, Token owner, HeapIndexToken nameString)
{
Number = number;
Flags = flags;
Owner = owner;
NameString = nameString;
}
示例6: RuntimeParameter
/// <summary>
/// Initializes a new instance of the <see cref="RuntimeParameter"/> class.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="position">The position.</param>
/// <param name="attributes">The attributes.</param>
public RuntimeParameter(string name, int position, ParameterAttributes attributes)
{
this.token = (HeapIndexToken)0;
this.attributes = attributes;
this.name = name;
this.position = position;
}
示例7: ManifestResourceRow
/// <summary>
/// Initializes a new instance of the <see cref="ManifestResourceRow" /> struct.
/// </summary>
/// <param name="offset">The offset.</param>
/// <param name="flags">The flags.</param>
/// <param name="nameString">Index of the name string.</param>
/// <param name="implementation">The implementation.</param>
public ManifestResourceRow(uint offset, ManifestResourceAttributes flags, HeapIndexToken nameString,
Token implementation)
{
Offset = offset;
Flags = flags;
NameString = nameString;
Implementation = implementation;
}
示例8: ImplMapRow
/// <summary>
/// Initializes a new instance of the <see cref="ImplMapRow" /> struct.
/// </summary>
/// <param name="mappingFlags">The mapping flags.</param>
/// <param name="memberForwarded">The member forwarded table.</param>
/// <param name="importNameString">The import name string.</param>
/// <param name="importScopeTable">The import scope table.</param>
public ImplMapRow(PInvokeAttributes mappingFlags, Token memberForwarded,
HeapIndexToken importNameString, Token importScopeTable)
{
MappingFlags = mappingFlags;
MemberForwarded = memberForwarded;
ImportNameString = importNameString;
ImportScopeTable = importScopeTable;
}
示例9: ManifestResourceRow
/// <summary>
/// Initializes a new instance of the <see cref="ManifestResourceRow"/> struct.
/// </summary>
/// <param name="offset">The offset.</param>
/// <param name="flags">The flags.</param>
/// <param name="nameStringIndex">Index of the name string.</param>
/// <param name="implementation">The implementation table idx.</param>
public ManifestResourceRow(uint offset, ManifestResourceAttributes flags, HeapIndexToken nameStringIndex,
Token implementation)
{
_offset = offset;
_flags = flags;
_nameStringIdx = nameStringIndex;
_implementation = implementation;
}
示例10: ImplMapRow
/// <summary>
/// Initializes a new instance of the <see cref="ImplMapRow"/> struct.
/// </summary>
/// <param name="mappingFlags">The mapping flags.</param>
/// <param name="memberForwardedTableIdx">The member forwarded table idx.</param>
/// <param name="importNameStringIdx">The import name string idx.</param>
/// <param name="importScopeTableIdx">The import scope table idx.</param>
public ImplMapRow(PInvokeAttributes mappingFlags, Token memberForwardedTableIdx,
HeapIndexToken importNameStringIdx, Token importScopeTableIdx)
{
_mappingFlags = mappingFlags;
_memberForwardedTableIdx = memberForwardedTableIdx;
_importNameStringIdx = importNameStringIdx;
_importScopeTableIdx = importScopeTableIdx;
}
示例11: ExportedTypeRow
/// <summary>
/// Initializes a new instance of the <see cref="ExportedTypeRow"/> struct.
/// </summary>
/// <param name="flags">The flags.</param>
/// <param name="typeDef">The type def.</param>
/// <param name="typeName">Name of the type.</param>
/// <param name="typeNamespace">The type namespace.</param>
/// <param name="implementation">The implementation.</param>
public ExportedTypeRow(TypeAttributes flags, HeapIndexToken typeDef, HeapIndexToken typeName,
HeapIndexToken typeNamespace, Token implementation)
{
Flags = flags;
TypeDef = typeDef;
TypeName = typeName;
TypeNamespace = typeNamespace;
Implementation = implementation;
}
示例12: TypeDefRow
/// <summary>
/// Initializes a new instance of the <see cref="TypeDefRow"/> struct.
/// </summary>
/// <param name="flags">The flags.</param>
/// <param name="typeNameIdx">The type name idx.</param>
/// <param name="typeNamespaceIdx">The type namespace idx.</param>
/// <param name="extends">The extends.</param>
/// <param name="fieldList">The field list.</param>
/// <param name="methodList">The method list.</param>
public TypeDefRow(TypeAttributes flags, HeapIndexToken typeNameIdx, HeapIndexToken typeNamespaceIdx,
Token extends, Token fieldList, Token methodList)
{
this.flags = flags;
this.typeNameIdx = typeNameIdx;
this.typeNamespaceIdx = typeNamespaceIdx;
this.extends = extends;
this.fieldList = fieldList;
this.methodList = methodList;
}
示例13: MethodDefRow
/// <summary>
/// Initializes a new instance of the <see cref="MethodDefRow"/> struct.
/// </summary>
/// <param name="rva">The rva.</param>
/// <param name="implFlags">The impl flags.</param>
/// <param name="flags">The flags.</param>
/// <param name="paramList">The param list.</param>
public MethodDefRow(uint rva, MethodImplAttributes implFlags, MethodAttributes flags, HeapIndexToken nameString,
HeapIndexToken signatureBlob, Token paramList)
{
Rva = rva;
ImplFlags = implFlags;
Flags = flags;
NameString = nameString;
SignatureBlob = signatureBlob;
ParamList = paramList;
}
示例14: TypeDefRow
/// <summary>
/// Initializes a new instance of the <see cref="TypeDefRow" /> struct.
/// </summary>
/// <param name="flags">The flags.</param>
/// <param name="typeName">Name of the type.</param>
/// <param name="typeNamespace">The type namespace.</param>
/// <param name="extends">The extends.</param>
/// <param name="fieldList">The field list.</param>
/// <param name="methodList">The method list.</param>
public TypeDefRow(TypeAttributes flags, HeapIndexToken typeName, HeapIndexToken typeNamespace,
Token extends, Token fieldList, Token methodList)
{
Flags = flags;
TypeName = typeName;
TypeNamespace = typeNamespace;
Extends = extends;
FieldList = fieldList;
MethodList = methodList;
}
示例15: MethodDefRow
/// <summary>
/// Initializes a new instance of the <see cref="MethodDefRow"/> struct.
/// </summary>
/// <param name="rva">The rva.</param>
/// <param name="implFlags">The impl flags.</param>
/// <param name="flags">The flags.</param>
/// <param name="nameStringIdx">The name string idx.</param>
/// <param name="signatureBlobIdx">The signature BLOB idx.</param>
/// <param name="paramList">The param list.</param>
public MethodDefRow(uint rva, MethodImplAttributes implFlags, MethodAttributes flags, HeapIndexToken nameStringIdx,
HeapIndexToken signatureBlobIdx, Token paramList)
{
this._rva = rva;
this._implFlags = implFlags;
this._flags = flags;
this._nameStringIdx = nameStringIdx;
this._signatureBlobIdx = signatureBlobIdx;
this._paramList = paramList;
}