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


C# ObjectReader.ReadBoolean方法代码示例

本文整理汇总了C#中Roslyn.Utilities.ObjectReader.ReadBoolean方法的典型用法代码示例。如果您正苦于以下问题:C# ObjectReader.ReadBoolean方法的具体用法?C# ObjectReader.ReadBoolean怎么用?C# ObjectReader.ReadBoolean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Roslyn.Utilities.ObjectReader的用法示例。


在下文中一共展示了ObjectReader.ReadBoolean方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ReadFrom

        public static BloomFilter ReadFrom(ObjectReader reader)
        {
            var version = reader.ReadString();
            if (!string.Equals(version, SerializationFormat, StringComparison.Ordinal))
            {
                return null;
            }

            var isCaseSensitive = reader.ReadBoolean();
            int hashFunctionCount = reader.ReadInt32();
            var bitArray = ReadBitArray(reader);
            return new BloomFilter(bitArray, hashFunctionCount, isCaseSensitive);
        }
开发者ID:Rickinio,项目名称:roslyn,代码行数:13,代码来源:BloomFilter_Serialization.cs

示例2: ReadCompilationOptionsFrom

        public override CompilationOptions ReadCompilationOptionsFrom(ObjectReader reader, CancellationToken cancellationToken)
        {
            ReadCompilationOptionsFrom(
                reader,
                out var outputKind, out var reportSuppressedDiagnostics, out var moduleName, out var mainTypeName, out var scriptClassName,
                out var optimizationLevel, out var checkOverflow, out var cryptoKeyContainer, out var cryptoKeyFile, out var cryptoPublicKey,
                out var delaySign, out var platform, out var generalDiagnosticOption, out var warningLevel, out var specificDiagnosticOptions,
                out var concurrentBuild, out var deterministic, out var publicSign, out var xmlReferenceResolver, out var sourceReferenceResolver,
                out var metadataReferenceResolver, out var assemblyIdentityComparer, out var strongNameProvider, cancellationToken);

            var usings = reader.ReadArray<string>();
            var allowUnsafe = reader.ReadBoolean();

            return new CSharpCompilationOptions(
                outputKind, reportSuppressedDiagnostics, moduleName, mainTypeName, scriptClassName, usings, optimizationLevel, checkOverflow, allowUnsafe,
                cryptoKeyContainer, cryptoKeyFile, cryptoPublicKey, delaySign, platform, generalDiagnosticOption, warningLevel, specificDiagnosticOptions, concurrentBuild,
                deterministic, xmlReferenceResolver, sourceReferenceResolver, metadataReferenceResolver, assemblyIdentityComparer, strongNameProvider, publicSign);
        }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:18,代码来源:CSharpOptionsSerializationService.cs

示例3: ReadCompilationOptionsFrom

        public override CompilationOptions ReadCompilationOptionsFrom(ObjectReader reader, CancellationToken cancellationToken)
        {
            OutputKind outputKind;
            bool reportSuppressedDiagnostics;
            string moduleName;
            string mainTypeName;
            string scriptClassName;
            OptimizationLevel optimizationLevel;
            bool checkOverflow;
            string cryptoKeyContainer;
            string cryptoKeyFile;
            ImmutableArray<byte> cryptoPublicKey;
            bool? delaySign;
            Platform platform;
            ReportDiagnostic generalDiagnosticOption;
            int warningLevel;
            IEnumerable<KeyValuePair<string, ReportDiagnostic>> specificDiagnosticOptions;
            bool concurrentBuild;
            bool deterministic;
            bool publicSign;
            XmlReferenceResolver xmlReferenceResolver;
            SourceReferenceResolver sourceReferenceResolver;
            MetadataReferenceResolver metadataReferenceResolver;
            AssemblyIdentityComparer assemblyIdentityComparer;
            StrongNameProvider strongNameProvider;

            ReadCompilationOptionsFrom(
                reader,
                out outputKind, out reportSuppressedDiagnostics, out moduleName, out mainTypeName, out scriptClassName,
                out optimizationLevel, out checkOverflow, out cryptoKeyContainer, out cryptoKeyFile, out cryptoPublicKey,
                out delaySign, out platform, out generalDiagnosticOption, out warningLevel, out specificDiagnosticOptions,
                out concurrentBuild, out deterministic, out publicSign, out xmlReferenceResolver, out sourceReferenceResolver,
                out metadataReferenceResolver, out assemblyIdentityComparer, out strongNameProvider, cancellationToken);

            var usings = reader.ReadArray<string>();
            var allowUnsafe = reader.ReadBoolean();

            return new CSharpCompilationOptions(
                outputKind, reportSuppressedDiagnostics, moduleName, mainTypeName, scriptClassName, usings, optimizationLevel, checkOverflow, allowUnsafe,
                cryptoKeyContainer, cryptoKeyFile, cryptoPublicKey, delaySign, platform, generalDiagnosticOption, warningLevel, specificDiagnosticOptions, concurrentBuild,
                deterministic, xmlReferenceResolver, sourceReferenceResolver, metadataReferenceResolver, assemblyIdentityComparer, strongNameProvider, publicSign);
        }
