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


C# IEnumerable.ToImmutableArray方法代码示例

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


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

示例1: CompletionModel

 public CompletionModel(SemanticModel semanticModel, TextSpan applicableSpan, ITextSnapshot textSnapshot, IEnumerable<CompletionItem> items)
 {
     SemanticModel = semanticModel;
     ApplicableSpan = applicableSpan;
     TextSnapshot = textSnapshot;
     Items = items.ToImmutableArray();
 }
开发者ID:pminiszewski,项目名称:HlslTools,代码行数:7,代码来源:CompletionModel.cs

示例2: RepoConfig

        internal RepoConfig(
            IEnumerable<NuGetPackage> fixedPackages, 
            IEnumerable<string> toolsetPackages, 
            IEnumerable<Regex> nuspecExcludes,
            IEnumerable<Regex> projectJsonExcludes,
            GenerateData? msbuildGenerateData)
        {
            Debug.Assert(toolsetPackages.Distinct().Count() == toolsetPackages.Count());
            MSBuildGenerateData = msbuildGenerateData;
            FixedPackages = fixedPackages.OrderBy(x => x.Name).ToImmutableArray();
            NuSpecExcludes = nuspecExcludes.ToImmutableArray();
            ProjectJsonExcludes = projectJsonExcludes.ToImmutableArray();
            ToolsetPackages = toolsetPackages.OrderBy(x => x).ToImmutableArray();

            var map = new Dictionary<string, List<string>>();
            foreach (var nugetRef in fixedPackages)
            {
                List<string> list;
                if (!map.TryGetValue(nugetRef.Name, out list))
                {
                    list = new List<string>(capacity: 1);
                    map[nugetRef.Name] = list;
                }

                list.Add(nugetRef.Version);
            }
        }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:27,代码来源:RepoConfig.cs

示例3: ParsingResult

 public ParsingResult(Settings settings,
     ITextSnapshot textSnapshot,
     IEnumerable<TextSpan> attributeSpans)
 {
     TextSnapshot = textSnapshot;
     AttributeSpans = attributeSpans.ToImmutableArray();
 }
开发者ID:t-denis,项目名称:DarkAttributes,代码行数:7,代码来源:ParsingResult.cs

示例4: SimpleDiagnostic

            private SimpleDiagnostic(
                DiagnosticDescriptor descriptor,
                DiagnosticSeverity severity,
                int warningLevel,
                Location location,
                IEnumerable<Location> additionalLocations,
                object[] messageArgs)
            {
                if ((warningLevel == 0 && severity != DiagnosticSeverity.Error) ||
                    (warningLevel != 0 && severity == DiagnosticSeverity.Error))
                {
                    throw new ArgumentException(nameof(warningLevel));
                }

                if(descriptor == null)
                {
                    throw new ArgumentNullException(nameof(descriptor));
                }

                _descriptor = descriptor;
                _severity = severity;
                _warningLevel = warningLevel;
                _location = location ?? Location.None;
                _additionalLocations = additionalLocations == null ? SpecializedCollections.EmptyReadOnlyList<Location>() : additionalLocations.ToImmutableArray();
                _messageArgs = messageArgs ?? SpecializedCollections.EmptyArray<object>();
            }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:26,代码来源:Diagnostic_SimpleDiagnostic.cs

示例5: SignatureHelpModel

 public SignatureHelpModel(TextSpan applicableSpan, IEnumerable<SignatureItem> signatures, SignatureItem signature, int selectedParameter)
 {
     Signatures = signatures.ToImmutableArray();
     ApplicableSpan = applicableSpan;
     Signature = signature;
     SelectedParameter = selectedParameter;
 }
开发者ID:pminiszewski,项目名称:HlslTools,代码行数:7,代码来源:SignatureHelpModel.cs

示例6: RuleSet

 /// <summary>
 /// Create a RuleSet.
 /// </summary>
 public RuleSet(string filePath, ReportDiagnostic generalOption, IDictionary<string, ReportDiagnostic> specificOptions, IEnumerable<RuleSetInclude> includes)
 {
     this.filePath = filePath;
     this.generalDiagnosticOption = generalOption;
     this.specificDiagnosticOptions = specificOptions == null ? ImmutableDictionary<string, ReportDiagnostic>.Empty : specificOptions.ToImmutableDictionary();
     this.includes = includes == null ? ImmutableArray<RuleSetInclude>.Empty : includes.ToImmutableArray();
 }
开发者ID:pheede,项目名称:roslyn,代码行数:10,代码来源:RuleSet.cs

示例7: SimpleDiagnostic

            internal SimpleDiagnostic(string id, string category, string message, DiagnosticSeverity severity, bool isEnabledByDefault,
                                      int warningLevel, bool isWarningAsError, Location location,
                                      IEnumerable<Location> additionalLocations)
            {
                if (isWarningAsError && severity != DiagnosticSeverity.Warning)
                {
                    throw new ArgumentException("isWarningAsError");
                }

                if ((warningLevel == 0 && severity == DiagnosticSeverity.Warning) ||
                    (warningLevel != 0 && severity != DiagnosticSeverity.Warning))
                {
                    throw new ArgumentException("warningLevel");
                }

                this.id = id;
                this.category = category;
                this.message = message;
                this.severity = severity;
                this.isEnabledByDefault = isEnabledByDefault;
                this.warningLevel = warningLevel;
                this.isWarningAsError = isWarningAsError;
                this.location = location;
                this.additionalLocations = additionalLocations == null ? SpecializedCollections.EmptyReadOnlyList<Location>() : additionalLocations.ToImmutableArray();
            }
