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


C# ImmutableHashSet类代码示例

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


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


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