开发者ID:orthoxerox,项目名称:roslyn,代码行数:42,代码来源:CSharpOptionsSerializationService.cs

示例4: ReadFrom

            public static ProjectAttributes ReadFrom(ObjectReader reader)
            {
                var projectId = ProjectId.ReadFrom(reader);

                // var version = VersionStamp.ReadFrom(reader);
                var name = reader.ReadString();
                var assemblyName = reader.ReadString();
                var language = reader.ReadString();
                var filePath = reader.ReadString();
                var outputFilePath = reader.ReadString();
                var isSubmission = reader.ReadBoolean();
                var hasAllInformation = reader.ReadBoolean();

                return new ProjectAttributes(projectId, VersionStamp.Create(), name, assemblyName, language, filePath, outputFilePath, isSubmission, hasAllInformation);
            }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:15,代码来源:ProjectInfo.cs

示例5: ReadMetadataReferencePropertiesFrom

        private MetadataReferenceProperties ReadMetadataReferencePropertiesFrom(ObjectReader reader, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            var kind = (MetadataImageKind)reader.ReadInt32();
            var aliases = reader.ReadArray<string>().ToImmutableArrayOrEmpty();
            var embedInteropTypes = reader.ReadBoolean();

            return new MetadataReferenceProperties(kind, aliases, embedInteropTypes);
        }
开发者ID:natidea,项目名称:roslyn,代码行数:10,代码来源:AbstractReferenceSerializationService.cs

示例6: ReadLocation

        private static DiagnosticDataLocation ReadLocation(Project project, ObjectReader reader, Document documentOpt)
        {
            var exists = reader.ReadBoolean();
            if (!exists)
            {
                return null;
            }

            TextSpan? sourceSpan = null;
            if (reader.ReadBoolean())
            {
                sourceSpan = new TextSpan(reader.ReadInt32(), reader.ReadInt32());
            }

            var originalFile = reader.ReadString();
            var originalStartLine = reader.ReadInt32();
            var originalStartColumn = reader.ReadInt32();
            var originalEndLine = reader.ReadInt32();
            var originalEndColumn = reader.ReadInt32();

            var mappedFile = reader.ReadString();
            var mappedStartLine = reader.ReadInt32();
            var mappedStartColumn = reader.ReadInt32();
            var mappedEndLine = reader.ReadInt32();
            var mappedEndColumn = reader.ReadInt32();

            var documentId = documentOpt != null
                ? documentOpt.Id
                : project.Documents.FirstOrDefault(d => d.FilePath == originalFile)?.Id;

            return new DiagnosticDataLocation(documentId, sourceSpan,
                originalFile, originalStartLine, originalStartColumn, originalEndLine, originalEndColumn,
                mappedFile, mappedStartLine, mappedStartColumn, mappedEndLine, mappedEndColumn);
        }
开发者ID:RoryVL,项目名称:roslyn,代码行数:34,代码来源:DiagnosticDataSerializer.cs

