当前位置: 首页>>代码示例>>C#>>正文


C# ObjectWriter.WriteInt64方法代码示例

本文整理汇总了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());
        }
开发者ID:jkotas,项目名称:roslyn,代码行数:20,代码来源:Serializer_Asset.cs

示例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;
            }
        }
开发者ID:natidea,项目名称:roslyn,代码行数:37,代码来源:AbstractReferenceSerializationService.cs

示例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);
        }
开发者ID:Rickinio,项目名称:roslyn,代码行数:20,代码来源:DiagnosticResultSerializer.cs


注:本文中的Roslyn.Utilities.ObjectWriter.WriteInt64方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。