• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ImmutableHashSet类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ImmutableHashSet的典型用法代码示例。如果您正苦于以下问题:C# ImmutableHashSet类的具体用法?C# ImmutableHashSet怎么用?C# ImmutableHashSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ImmutableHashSet类属于命名空间,在下文中一共展示了ImmutableHashSet类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ClusterRouterGroupSettings

        public ClusterRouterGroupSettings(int totalInstances, bool allowLocalRoutees, string useRole, ImmutableHashSet<string> routeesPaths) : base(totalInstances, allowLocalRoutees, useRole)
        {
            RouteesPaths = routeesPaths;
            if(routeesPaths == null || routeesPaths.IsEmpty || string.IsNullOrEmpty(routeesPaths.First())) throw new ArgumentException("routeesPaths must be defined", "routeesPaths");

            //todo add relative actor path validation
        }
开发者ID:rodrigovidal,项目名称:akka.net,代码行数:7,代码来源:ClusterRoutingConfig.cs


示例2: OnReceive

 protected override void OnReceive(object message)
 {
     var state = message as ClusterEvent.CurrentClusterState;
     if (state != null)
     {
         _clusterNodes =
             state.Members.Select(m => m.Address).Where(a => a != _cluster.SelfAddress).ToImmutableHashSet();
         foreach(var node in _clusterNodes) TakeOverResponsibility(node);
         Unreachable.ExceptWith(_clusterNodes);
         return;
     }
     var memberUp = message as ClusterEvent.MemberUp;
     if (memberUp != null)
     {
         MemberUp(memberUp);
         return;
     }
     var memberRemoved = message as ClusterEvent.MemberRemoved;
     if (memberRemoved != null)
     {
         MemberRemoved(memberRemoved);
         return;
     }
     if (message is ClusterEvent.IMemberEvent) return; // not interesting
     base.OnReceive(message);
 }
开发者ID:rogeralsing,项目名称:akka.net,代码行数:26,代码来源:ClusterRemoteWatcher.cs


示例3: GetNewRootWithAddedNamespaces

		static async Task<SyntaxNode> GetNewRootWithAddedNamespaces(Document document, SyntaxNode relativeToNode,
			CancellationToken cancellationToken, ImmutableHashSet<string> namespaceQualifiedStrings)
		{
			var namespaceWithUsings = relativeToNode
				.GetAncestorsOrThis<NamespaceDeclarationSyntax>()
				.FirstOrDefault(ns => ns.DescendantNodes().OfType<UsingDirectiveSyntax>().Any());

			var root = await document.GetSyntaxRootAsync(cancellationToken);
			SyntaxNode newRoot;

			var usings = namespaceQualifiedStrings
				.Select(ns => UsingDirective(ParseName(ns).WithAdditionalAnnotations(Simplifier.Annotation)));

			if (namespaceWithUsings != null)
			{
				var newNamespaceDeclaration = namespaceWithUsings.WithUsings(namespaceWithUsings.Usings.AddRange(usings));
				newRoot = root.ReplaceNode(namespaceWithUsings, newNamespaceDeclaration);
			}
			else
			{
				var compilationUnit = (CompilationUnitSyntax)root;
				newRoot = compilationUnit.WithUsings(compilationUnit.Usings.AddRange(usings));
			}
			return newRoot;
		}
开发者ID:vbfox,项目名称:NFluentConversion,代码行数:25,代码来源:UsingHelpers.cs


示例4: GetProviders

        protected ImmutableArray<CompletionProvider> GetProviders(ImmutableHashSet<string> roles)
        {
            roles = roles ?? ImmutableHashSet<string>.Empty;

            RoleProviders providers;
            if (!_roleProviders.TryGetValue(roles, out providers))
            {
                providers = _roleProviders.GetValue(roles, _ =>
                {
                    var builtin = GetBuiltInProviders();
                    var imported = GetImportedProviders()
                        .Where(lz => lz.Metadata.Roles == null || lz.Metadata.Roles.Length == 0 || roles.Overlaps(lz.Metadata.Roles))
                        .Select(lz => lz.Value);
                    return new RoleProviders { Providers = builtin.Concat(imported).ToImmutableArray() };
                });
            }

            if (_testProviders.Length > 0)
            {
                return providers.Providers.Concat(_testProviders);
            }
            else
            {
                return providers.Providers;
            }
        }