开发者ID:pheede,项目名称:roslyn,代码行数:25,代码来源:Diagnostic_SimpleDiagnostic.cs

示例8: ResolvedPropertyBinder

        public ResolvedPropertyBinder(IEnumerable<PropertyAccessor> properties)
        {
            if (properties == null)
            {
                throw Logger.Fatal.ArgumentNull(nameof(properties));
            }

            Properties = properties.ToImmutableArray();
        }
开发者ID:NaseUkolyCZ,项目名称:HarshPoint,代码行数:9,代码来源:ResolvedPropertyBinder.cs

示例9: DefaultFromContextPropertyBinder

        public DefaultFromContextPropertyBinder(IEnumerable<DefaultFromContextProperty> properties)
        {
            if (properties == null)
            {
                throw Logger.Fatal.ArgumentNull(nameof(properties));
            }

            Properties = properties.ToImmutableArray();
        }
开发者ID:NaseUkolyCZ,项目名称:HarshPoint,代码行数:9,代码来源:DefaultFromContextPropertyBinder.cs

示例10: Update

        public BoundFunctionInvocationExpression Update(IEnumerable<BoundExpression> arguments, OverloadResolutionResult<FunctionSymbolSignature> result)
        {
            var newArguments = arguments.ToImmutableArray();

            if (newArguments == Arguments && result == Result)
                return this;

            return new BoundFunctionInvocationExpression(Syntax, newArguments, result);
        }
开发者ID:pminiszewski,项目名称:HlslTools,代码行数:9,代码来源:BoundFunctionInvocationExpression.cs

示例11: CodeFixCollection

 public CodeFixCollection(
     object provider,
     TextSpan span,
     IEnumerable<CodeFix> fixes,
     FixAllState fixAllState,
     IEnumerable<FixAllScope> supportedScopes,
     Diagnostic firstDiagnostic) :
     this(provider, span, fixes.ToImmutableArray(), fixAllState, supportedScopes, firstDiagnostic)
 {
 }
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:10,代码来源:CodeFixCollection.cs

示例12: EwfTableItemGroupRemainingData

 /// <summary>
 /// Creates a remaining data object.
 /// </summary>
 /// <param name="groupName">A control that contains the name of the group and any other information you want in the group head</param>
 /// <param name="groupActions">Group action buttons</param>
 /// <param name="groupHeadClickScript">The click script for the group head</param>
 /// <param name="initiallyCollapsed">Whether the group is initially collapsed. Null means the group cannot be collapsed and is always visible.</param>
 /// <param name="tailUpdateRegions">The tail update regions for the group. If a table uses item limiting, these regions will include all subsequent item
 /// groups in the table. This is necessary because any number of items could be appended to this item group, potentially causing subsequent item groups to
 /// become invisible.</param>
 public EwfTableItemGroupRemainingData(
     Control groupName, IEnumerable<Tuple<string, Action>> groupActions = null, ClickScript groupHeadClickScript = null, bool? initiallyCollapsed = null,
     IEnumerable<TailUpdateRegion> tailUpdateRegions = null)
 {
     GroupName = groupName;
     GroupActions = ( groupActions ?? new Tuple<string, Action>[ 0 ] ).ToList().AsReadOnly();
     GroupHeadClickScript = groupHeadClickScript;
     InitiallyCollapsed = initiallyCollapsed;
     TailUpdateRegions = tailUpdateRegions != null ? tailUpdateRegions.ToImmutableArray() : ImmutableArray<TailUpdateRegion>.Empty;
 }
开发者ID:enduracode,项目名称:enterprise-web-library,代码行数:20,代码来源:EwfTableItemGroupRemainingData.cs

示例13: CodeRefactoring

		public CodeRefactoring(CodeRefactoringProvider provider, IEnumerable<CodeAction> actions)
		{
			_provider = provider;
			_actions = actions.ToImmutableArray();

			if (_actions.Count == 0)
			{
				throw new ArgumentException("Actions can not be empty", "actions");
			}
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:10,代码来源:CodeRefactoring.cs

示例14: TextChangeEventArgs

        /// <summary>
        /// Initializes an instance of <see cref="TextChangeEventArgs"/>.
        /// </summary>
        /// <param name="oldText">The text before the change.</param>
        /// <param name="newText">The text after the change.</param>
        /// <param name="changes">A non-empty set of ranges for the change.</param>
        public TextChangeEventArgs(SourceText oldText, SourceText newText, IEnumerable<TextChangeRange> changes)
        {
            if (changes == null || changes.IsEmpty())
            {
                throw new ArgumentException("changes");
            }

            this.OldText = oldText;
            this.NewText = newText;
            this.Changes = changes.ToImmutableArray();
        }
开发者ID:Rickinio,项目名称:roslyn,代码行数:17,代码来源:TextChangeEventArgs.cs

示例15: TestCaseViewModel

        public TestCaseViewModel(string displayName, string skipReason, string assemblyFileName, IEnumerable<TraitViewModel> traits)
        {
            this.DisplayName = displayName;
            this.SkipReason = skipReason;
            this.AssemblyFileName = assemblyFileName;
            this.Traits = traits.ToImmutableArray();

            if (!string.IsNullOrEmpty(skipReason))
            {
                _state = TestState.Skipped;
            }
        }
开发者ID:Pilchie,项目名称:xunit.runner.wpf,代码行数:12,代码来源:TestCaseViewModel.cs


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