本文整理汇总了C#中ImmutableHashSet.Union方法的典型用法代码示例。如果您正苦于以下问题:C# ImmutableHashSet.Union方法的具体用法?C# ImmutableHashSet.Union怎么用?C# ImmutableHashSet.Union使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImmutableHashSet
的用法示例。
在下文中一共展示了ImmutableHashSet.Union方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CSharpEditorFormattingService
public CSharpEditorFormattingService()
{
_autoFormattingTriggerChars = ImmutableHashSet.CreateRange<char>(";}");
// add all auto formatting trigger to supported char
_supportedChars = _autoFormattingTriggerChars.Union("{}#nte:)");
// set up multi words map
_multiWordsMap = ImmutableDictionary.CreateRange(new[]
{
KeyValuePair.Create('n', ImmutableHashSet.Create(SyntaxKind.RegionKeyword, SyntaxKind.EndRegionKeyword)),
KeyValuePair.Create('t', ImmutableHashSet.Create(SyntaxKind.SelectKeyword)),
KeyValuePair.Create('e', ImmutableHashSet.Create(SyntaxKind.WhereKeyword)),
});
}
示例2: ProcessStarting
/// <summary>
/// Invoked by <see cref="InteractiveHost"/> when a new process is being started.
/// </summary>
private void ProcessStarting(bool initialize)
{
if (!Dispatcher.CheckAccess())
{
Dispatcher.BeginInvoke(new Action(() => ProcessStarting(initialize)));
return;
}
// Freeze all existing classifications and then clear the list of
// submission buffers we have.
FreezeClassifications();
_submissionBuffers.Clear();
// We always start out empty
_workspace.ClearSolution();
_currentSubmissionProjectId = null;
_previousSubmissionProjectId = null;
var metadataService = _workspace.CurrentSolution.Services.MetadataService;
var mscorlibRef = metadataService.GetReference(typeof(object).Assembly.Location, MetadataReferenceProperties.Assembly);
var interactiveHostObjectRef = metadataService.GetReference(typeof(InteractiveScriptGlobals).Assembly.Location, MetadataReferenceProperties.Assembly);
_references = ImmutableHashSet.Create<MetadataReference>(mscorlibRef, interactiveHostObjectRef);
_rspImports = ImmutableArray<string>.Empty;
_initialScriptFileOpt = null;
ReferenceSearchPaths = ImmutableArray<string>.Empty;
SourceSearchPaths = ImmutableArray<string>.Empty;
if (initialize && File.Exists(_responseFilePath))
{
// The base directory for relative paths is the directory that contains the .rsp file.
// Note that .rsp files included by this .rsp file will share the base directory (Dev10 behavior of csc/vbc).
var rspDirectory = Path.GetDirectoryName(_responseFilePath);
var args = this.CommandLineParser.Parse(new[] { "@" + _responseFilePath }, rspDirectory, RuntimeEnvironment.GetRuntimeDirectory(), null);
if (args.Errors.Length == 0)
{
var metadataResolver = CreateMetadataReferenceResolver(metadataService, args.ReferencePaths, rspDirectory);
var sourceResolver = CreateSourceReferenceResolver(args.SourcePaths, rspDirectory);
// ignore unresolved references, they will be reported in the interactive window:
var rspReferences = args.ResolveMetadataReferences(metadataResolver).Where(r => !(r is UnresolvedMetadataReference));
_initialScriptFileOpt = args.SourceFiles.IsEmpty ? null : args.SourceFiles[0].Path;
ReferenceSearchPaths = args.ReferencePaths;
SourceSearchPaths = args.SourcePaths;
_references = _references.Union(rspReferences);
_rspImports = CommandLineHelpers.GetImports(args);
}
}
_metadataReferenceResolver = CreateMetadataReferenceResolver(metadataService, ReferenceSearchPaths, _initialWorkingDirectory);
_sourceReferenceResolver = CreateSourceReferenceResolver(SourceSearchPaths, _initialWorkingDirectory);
// create the first submission project in the workspace after reset:
if (_currentSubmissionBuffer != null)
{
AddSubmission(_currentTextView, _currentSubmissionBuffer, this.LanguageName);
}
}
示例3: PlacePiece
public ImmutableHashSet<Point> PlacePiece(Piece piece, ImmutableHashSet<Point> gameField)
{
return
gameField.Union(piece.Coordinates);
}