开发者ID:swaroop-sridhar,项目名称:roslyn,代码行数:26,代码来源:CompletionServiceWithProviders.cs


示例5: ImmutableConstantChecker

        private readonly MultiDictionary<ISentenceForm, Fact> _sentencesByForm; //TODO: Immutable

        #endregion Fields

        #region Constructors

        private ImmutableConstantChecker(ImmutableSentenceFormModel sentenceModel, MultiDictionary<ISentenceForm, Fact> sentencesByForm)
        {
            Debug.Assert(sentenceModel.ConstantSentenceForms.IsSupersetOf(sentencesByForm.Keys));
            _sentenceModel = sentenceModel;
            _sentencesByForm = sentencesByForm;
            _allSentences = sentencesByForm.SelectMany(s => s.Value).ToImmutableHashSet();
        }
开发者ID:druzil,项目名称:nggp-base,代码行数:13,代码来源:ImmutableConstantChecker.cs


示例6: GetCompletionsAsync

 /// <summary>
 /// Gets the completions available at the caret position.
 /// </summary>
 /// <param name="document">The document that completion is occuring within.</param>
 /// <param name="caretPosition">The position of the caret after the triggering action.</param>
 /// <param name="trigger">The triggering action.</param>
 /// <param name="roles">Optional set of roles associated with the editor state.</param>
 /// <param name="options">Optional options that override the default options.</param>
 /// <param name="cancellationToken"></param>
 public abstract Task<CompletionList> GetCompletionsAsync(
     Document document,
     int caretPosition,
     CompletionTrigger trigger = default(CompletionTrigger),
     ImmutableHashSet<string> roles = null,
     OptionSet options = null,
     CancellationToken cancellationToken = default(CancellationToken));
开发者ID:RoryVL,项目名称:roslyn,代码行数:16,代码来源:CompletionService.cs


示例7: EEAssemblyBuilder

        public EEAssemblyBuilder(
            SourceAssemblySymbol sourceAssembly,
            EmitOptions emitOptions,
            ImmutableArray<MethodSymbol> methods,
            ModulePropertiesForSerialization serializationProperties,
            ImmutableArray<NamedTypeSymbol> additionalTypes,
            NamedTypeSymbol dynamicOperationContextType,
            CompilationTestData testData) :
            base(
                  sourceAssembly,
                  emitOptions,
                  outputKind: OutputKind.DynamicallyLinkedLibrary,
                  serializationProperties: serializationProperties,
                  manifestResources: SpecializedCollections.EmptyEnumerable<ResourceDescription>(),
                  additionalTypes: additionalTypes)
        {
            Methods = ImmutableHashSet.CreateRange(methods);
            _dynamicOperationContextType = dynamicOperationContextType;

            if (testData != null)
            {
                this.SetMethodTestData(testData.Methods);
                testData.Module = this;
            }
        }
开发者ID:rgani,项目名称:roslyn,代码行数:25,代码来源:EEAssemblyBuilder.cs


示例8: DiagnosticService

 public DiagnosticService()
 {
     // we use registry service rather than doing MEF import since MEF import method can have race issue where
     // update source gets created before aggregator - diagnostic service - is created and we will lose events fired before
     // the aggregator is created.
     _updateSources = ImmutableHashSet<IDiagnosticUpdateSource>.Empty;
 }
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:7,代码来源:DiagnosticService_UpdateSourceRegistrationService.cs


示例9: MemberCreate

        /// <summary>
        /// Creates a member from internal Akka method
        /// </summary>
        /// <returns>The new member</returns>
        public static Member MemberCreate(UniqueAddress uniqueAddress, int upNumber, MemberStatus status, ImmutableHashSet<string> roles)
        {
            var createMethod =
                typeof(Member).GetMethods(BindingFlags.NonPublic | BindingFlags.Static)
                .First(m => m.Name == "Create" && m.GetParameters().Length == 4);

            return (Member)createMethod.Invoke(null, new object[] { uniqueAddress, upNumber, status, roles });
        }
开发者ID:kantora,项目名称:ClusterKit,代码行数:12,代码来源:ClusterExtensions.cs