示例7: ReadFrom

        private static void ReadFrom(ObjectReader reader, Project project, Document document, List<DiagnosticData> list, CancellationToken cancellationToken)
        {
            var count = reader.ReadInt32();

            for (var i = 0; i < count; i++)
            {
                cancellationToken.ThrowIfCancellationRequested();

                var id = reader.ReadString();
                var category = reader.ReadString();

                var message = reader.ReadString();
                var messageFormat = reader.ReadString();
                var title = reader.ReadString();
                var description = reader.ReadString();
                var helpLink = reader.ReadString();
                var severity = (DiagnosticSeverity)reader.ReadInt32();
                var defaultSeverity = (DiagnosticSeverity)reader.ReadInt32();
                var isEnabledByDefault = reader.ReadBoolean();
                var isSuppressed = reader.ReadBoolean();
                var warningLevel = reader.ReadInt32();

                var start = reader.ReadInt32();
                var length = reader.ReadInt32();
                var textSpan = new TextSpan(start, length);

                var location = ReadLocation(project, reader, document);
                var additionalLocations = ReadAdditionalLocations(project, reader);

                var customTagsCount = reader.ReadInt32();
                var customTags = GetCustomTags(reader, customTagsCount);

                var propertiesCount = reader.ReadInt32();
                var properties = GetProperties(reader, propertiesCount);

                list.Add(new DiagnosticData(
                    id, category, message, messageFormat, severity, defaultSeverity, isEnabledByDefault, warningLevel, customTags, properties,
                    project.Solution.Workspace, project.Id, location, additionalLocations,
                    title: title,
                    description: description,
                    helpLink: helpLink,
                    isSuppressed: isSuppressed));
            }
        }
开发者ID:RoryVL,项目名称:roslyn,代码行数:44,代码来源:DiagnosticDataSerializer.cs

示例8: DeserializeProjectReference

        private ProjectReference DeserializeProjectReference(ObjectReader reader, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            var projectId = ProjectId.ReadFrom(reader);
            var aliases = reader.ReadArray<string>();
            var embedInteropTypes = reader.ReadBoolean();

            return new ProjectReference(projectId, aliases.ToImmutableArrayOrEmpty(), embedInteropTypes);
        }
开发者ID:jkotas,项目名称:roslyn,代码行数:10,代码来源:Serializer_Asset.cs

示例9: ReadFrom

            public static DocumentAttributes ReadFrom(ObjectReader reader)
            {
                var documentId = DocumentId.ReadFrom(reader);

                var name = reader.ReadString();
                var folders = (string[])reader.ReadValue();
                var sourceCodeKind = reader.ReadInt32();
                var filePath = reader.ReadString();
                var isGenerated = reader.ReadBoolean();

                return new DocumentAttributes(documentId, name, folders, (SourceCodeKind)sourceCodeKind, filePath, isGenerated);
            }
开发者ID:jkotas,项目名称:roslyn,代码行数:12,代码来源:DocumentInfo.cs

示例10: DeserializeDocumentSnapshotInfo

        private DocumentChecksumObjectInfo DeserializeDocumentSnapshotInfo(ObjectReader reader, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            var documentId = DeserializeDocumentId(reader, cancellationToken);

            var name = reader.ReadString();
            var folders = reader.ReadArray<string>();
            var sourceCodeKind = reader.ReadInt32();
            var filePath = reader.ReadString();
            var isGenerated = reader.ReadBoolean();

            return new DocumentChecksumObjectInfo(documentId, name, folders, (SourceCodeKind)sourceCodeKind, filePath, isGenerated);
        }
开发者ID:Rickinio,项目名称:roslyn,代码行数:14,代码来源:Serializer_Asset.cs

示例11: DiagnosticInfo

        protected DiagnosticInfo(ObjectReader reader)
        {
            this.messageProvider = (CommonMessageProvider)reader.ReadValue();
            this.errorCode = (int)reader.ReadCompressedUInt();
            this.isWarningAsError = reader.ReadBoolean();

            var count = (int)reader.ReadCompressedUInt();
            if (count == 0)
            {
                this.arguments = NoArguments;
            }
            else if (count > 0)
            {
                this.arguments = new string[count];
                for (int i = 0; i < count; i++)
                {
                    this.arguments[i] = reader.ReadString();
                }
            }
        }
开发者ID:riversky,项目名称:roslyn,代码行数:20,代码来源:DiagnosticInfo.cs

