本文整理汇总了C#中IDictionary.ToImmutableDictionary方法的典型用法代码示例。如果您正苦于以下问题:C# IDictionary.ToImmutableDictionary方法的具体用法?C# IDictionary.ToImmutableDictionary怎么用?C# IDictionary.ToImmutableDictionary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDictionary
的用法示例。
在下文中一共展示了IDictionary.ToImmutableDictionary方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ImmutableSentenceDomainModel
public ImmutableSentenceDomainModel(ISentenceFormModel formModel, IDictionary<ISentenceForm, ISentenceFormDomain> domains)
: base(ImmutableSentenceFormModel.CopyOf(formModel))
{
//if (!formModel.SentenceForms.SetEquals(domains.Keys))
// throw new Exception();
_domains = domains.ToImmutableDictionary();
}
示例2: 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();
}
示例3: Create
/// <summary>
/// Create a new instance of a workspace that can be populated by opening solution and project files.
/// </summary>
/// <param name="properties">The MSBuild properties used when interpreting project files.
/// These are the same properties that are passed to msbuild via the /property:<n>=<v> command line argument.</param>
/// <param name="hostServices">The <see cref="HostServices"/> used to configure this workspace.</param>
public static MSBuildWorkspace Create(IDictionary<string, string> properties, HostServices hostServices)
{
if (properties == null)
{
throw new ArgumentNullException(nameof(properties));
}
if (hostServices == null)
{
throw new ArgumentNullException(nameof(hostServices));
}
return new MSBuildWorkspace(hostServices, properties.ToImmutableDictionary());
}
示例4: AnalyzerOptions
public AnalyzerOptions(IEnumerable<AdditionalStream> additionalStreams, IDictionary<string, string> globalOptions)
{
this.AdditionalStreams = additionalStreams == null ? ImmutableArray<AdditionalStream>.Empty : additionalStreams.ToImmutableArray();
this.GlobalOptions = globalOptions == null ? ImmutableDictionary<string, string>.Empty : globalOptions.ToImmutableDictionary();
}
示例5: ConwaysLife
private ConwaysLife(int width, int height, IDictionary<Point, int> cellAge)
{
this.width = width;
this.height = height;
this.cellAge = cellAge.ToImmutableDictionary();
}
示例6: ParameterizedSql
public ParameterizedSql(string sql, IDictionary<string, string> userInputVariables)
{
Sql = sql;
UserInputVariables = userInputVariables.ToImmutableDictionary();
}