示例10: GetFix

        private async Task<Solution> GetFix(TextDocument publicSurfaceAreaDocument, string newSymbolName, ImmutableHashSet<string> siblingSymbolNamesToRemove, CancellationToken cancellationToken)
        {
            SourceText sourceText = await publicSurfaceAreaDocument.GetTextAsync(cancellationToken).ConfigureAwait(false);
            SourceText newSourceText = AddSymbolNamesToSourceText(sourceText, new[] { newSymbolName });
            newSourceText = RemoveSymbolNamesFromSourceText(newSourceText, siblingSymbolNamesToRemove);

            return publicSurfaceAreaDocument.Project.Solution.WithAdditionalDocumentText(publicSurfaceAreaDocument.Id, newSourceText);
        }
开发者ID:bkoelman,项目名称:roslyn-analyzers,代码行数:8,代码来源:DeclarePublicAPIFix.cs


示例11: TradeGood

 /// <summary>
 /// Initializes a new instance of the <see cref="TradeGood"/> class.
 /// </summary>
 public TradeGood()
 {
     m_AvailabilityList = ImmutableHashSet<string>.Empty;
     DetailRoll = "2D6";
     Legal = true;
     m_PurchaseDMs = new List<TradeGoodPurchase>();
     m_SaleDMs = new List<TradeGoodSale>();
 }
开发者ID:Grauenwolf,项目名称:TravellerTools,代码行数:11,代码来源:TradeGood.cs


示例12: GetConstantSentenceForms

 /// <summary>
 /// Contant sentences are those that do not have a dependency on 'true' or 'does' facts
 /// </summary>
 /// <param name="sentenceForms"></param>
 /// <param name="dependencyGraph"></param>
 /// <returns></returns>
 private static ImmutableHashSet<ISentenceForm> GetConstantSentenceForms(ImmutableHashSet<ISentenceForm> sentenceForms,
     MultiDictionary<ISentenceForm, ISentenceForm> dependencyGraph)
 {
     MultiDictionary<ISentenceForm, ISentenceForm> augmentedGraph = AugmentGraphWithLanguageRules(dependencyGraph, sentenceForms);
     ImmutableHashSet<ISentenceForm> changingSentenceForms =
         DependencyGraphs.GetMatchingAndDownstream(sentenceForms, augmentedGraph,
                                                     d => SentenceForms.TruePred(d) || SentenceForms.DoesPred(d));
     return sentenceForms.SymmetricExcept(changingSentenceForms).ToImmutableHashSet();
 }
开发者ID:druzil,项目名称:nggp-base,代码行数:15,代码来源:SentenceFormModelFactory.cs


示例13: ShouldTriggerCompletion

 /// <summary>
 /// Returns true if the character recently inserted or deleted in the text should trigger completion.
 /// </summary>
 /// <param name="text">The document text to trigger completion within </param>
 /// <param name="caretPosition">The position of the caret after the triggering action.</param>
 /// <param name="trigger">The potential triggering action.</param>
 /// <param name="roles">Optional set of roles associated with the editor state.</param>
 /// <param name="options">Optional options that override the default options.</param>
 /// <remarks>
 /// This API uses SourceText instead of Document so implementations can only be based on text, not syntax or semantics.
 /// </remarks>
 public virtual bool ShouldTriggerCompletion(
     SourceText text,
     int caretPosition,
     CompletionTrigger trigger,
     ImmutableHashSet<string> roles = null,
     OptionSet options = null)
 {
     return false;
 }
开发者ID:tvsonar,项目名称:roslyn,代码行数:20,代码来源:CompletionService.cs


示例14: FixAllDiagnosticProvider

 public FixAllDiagnosticProvider(
     ImmutableHashSet<string> diagnosticIds,
     Func<Document, ImmutableHashSet<string>, CancellationToken, Task<IEnumerable<Diagnostic>>> getDocumentDiagnosticsAsync,
     Func<Project, bool, ImmutableHashSet<string>, CancellationToken, Task<IEnumerable<Diagnostic>>> getProjectDiagnosticsAsync)
 {
     this.diagnosticIds = diagnosticIds;
     this.getDocumentDiagnosticsAsync = getDocumentDiagnosticsAsync;
     this.getProjectDiagnosticsAsync = getProjectDiagnosticsAsync;
 }
开发者ID:haroldhues,项目名称:code-cracker,代码行数:9,代码来源:FixAllDiagnosticProvider.cs


