本文整理汇总了C#中Roslyn.Utilities.ObjectWriter.WriteInt64方法的典型用法代码示例。如果您正苦于以下问题:C# ObjectWriter.WriteInt64方法的具体用法?C# ObjectWriter.WriteInt64怎么用?C# ObjectWriter.WriteInt64使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Roslyn.Utilities.ObjectWriter
的用法示例。
在下文中一共展示了ObjectWriter.WriteInt64方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SerializeSourceText
public void SerializeSourceText(ITemporaryStorageWithName storage, SourceText text, ObjectWriter writer, CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
writer.WriteInt32((int)text.ChecksumAlgorithm);
writer.WriteString(text.Encoding?.WebName);
// TODO: refactor this part in its own abstraction (Bits) that has multiple sub types
// rather than using enums
if (storage != null && storage.Name != null)
{
writer.WriteInt32((int)SerializationKinds.MemoryMapFile);
writer.WriteString(storage.Name);
writer.WriteInt64(storage.Size);
return;
}
writer.WriteInt32((int)SerializationKinds.Bits);
writer.WriteString(text.ToString());
}
示例2: TryWritePortableExecutableReferenceBackedByTemporaryStorageTo
private bool TryWritePortableExecutableReferenceBackedByTemporaryStorageTo(
ISupportTemporaryStorage reference, ObjectWriter writer, CancellationToken cancellationToken)
{
var storages = reference.GetStorages();
if (storages == null)
{
return false;
}
using (var pooled = Creator.CreateList<ValueTuple<string, long>>())
{
foreach (var storage in storages)
{
var storage2 = storage as ITemporaryStorageWithName;
if (storage2 == null)
{
return false;
}
pooled.Object.Add(ValueTuple.Create(storage2.Name, storage2.Size));
}
WritePortableExecutableReferenceHeaderTo((PortableExecutableReference)reference, SerializationKinds.MemoryMapFile, writer, cancellationToken);
writer.WriteInt32((int)MetadataImageKind.Assembly);
writer.WriteInt32(pooled.Object.Count);
foreach (var tuple in pooled.Object)
{
writer.WriteInt32((int)MetadataImageKind.Module);
writer.WriteString(tuple.Item1);
writer.WriteInt64(tuple.Item2);
}
return true;
}
}
示例3: Serialize
private static void Serialize(ObjectWriter writer, AnalyzerTelemetryInfo telemetryInfo, CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
writer.WriteInt32(telemetryInfo.CompilationStartActionsCount);
writer.WriteInt32(telemetryInfo.CompilationEndActionsCount);
writer.WriteInt32(telemetryInfo.CompilationActionsCount);
writer.WriteInt32(telemetryInfo.SyntaxTreeActionsCount);
writer.WriteInt32(telemetryInfo.SemanticModelActionsCount);
writer.WriteInt32(telemetryInfo.SymbolActionsCount);
writer.WriteInt32(telemetryInfo.SyntaxNodeActionsCount);
writer.WriteInt32(telemetryInfo.CodeBlockStartActionsCount);
writer.WriteInt32(telemetryInfo.CodeBlockEndActionsCount);
writer.WriteInt32(telemetryInfo.CodeBlockActionsCount);
writer.WriteInt32(telemetryInfo.OperationActionsCount);
writer.WriteInt32(telemetryInfo.OperationBlockActionsCount);
writer.WriteInt32(telemetryInfo.OperationBlockStartActionsCount);
writer.WriteInt32(telemetryInfo.OperationBlockEndActionsCount);
writer.WriteInt64(telemetryInfo.ExecutionTime.Ticks);
}