示例12: ReadFrom

        internal static SymbolTreeInfo ReadFrom(ObjectReader reader)
        {
            try
            {
                var formatVersion = reader.ReadString();
                if (!string.Equals(formatVersion, SerializationFormat, StringComparison.Ordinal))
                {
                    return null;
                }

                var version = VersionStamp.ReadFrom(reader);

                var count = reader.ReadInt32();
                if (count == 0)
                {
                    return new SymbolTreeInfo(version, ImmutableArray<Node>.Empty);
                }

                var nodes = new Node[count];
                for (var i = 0; i < count; i++)
                {
                    var name = reader.ReadString();
                    var parentIndex = reader.ReadInt32();

                    nodes[i] = new Node(name, parentIndex);
                }

                var hasSpellChecker = reader.ReadBoolean();
                return hasSpellChecker
                    ? new SymbolTreeInfo(version, nodes, SpellChecker.ReadFrom(reader))
                    : new SymbolTreeInfo(version, nodes);
            }
            catch (Exception)
            {
            }

            return null;
        }
开发者ID:braegelno5,项目名称:roslyn,代码行数:38,代码来源:SymbolTreeInfo_Serialization.cs

示例13: ReadCompilationOptionsFrom

        protected void ReadCompilationOptionsFrom(
            ObjectReader reader,
            out OutputKind outputKind,
            out bool reportSuppressedDiagnostics,
            out string moduleName,
            out string mainTypeName,
            out string scriptClassName,
            out OptimizationLevel optimizationLevel,
            out bool checkOverflow,
            out string cryptoKeyContainer,
            out string cryptoKeyFile,
            out ImmutableArray<byte> cryptoPublicKey,
            out bool? delaySign,
            out Platform platform,
            out ReportDiagnostic generalDiagnosticOption,
            out int warningLevel,
            out IEnumerable<KeyValuePair<string, ReportDiagnostic>> specificDiagnosticOptions,
            out bool concurrentBuild,
            out bool deterministic,
            out bool publicSign,
            out XmlReferenceResolver xmlReferenceResolver,
            out SourceReferenceResolver sourceReferenceResolver,
            out MetadataReferenceResolver metadataReferenceResolver,
            out AssemblyIdentityComparer assemblyIdentityComparer,
            out StrongNameProvider strongNameProvider,
            CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            outputKind = (OutputKind)reader.ReadInt32();
            reportSuppressedDiagnostics = reader.ReadBoolean();
            moduleName = reader.ReadString();
            mainTypeName = reader.ReadString();

            scriptClassName = reader.ReadString();
            optimizationLevel = (OptimizationLevel)reader.ReadInt32();
            checkOverflow = reader.ReadBoolean();

            // REVIEW: is it okay this being not part of snapshot?
            cryptoKeyContainer = reader.ReadString();
            cryptoKeyFile = reader.ReadString();

            cryptoPublicKey = reader.ReadArray<byte>().ToImmutableArrayOrEmpty();

            delaySign = reader.ReadBoolean() ? (bool?)reader.ReadBoolean() : null;

            platform = (Platform)reader.ReadInt32();
            generalDiagnosticOption = (ReportDiagnostic)reader.ReadInt32();

            warningLevel = reader.ReadInt32();

            // 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
            //         not sure why CompilationOptions uses SequencialEqual to check options equality
            //         when ordering can change result of it even if contents are same.
            var count = reader.ReadInt32();
            List<KeyValuePair<string, ReportDiagnostic>> specificDiagnosticOptionsList = null;

            if (count > 0)
            {
                specificDiagnosticOptionsList = new List<KeyValuePair<string, ReportDiagnostic>>(count);

                for (var i = 0; i < count; i++)
                {
                    var key = reader.ReadString();
                    var value = (ReportDiagnostic)reader.ReadInt32();

                    specificDiagnosticOptionsList.Add(KeyValuePair.Create(key, value));
                }
            }

            specificDiagnosticOptions = specificDiagnosticOptionsList ?? SpecializedCollections.EmptyEnumerable<KeyValuePair<string, ReportDiagnostic>>();

            concurrentBuild = reader.ReadBoolean();
            deterministic = reader.ReadBoolean();
            publicSign = reader.ReadBoolean();

            // REVIEW: What should I do with these. are these service required when compilation is built ourselves, not through
            //         compiler.
            xmlReferenceResolver = XmlFileResolver.Default;
            sourceReferenceResolver = SourceFileResolver.Default;
            metadataReferenceResolver = null;
            assemblyIdentityComparer = DesktopAssemblyIdentityComparer.Default;
            strongNameProvider = new DesktopStrongNameProvider();
        }
开发者ID:Rickinio,项目名称:roslyn,代码行数:85,代码来源:AbstractOptionsSerializationService.cs


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