示例15: RendererState

 /// <summary>
 /// 
 /// </summary>
 public RendererState()
 {
     _panX = 0.0;
     _panY = 0.0;
     _zoom = 1.0;
     _enableAutofit = true;
     _drawShapeState = ShapeState.Create(ShapeStateFlags.Visible | ShapeStateFlags.Printable);
     _selectedShape = default(BaseShape);
     _selectedShapes = default(ImmutableHashSet<BaseShape>);
 }
开发者ID:3DInstruments,项目名称:Kaliber3D,代码行数:13,代码来源:RendererState.cs


示例16: AnalyzerData

 public AnalyzerData(
     ImmutableHashSet<ExpandedType> usedTypes, ImmutableHashSet<ExpandedMethod> analyzedMethods,
     ImmutableHashSet<VirtualMethod> virtualMethodsToAnalyze,
     ImmutableHashSet<VirtualMethod> analyzedVirtualMethods
     )
 {
     this.usedTypes = usedTypes;
       this.analyzedMethods = analyzedMethods;
       this.virtualMethodsToAnalyze = virtualMethodsToAnalyze;
       this.analyzedVirtualMethods = analyzedVirtualMethods;
 }
开发者ID:tinylabproductions,项目名称:TypesAnalyser,代码行数:11,代码来源:Analyser.cs


示例17: FixMultipleContext

 private FixMultipleContext(
     Project triggerProject,
     CodeFixProvider codeFixProvider,
     string codeActionEquivalenceKey,
     ImmutableHashSet<string> diagnosticIds,
     FixMultipleDiagnosticProvider diagnosticProvider,
     CancellationToken cancellationToken)
     : base(triggerProject, codeFixProvider, FixAllScope.Custom, codeActionEquivalenceKey, diagnosticIds, diagnosticProvider, cancellationToken)
 {
     _diagnosticProvider = diagnosticProvider;
 }
开发者ID:nemec,项目名称:roslyn,代码行数:11,代码来源:FixMultipleContext.cs


示例18: ParallelWorker

        public ParallelWorker(int workerCount)
        {
            if (workerCount < 1) throw new ArgumentException(nameof(workerCount));

            this.syncRoot = new object();
            this.capacity = workerCount;
            this.idleWorkers = ImmutableHashSet<int>.Empty.Union(Enumerable.Range(0, workerCount));
            this.busyWorkers = ImmutableHashSet<int>.Empty;

            this.waitingWorkItems = new CancellableQueue<WaitingWorkItem>();
        }
开发者ID:Sunlighter,项目名称:AsyncQueues,代码行数:11,代码来源:ParallelWorker.cs


示例19: Map

 public Map(int id, bool[,] filled, PositionedUnit unit, ImmutableStack<Unit> nextUnits, ImmutableHashSet<PositionedUnit> usedPositions, Scores scores, bool died = false)
 {
     Id = id;
     NextUnits = nextUnits;
     Width = filled.GetLength(0);
     Height = filled.GetLength(1);
     Filled = filled;
     Unit = IsValidPosition(unit) ? unit : PositionedUnit.Null;
     UsedPositions = usedPositions.Add(Unit);
     Scores = scores;
     Died = died;
 }
开发者ID:xoposhiy,项目名称:icfpc2015,代码行数:12,代码来源:Map.cs


示例20: FixAllCodeActionContext

 private FixAllCodeActionContext(
     Project project,
     FixAllProviderInfo fixAllProviderInfo,
     CodeFixProvider originalFixProvider,
     IEnumerable<Diagnostic> originalFixDiagnostics,
     ImmutableHashSet<string> diagnosticIds,
     FixAllDiagnosticProvider diagnosticProvider,
     CancellationToken cancellationToken)
     : base(project, originalFixProvider, FixAllScope.Project, null, diagnosticIds, diagnosticProvider, cancellationToken)
 {
     _fixAllProviderInfo = fixAllProviderInfo;
     _originalFixDiagnostics = originalFixDiagnostics;
     _diagnosticProvider = diagnosticProvider;
 }
开发者ID:SoumikMukherjeeDOTNET,项目名称:roslyn,代码行数:14,代码来源:FixAllCodeActionContext.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ImmutableList类代码示例发布时间:2022-05-24
下一篇:
C# ImmutableDictionary类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap