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


C# CSharpParseOptions.WithFeatures方法代码示例

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


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

示例1: LexicalTests

 public LexicalTests()
 {
     _options = new CSharpParseOptions(languageVersion: LanguageVersion.CSharp3);
     var binaryLiterals = new[] { new KeyValuePair<string, string>("binaryLiterals", "true") };
     var digitSeparators = new[] { new KeyValuePair<string, string>("digitSeparators", "true") };
     _binaryOptions = _options.WithFeatures(binaryLiterals);
     _underscoreOptions = _options.WithFeatures(digitSeparators);
     _binaryUnderscoreOptions = _options.WithFeatures(binaryLiterals.Concat(digitSeparators));
 }
开发者ID:rafaellincoln,项目名称:roslyn,代码行数:9,代码来源:LexicalTests.cs

示例2: ReadParseOptionsFrom

        public override ParseOptions ReadParseOptionsFrom(ObjectReader reader, CancellationToken cancellationToken)
        {
            SourceCodeKind kind;
            DocumentationMode documentationMode;
            IEnumerable<KeyValuePair<string, string>> features;
            ReadParseOptionsFrom(reader, out kind, out documentationMode, out features, cancellationToken);

            var languageVersion = (LanguageVersion)reader.ReadInt32();
            var preprocessorSymbolNames = reader.ReadArray<string>();

            var options = new CSharpParseOptions(languageVersion, documentationMode, kind, preprocessorSymbolNames);
            return options.WithFeatures(features);
        }
开发者ID:jkotas,项目名称:roslyn,代码行数:13,代码来源:CSharpOptionsSerializationService.cs

示例3: ReadParseOptionsFrom

        public override ParseOptions ReadParseOptionsFrom(ObjectReader reader, CancellationToken cancellationToken)
        {
            ReadParseOptionsFrom(reader, out var kind, out var documentationMode, out var features, cancellationToken);

            var languageVersion = (LanguageVersion)reader.ReadInt32();
            var preprocessorSymbolNames = reader.ReadArray<string>();

            var options = new CSharpParseOptions(languageVersion, documentationMode, kind, preprocessorSymbolNames);
            return options.WithFeatures(features);
        }
开发者ID:TyOverby,项目名称:roslyn,代码行数:10,代码来源:CSharpOptionsSerializationService.cs


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