本文整理汇总了C#中Roslyn.Utilities.ObjectReader.ReadInt64方法的典型用法代码示例。如果您正苦于以下问题:C# ObjectReader.ReadInt64方法的具体用法?C# ObjectReader.ReadInt64怎么用?C# ObjectReader.ReadInt64使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Roslyn.Utilities.ObjectReader
的用法示例。
在下文中一共展示了ObjectReader.ReadInt64方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeserializeSourceText
private SourceText DeserializeSourceText(ObjectReader reader, CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
// REVIEW: why IDE services doesnt care about checksumAlgorithm?
var checksumAlgorithm = (SourceHashAlgorithm)reader.ReadInt32();
var webName = reader.ReadString();
var encoding = webName == null ? null : Encoding.GetEncoding(webName);
var kind = (SerializationKinds)reader.ReadInt32();
if (kind == SerializationKinds.MemoryMapFile)
{
var name = reader.ReadString();
var size = reader.ReadInt64();
var tempService = _workspaceServices.GetService<ITemporaryStorageService>() as ITemporaryStorageService2;
var storage = tempService.AttachTemporaryTextStorage(name, size, encoding, cancellationToken);
return storage.ReadText(cancellationToken);
}
// TODO: should include version info here as well?
var textService = _workspaceServices.GetService<ITextFactoryService>();
using (var textReader = new StringReader(reader.ReadString()))
{
return textService.CreateText(textReader, encoding, cancellationToken);
}
}
示例2: GetTemporaryStorage
private void GetTemporaryStorage(
ObjectReader reader, SerializationKinds kind, out ITemporaryStreamStorage storage, out long length, CancellationToken cancellationToken)
{
if (kind == SerializationKinds.Bits)
{
storage = _storageService.CreateTemporaryStreamStorage(cancellationToken);
using (var stream = SerializableBytes.CreateWritableStream())
{
CopyByteArrayToStream(reader, stream, cancellationToken);
length = stream.Length;
stream.Position = 0;
storage.WriteStream(stream, cancellationToken);
}
return;
}
if (kind == SerializationKinds.MemoryMapFile)
{
var service2 = _storageService as ITemporaryStorageService2;
Contract.ThrowIfNull(service2);
var name = reader.ReadString();
var size = reader.ReadInt64();
storage = service2.AttachTemporaryStreamStorage(name, size, cancellationToken);
length = size;
return;
}
throw ExceptionUtilities.UnexpectedValue(kind);
}
示例3: Deserialize
private static AnalyzerTelemetryInfo Deserialize(ObjectReader reader, CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
var compilationStartActionsCount = reader.ReadInt32();
var compilationEndActionsCount = reader.ReadInt32();
var compilationActionsCount = reader.ReadInt32();
var syntaxTreeActionsCount = reader.ReadInt32();
var semanticModelActionsCount = reader.ReadInt32();
var symbolActionsCount = reader.ReadInt32();
var syntaxNodeActionsCount = reader.ReadInt32();
var codeBlockStartActionsCount = reader.ReadInt32();
var codeBlockEndActionsCount = reader.ReadInt32();
var codeBlockActionsCount = reader.ReadInt32();
var operationActionsCount = reader.ReadInt32();
var operationBlockActionsCount = reader.ReadInt32();
var operationBlockStartActionsCount = reader.ReadInt32();
var operationBlockEndActionsCount = reader.ReadInt32();
var executionTime = new TimeSpan(reader.ReadInt64());
return new AnalyzerTelemetryInfo()
{
CompilationStartActionsCount = compilationStartActionsCount,
CompilationEndActionsCount = compilationEndActionsCount,
CompilationActionsCount = compilationActionsCount,
SyntaxTreeActionsCount = syntaxTreeActionsCount,
SemanticModelActionsCount = semanticModelActionsCount,
SymbolActionsCount = symbolActionsCount,
SyntaxNodeActionsCount = syntaxNodeActionsCount,
CodeBlockStartActionsCount = codeBlockStartActionsCount,
CodeBlockEndActionsCount = codeBlockEndActionsCount,
CodeBlockActionsCount = codeBlockActionsCount,
OperationActionsCount = operationActionsCount,
OperationBlockStartActionsCount = operationBlockStartActionsCount,
OperationBlockEndActionsCount = operationBlockEndActionsCount,
OperationBlockActionsCount = operationBlockActionsCount,
ExecutionTime = executionTime
};
}