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


C# ObjectReader.ReadValue方法代码示例

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


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

示例1: WithTwoChildren

 internal WithTwoChildren(ObjectReader reader)
     : base(reader)
 {
     this.SlotCount = 2;
     _child0 = (GreenNode)reader.ReadValue();
     this.AdjustFlagsAndWidth(_child0);
     _child1 = (GreenNode)reader.ReadValue();
     this.AdjustFlagsAndWidth(_child1);
 }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:9,代码来源:SyntaxList.WithTwoChildren.cs

示例2: SyntaxIdentifierWithTrivia

 internal SyntaxIdentifierWithTrivia(ObjectReader reader)
     : base(reader)
 {
     var leading = (GreenNode)reader.ReadValue();
     if (leading != null)
     {
         this.AdjustFlagsAndWidth(leading);
         _leading = leading;
     }
     var trailing = (GreenNode)reader.ReadValue();
     if (trailing != null)
     {
         _trailing = trailing;
         this.AdjustFlagsAndWidth(trailing);
     }
 }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:16,代码来源:SyntaxToken.SyntaxIdentifierWithTrivia.cs

示例3: SyntaxTokenWithTrivia

 internal SyntaxTokenWithTrivia(ObjectReader reader)
     : base(reader)
 {
     var leading = (CSharpSyntaxNode)reader.ReadValue();
     if (leading != null)
     {
         this.AdjustFlagsAndWidth(leading);
         this.LeadingField = leading;
     }
     var trailing = (CSharpSyntaxNode)reader.ReadValue();
     if (trailing != null)
     {
         this.AdjustFlagsAndWidth(trailing);
         this.TrailingField = trailing;
     }
 }
开发者ID:EkardNT,项目名称:Roslyn,代码行数:16,代码来源:SyntaxToken.SyntaxTokenWithTrivia.cs

示例4: SyntaxIdentifierWithTrailingTrivia

 internal SyntaxIdentifierWithTrailingTrivia(ObjectReader reader)
     : base(reader)
 {
     var trailing = (CSharpSyntaxNode)reader.ReadValue();
     if (trailing != null)
     {
         this.AdjustFlagsAndWidth(trailing);
         this.trailing = trailing;
     }
 }
开发者ID:modulexcite,项目名称:pattern-matching-csharp,代码行数:10,代码来源:SyntaxToken.SyntaxIdentifierWithTrailingTrivia.cs

示例5: WithManyChildrenBase

            internal WithManyChildrenBase(ObjectReader reader)
                : base(reader)
            {
                var length = reader.ReadInt32();

                this.children = new ArrayElement<GreenNode>[length];
                for (var i = 0; i < length; i++)
                {
                    this.children[i].Value = (GreenNode)reader.ReadValue();
                }

                this.InitializeChildren();
            }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:13,代码来源:SyntaxList.WithManyChildren.cs

示例6: LocalizableResourceString

        private LocalizableResourceString(ObjectReader reader)
        {
            _resourceSource = (Type)reader.ReadValue();
            _nameOfLocalizableResource = reader.ReadString();
            _resourceManager = new ResourceManager(_resourceSource);

            var length = (int)reader.ReadCompressedUInt();
            if (length == 0)
            {
                _formatArguments = SpecializedCollections.EmptyArray<string>();
            }
            else
            {
                var argumentsBuilder = ArrayBuilder<string>.GetInstance(length);
                for (int i = 0; i < length; i++)
                {
                    argumentsBuilder.Add(reader.ReadString());
                }

                _formatArguments = argumentsBuilder.ToArrayAndFree();
            }
        }
开发者ID:GloryChou,项目名称:roslyn,代码行数:22,代码来源:LocalizableResourceString.cs

示例7: DiagnosticInfo

        protected DiagnosticInfo(ObjectReader reader)
        {
            _messageProvider = (CommonMessageProvider)reader.ReadValue();
            _errorCode = (int)reader.ReadCompressedUInt();
            _effectiveSeverity = (DiagnosticSeverity)reader.ReadInt32();
            _defaultSeverity = (DiagnosticSeverity)reader.ReadInt32();

            var count = (int)reader.ReadCompressedUInt();
            if (count == 0)
            {
                _arguments = SpecializedCollections.EmptyObjects;
            }
            else if (count > 0)
            {
                _arguments = new string[count];
                for (int i = 0; i < count; i++)
                {
                    _arguments[i] = reader.ReadString();
                }
            }
        }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:21,代码来源:DiagnosticInfo.cs

示例8: 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

示例9: DiagnosticInfo

        protected DiagnosticInfo(ObjectReader reader)
        {
            _messageProvider = (CommonMessageProvider)reader.ReadValue();
            _errorCode = reader.ReadInt32();
            _effectiveSeverity = (DiagnosticSeverity)reader.ReadInt32();
            _defaultSeverity = (DiagnosticSeverity)reader.ReadInt32();

            var count = reader.ReadInt32();
            if (count == 0)
            {
                _arguments = Array.Empty<object>();
            }
            else if (count > 0)
            {
                _arguments = new string[count];
                for (int i = 0; i < count; i++)
                {
                    _arguments[i] = reader.ReadString();
                }
            }
        }
开发者ID:jkotas,项目名称:roslyn,代码行数:21,代码来源:DiagnosticInfo.cs

示例10: 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

示例11: GreenNode

        internal GreenNode(ObjectReader reader)
        {
            var kindBits = reader.ReadUInt16();
            _kind = (ushort)(kindBits & ~ExtendedSerializationInfoMask);

            if ((kindBits & ExtendedSerializationInfoMask) != 0)
            {
                var diagnostics = (DiagnosticInfo[])reader.ReadValue();
                if (diagnostics != null && diagnostics.Length > 0)
                {
                    this.flags |= NodeFlags.ContainsDiagnostics;
                    s_diagnosticsTable.Add(this, diagnostics);
                }

                var annotations = (SyntaxAnnotation[])reader.ReadValue();
                if (annotations != null && annotations.Length > 0)
                {
                    this.flags |= NodeFlags.ContainsAnnotations;
                    s_annotationsTable.Add(this, annotations);
                }
            }
        }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:22,代码来源:GreenNode.cs


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