本文整理汇总了C#中RecordReader.Seek方法的典型用法代码示例。如果您正苦于以下问题:C# RecordReader.Seek方法的具体用法?C# RecordReader.Seek怎么用?C# RecordReader.Seek使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RecordReader
的用法示例。
在下文中一共展示了RecordReader.Seek方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadMetaData
public override void ReadMetaData(RecordReader reader)
{
if (Signature == "XXXX")
{
// Segment length is always 4 which not interesting so skip 2 bytes
reader.Seek(2);
// Read lenght of the next segment
uint nextSegmentLength = reader.ReadUInt32();
// Load the actual signature (segment after XXXX)
Signature = reader.ReadStringFixedLength(4);
// Length is ZERO so skip 2 bytes and use value from the previous segment
reader.Seek(2);
Length = nextSegmentLength;
}
else
{
Length = reader.ReadUInt16();
}
}
示例2: ReadField
internal override void ReadField(RecordReader reader)
{
// Read flags and skip 3 bytes
Flags = (ConditionFlags)reader.ReadByte();
reader.Seek(3);
// Read either global variable reference or float
if (Flags.HasFlag(ConditionFlags.UseGlobal))
Operand.GlobalVariable = reader.ReadReference(FormKindSet.GlobOnly);
else
Operand.FloatValue = reader.ReadSingle();
// Read function code and skip 2 bytes
Function = (Function)reader.ReadUInt16();
reader.Seek(2);
// Warn if unknown function - no enum value is defined for it
if (!Enum.IsDefined(typeof(Function), Function))
Log.Warning("Function '{0}' was not recorgnised and any of parameter references may have may get scrambled.", Function);
// Find function signature
var signature = SignatureProvider.Default.GetSignature(Function);
// Read function params
// References must be read with ReadReference function
if (signature[0].IsReference)
Params.UInt32_0 = reader.ReadReference(signature[0].Reference);
else
Params.Int32_0 = reader.ReadInt32();
if (signature[1].IsReference)
Params.UInt32_1 = reader.ReadReference(signature[1].Reference);
else
Params.Int32_1 = reader.ReadInt32();
Target = (FunctionTarget)reader.ReadUInt32();
TargetReference = reader.ReadReference(FormKindSet.Any);
// Third parameter
IntParam3 = reader.ReadInt32();
}