本文整理汇总了C#中Roslyn.Utilities.ObjectWriter.WriteInt32方法的典型用法代码示例。如果您正苦于以下问题:C# ObjectWriter.WriteInt32方法的具体用法?C# ObjectWriter.WriteInt32怎么用?C# ObjectWriter.WriteInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Roslyn.Utilities.ObjectWriter
的用法示例。
在下文中一共展示了ObjectWriter.WriteInt32方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteTo
internal void WriteTo(ObjectWriter writer)
{
writer.WriteInt32(WordSpan.Start);
writer.WriteInt32(WordSpan.Length);
writer.WriteInt32(EdgeCount);
writer.WriteInt32(FirstEdgeIndex);
}
示例2: WriteTo
internal void WriteTo(ObjectWriter writer)
{
writer.WriteString(Name);
writer.WriteString(ContainerDisplayName);
writer.WriteString(FullyQualifiedContainerName);
writer.WriteByte((byte)Kind);
writer.WriteInt32(Span.Start);
writer.WriteInt32(Span.Length);
writer.WriteUInt16(ParameterCount);
writer.WriteUInt16(TypeParameterCount);
}
示例3: WriteBitArray
private static void WriteBitArray(ObjectWriter writer, BitArray bitArray)
{
// Our serialization format doesn't round-trip bit arrays of non-byte lengths
Contract.ThrowIfTrue(bitArray.Length % 8 != 0);
writer.WriteInt32(bitArray.Length / 8);
// This will hold the byte that we will write out after we process every 8 bits. This is
// LSB, so we push bits into it from the MSB.
byte b = 0;
for (var i = 0; i < bitArray.Length; i++)
{
if (bitArray[i])
{
b = (byte)(0x80 | b >> 1);
}
else
{
b >>= 1;
}
if ((i + 1) % 8 == 0)
{
// End of a byte, write out the byte
writer.WriteByte(b);
}
}
}
示例4: SerializeChecksumObjectWithChildrenAsync
public async Task SerializeChecksumObjectWithChildrenAsync(ChecksumObjectWithChildren checksumObject, ObjectWriter writer, CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
writer.WriteString(checksumObject.Kind);
checksumObject.Checksum.WriteTo(writer);
writer.WriteInt32(checksumObject.Children.Length);
foreach (var child in checksumObject.Children)
{
var checksum = child as Checksum;
if (checksum != null)
{
writer.WriteByte(ChecksumKind);
checksum.WriteTo(writer);
continue;
}
var checksumCollection = child as ChecksumCollection;
if (checksumCollection != null)
{
writer.WriteByte(ChecksumCollectionKind);
await SerializeChecksumObjectWithChildrenAsync(checksumCollection, writer, cancellationToken).ConfigureAwait(false);
continue;
}
throw ExceptionUtilities.UnexpectedValue(child);
}
}
示例5: SerializeChecksumWithChildren
public void SerializeChecksumWithChildren(ChecksumWithChildren checksums, ObjectWriter writer, CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
var kind = checksums.GetWellKnownSynchronizationKind();
writer.WriteString(kind);
checksums.Checksum.WriteTo(writer);
writer.WriteInt32(checksums.Children.Count);
foreach (var child in checksums.Children)
{
var checksum = child as Checksum;
if (checksum != null)
{
writer.WriteByte(ChecksumKind);
checksum.WriteTo(writer);
continue;
}
var checksumCollection = child as ChecksumCollection;
if (checksumCollection != null)
{
writer.WriteByte(ChecksumWithChildrenKind);
SerializeChecksumWithChildren(checksumCollection, writer, cancellationToken);
continue;
}
throw ExceptionUtilities.UnexpectedValue(child);
}
}
示例6: WriteTo
public void WriteTo(ObjectWriter writer)
{
writer.WriteString(SerializationFormat);
writer.WriteBoolean(_isCaseSensitive);
writer.WriteInt32(_hashFunctionCount);
_bitArray.WriteTo(writer);
}
示例7: WriteTo
public override void WriteTo(ParseOptions options, ObjectWriter writer, CancellationToken cancellationToken)
{
WriteParseOptionsTo(options, writer, cancellationToken);
var csharpOptions = (CSharpParseOptions)options;
writer.WriteInt32((int)csharpOptions.LanguageVersion);
writer.WriteValue(options.PreprocessorSymbolNames.ToArray());
}
示例8: WriteTo
public override void WriteTo(ObjectWriter writer)
{
writer.WriteInt32(DeclaredSymbolInfos.Count());
foreach (var declaredSymbolInfo in DeclaredSymbolInfos)
{
declaredSymbolInfo.WriteTo(writer);
}
}
示例9: WriteTo
public void WriteTo(ObjectWriter writer)
{
writer.WriteInt32(DeclaredSymbolInfos.Length);
foreach (var declaredSymbolInfo in DeclaredSymbolInfos)
{
declaredSymbolInfo.WriteTo(writer);
}
}
示例10: WriteTo
internal void WriteTo(ObjectWriter writer)
{
writer.WriteInt32(_concatenatedLowerCaseWords.Length);
foreach (var c in _concatenatedLowerCaseWords)
{
writer.WriteChar(c);
}
writer.WriteInt32(this._nodes.Length);
foreach (var node in _nodes)
{
node.WriteTo(writer);
}
writer.WriteInt32(this._edges.Length);
foreach (var edge in _edges)
{
edge.WriteTo(writer);
}
}
示例11: 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());
}
示例12: SerializeDocumentSnapshotInfo
public void SerializeDocumentSnapshotInfo(DocumentChecksumObjectInfo info, ObjectWriter writer, CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
SerializeDocumentId(info.Id, writer, cancellationToken);
writer.WriteString(info.Name);
writer.WriteValue(info.Folders.ToArray());
writer.WriteInt32((int)info.SourceCodeKind);
writer.WriteString(info.FilePath);
writer.WriteBoolean(info.IsGenerated);
}
示例13: WriteTo
internal override void WriteTo(ObjectWriter writer)
{
base.WriteTo(writer);
// PERF: Write the array out manually.Profiling shows that this is cheaper than converting to
// an array in order to use writer.WriteValue.
writer.WriteInt32(this.children.Length);
for (var i = 0; i < this.children.Length; i++)
{
writer.WriteValue(this.children[i].Value);
}
}
示例14: WriteTo
public static void WriteTo(this BitArray bitArray, ObjectWriter writer)
{
// TODO : think about a way to use pool for byte array.
// BitArray will internally allocate another int array. probably need to drop BitArray usage.
var bytes = new byte[(bitArray.Length + 7) / 8];
bitArray.CopyTo(bytes, 0);
writer.WriteString(SerializationFormat);
writer.WriteInt32(bytes.Length);
for (var i = 0; i < bytes.Length; i++)
{
writer.WriteByte(bytes[i]);
}
}
示例15: WriteCompilationOptionsTo
protected void WriteCompilationOptionsTo(CompilationOptions options, ObjectWriter writer, CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
writer.WriteInt32((int)options.OutputKind);
writer.WriteBoolean(options.ReportSuppressedDiagnostics);
writer.WriteString(options.ModuleName);
writer.WriteString(options.MainTypeName);
writer.WriteString(options.ScriptClassName);
writer.WriteInt32((int)options.OptimizationLevel);
writer.WriteBoolean(options.CheckOverflow);
// REVIEW: is it okay this being not part of snapshot?
writer.WriteString(options.CryptoKeyContainer);
writer.WriteString(options.CryptoKeyFile);
writer.WriteValue(options.CryptoPublicKey.ToArray());
writer.WriteBoolean(options.DelaySign.HasValue);
if (options.DelaySign.HasValue)
{
writer.WriteBoolean(options.DelaySign.Value);
}
writer.WriteInt32((int)options.Platform);
writer.WriteInt32((int)options.GeneralDiagnosticOption);
writer.WriteInt32(options.WarningLevel);
// REVIEW: I don't think there is a guarantee on ordering of elements in the immutable dictionary.
// unfortunately, we need to sort them to make it deterministic
writer.WriteInt32(options.SpecificDiagnosticOptions.Count);
foreach (var kv in options.SpecificDiagnosticOptions.OrderBy(o => o.Key))
{
writer.WriteString(kv.Key);
writer.WriteInt32((int)kv.Value);
}
writer.WriteBoolean(options.ConcurrentBuild);
writer.WriteBoolean(options.Deterministic);
writer.WriteBoolean(options.PublicSign);
// REVIEW: What should I do with these. we probably need to implement either out own one
// or somehow share these as service....
//
// XmlReferenceResolver xmlReferenceResolver
// SourceReferenceResolver sourceReferenceResolver
// MetadataReferenceResolver metadataReferenceResolver
// AssemblyIdentityComparer assemblyIdentityComparer
// StrongNameProvider strongNameProvider
}