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


C# ImmutableArray.NullToEmpty方法代码示例

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


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

示例1: RuleSet

 /// <summary>
 /// Create a RuleSet.
 /// </summary>
 public RuleSet(string filePath, ReportDiagnostic generalOption, ImmutableDictionary<string, ReportDiagnostic> specificOptions, ImmutableArray<RuleSetInclude> includes)
 {
     _filePath = filePath;
     _generalDiagnosticOption = generalOption;
     _specificDiagnosticOptions = specificOptions == null ? ImmutableDictionary<string, ReportDiagnostic>.Empty : specificOptions;
     _includes = includes.NullToEmpty();
 }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:10,代码来源:RuleSet.cs

示例2: SignatureOnlyMethodSymbol

 public SignatureOnlyMethodSymbol(
     string name,
     TypeSymbol containingType,
     MethodKind methodKind,
     Cci.CallingConvention callingConvention,
     ImmutableArray<TypeParameterSymbol> typeParameters,
     ImmutableArray<ParameterSymbol> parameters,
     RefKind refKind,
     TypeSymbol returnType,
     ImmutableArray<CustomModifier> returnTypeCustomModifiers,
     ushort countOfCustomModifiersPrecedingByRef,
     ImmutableArray<MethodSymbol> explicitInterfaceImplementations)
 {
     _callingConvention = callingConvention;
     _typeParameters = typeParameters;
     _refKind = refKind;
     _returnType = returnType;
     _returnTypeCustomModifiers = returnTypeCustomModifiers;
     _countOfCustomModifiersPrecedingByRef = countOfCustomModifiersPrecedingByRef;
     _parameters = parameters;
     _explicitInterfaceImplementations = explicitInterfaceImplementations.NullToEmpty();
     _containingType = containingType;
     _methodKind = methodKind;
     _name = name;
 }
开发者ID:otawfik-ms,项目名称:roslyn,代码行数:25,代码来源:SignatureOnlyMethodSymbol.cs

示例3: VirtualizedStrongNameProvider

 public VirtualizedStrongNameProvider(
     IEnumerable<string> existingFullPaths = null,
     ImmutableArray<string> searchPaths = default(ImmutableArray<string>))
     : base(searchPaths.NullToEmpty())
 {
     this.existingFullPaths = new HashSet<string>(existingFullPaths, StringComparer.OrdinalIgnoreCase);
 }
开发者ID:modulexcite,项目名称:pattern-matching-csharp,代码行数:7,代码来源:StrongNameProviderTests.cs

示例4: VirtualizedFileReferenceResolver

 public VirtualizedFileReferenceResolver(
     IEnumerable<string> existingFullPaths = null, 
     string baseDirectory = null,
     ImmutableArray<string> searchPaths = default(ImmutableArray<string>))
     : base(searchPaths.NullToEmpty(), baseDirectory)
 {
     this.existingFullPaths = new HashSet<string>(existingFullPaths, StringComparer.OrdinalIgnoreCase);
 }
开发者ID:modulexcite,项目名称:pattern-matching-csharp,代码行数:8,代码来源:TestMetadataReferenceResolver.cs

示例5: CodeGenerationAttributeData

 public CodeGenerationAttributeData(
     INamedTypeSymbol attributeClass,
     ImmutableArray<TypedConstant> constructorArguments,
     ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments)
 {
     this.attributeClass = attributeClass;
     this.constructorArguments = constructorArguments.NullToEmpty();
     this.namedArguments = namedArguments.NullToEmpty();
 }
开发者ID:EkardNT,项目名称:Roslyn,代码行数:9,代码来源:CodeGenerationAttributeData.cs

示例6: DesktopStrongNameProvider

        /// <summary>
        /// Creates an instance of <see cref="DesktopStrongNameProvider"/>.
        /// </summary>
        /// <param name="keyFileSearchPaths">
        /// An ordered set of fully qualified paths which are searched when locating a cryptographic key file.
        /// </param>
        public DesktopStrongNameProvider(ImmutableArray<string> keyFileSearchPaths = default(ImmutableArray<string>))
        {
            if (!keyFileSearchPaths.IsDefault && keyFileSearchPaths.Any(path => !PathUtilities.IsAbsolute(path)))
            {
                throw new ArgumentException(CodeAnalysisResources.AbsolutePathExpected, "keyFileSearchPaths");
            }

            _keyFileSearchPaths = keyFileSearchPaths.NullToEmpty();
        }
开发者ID:ehsansajjad465,项目名称:roslyn,代码行数:15,代码来源:DesktopStrongNameProvider.cs

示例7: DefinitionItem

 protected DefinitionItem(
     ImmutableArray<string> tags,
     ImmutableArray<TaggedText> displayParts,
     ImmutableArray<TaggedText> originationParts = default(ImmutableArray<TaggedText>),
     ImmutableArray<DocumentSpan> sourceSpans = default(ImmutableArray<DocumentSpan>),
     bool displayIfNoReferences = true)
 {
     Tags = tags;
     DisplayParts = displayParts;
     OriginationParts = originationParts.NullToEmpty();
     SourceSpans = sourceSpans.NullToEmpty();
     DisplayIfNoReferences = displayIfNoReferences;
 }
开发者ID:panopticoncentral,项目名称:roslyn,代码行数:13,代码来源:DefinitionItem.cs

示例8: CompletionRules

 private CompletionRules(
     bool dismissIfEmpty,
     bool dismissIfLastCharacterDeleted,
     ImmutableArray<char> defaultCommitCharacters,
     EnterKeyRule defaultEnterKeyRule,
     SnippetsRule snippetsRule)
 {
     this.DismissIfEmpty = dismissIfEmpty;
     this.DismissIfLastCharacterDeleted = dismissIfLastCharacterDeleted;
     this.DefaultCommitCharacters = defaultCommitCharacters.NullToEmpty();
     this.DefaultEnterKeyRule = defaultEnterKeyRule;
     this.SnippetsRule = snippetsRule;
 }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:13,代码来源:CompletionRules.cs

示例9: CompletionItemRules

 private CompletionItemRules(
     ImmutableArray<CharacterSetModificationRule> filterCharacterRules,
     ImmutableArray<CharacterSetModificationRule> commitCharacterRules,
     EnterKeyRule enterKeyRule,
     bool formatOnCommit,
     int matchPriority,
     CompletionItemSelectionBehavior selectionBehavior)
 {
     FilterCharacterRules = filterCharacterRules.NullToEmpty();
     CommitCharacterRules = commitCharacterRules.NullToEmpty();
     EnterKeyRule = enterKeyRule;
     FormatOnCommit = formatOnCommit;
     MatchPriority = matchPriority;
     SelectionBehavior = selectionBehavior;
 }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:15,代码来源:CompletionItemRules.cs

示例10: CodeFixCollection

 public CodeFixCollection(
     object provider,
     TextSpan span,
     ImmutableArray<CodeFix> fixes,
     FixAllState fixAllState,
     ImmutableArray<FixAllScope> supportedScopes,
     Diagnostic firstDiagnostic)
 {
     Provider = provider;
     TextSpan = span;
     Fixes = fixes.NullToEmpty();
     FixAllState = fixAllState;
     SupportedScopes = supportedScopes.NullToEmpty();
     FirstDiagnostic = firstDiagnostic;
 }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:15,代码来源:CodeFixCollection.cs

示例11: LocalConstantDefinition

        public LocalConstantDefinition(
            string name,
            Location location,
            Cci.IMetadataConstant compileTimeValue,
            ImmutableArray<TypedConstant> dynamicTransformFlags,
            ImmutableArray<TypedConstant> tupleElementNames)
        {
            Debug.Assert(!string.IsNullOrEmpty(name));
            Debug.Assert(compileTimeValue != null);

            Name = name;
            Location = location;
            CompileTimeValue = compileTimeValue;
            DynamicTransformFlags = dynamicTransformFlags.NullToEmpty();
            TupleElementNames = tupleElementNames.NullToEmpty();
        }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:16,代码来源:LocalConstantDefinition.cs

示例12: PEAssemblyBuilderBase

        public PEAssemblyBuilderBase(
            SourceAssemblySymbol sourceAssembly,
            EmitOptions emitOptions,
            OutputKind outputKind,
            Cci.ModulePropertiesForSerialization serializationProperties,
            IEnumerable<ResourceDescription> manifestResources,
            ImmutableArray<NamedTypeSymbol> additionalTypes)
            : base((SourceModuleSymbol)sourceAssembly.Modules[0], emitOptions, outputKind, serializationProperties, manifestResources)
        {
            Debug.Assert((object)sourceAssembly != null);

            _sourceAssembly = sourceAssembly;
            _additionalTypes = additionalTypes.NullToEmpty();
            _metadataName = (emitOptions.OutputNameOverride == null) ? sourceAssembly.MetadataName : FileNameUtilities.ChangeExtension(emitOptions.OutputNameOverride, extension: null);

            AssemblyOrModuleSymbolToModuleRefMap.Add(sourceAssembly, this);
        }
开发者ID:SoumikMukherjeeDOTNET,项目名称:roslyn,代码行数:17,代码来源:PEAssemblyBuilder.cs

示例13: SignatureOnlyPropertySymbol

 public SignatureOnlyPropertySymbol(
     string name,
     TypeSymbol containingType,
     ImmutableArray<ParameterSymbol> parameters,
     TypeSymbol type,
     ImmutableArray<CustomModifier> typeCustomModifiers,
     bool isStatic,
     ImmutableArray<PropertySymbol> explicitInterfaceImplementations)
 {
     _type = type;
     _typeCustomModifiers = typeCustomModifiers;
     _isStatic = isStatic;
     _parameters = parameters;
     _explicitInterfaceImplementations = explicitInterfaceImplementations.NullToEmpty();
     _containingType = containingType;
     _name = name;
 }
开发者ID:SoumikMukherjeeDOTNET,项目名称:roslyn,代码行数:17,代码来源:SignatureOnlyPropertySymbol.cs

示例14: PEAssemblyBuilderBase

        public PEAssemblyBuilderBase(
            SourceAssemblySymbol sourceAssembly,
            string outputName,
            OutputKind outputKind,
            ModulePropertiesForSerialization serializationProperties,
            IEnumerable<ResourceDescription> manifestResources,
            Func<AssemblySymbol, AssemblyIdentity> assemblySymbolMapper,
            ImmutableArray<NamedTypeSymbol> additionalTypes)
            : base((SourceModuleSymbol)sourceAssembly.Modules[0], outputName, outputKind, serializationProperties, manifestResources, assemblySymbolMapper)
        {
            Debug.Assert((object)sourceAssembly != null);

            this.sourceAssembly = sourceAssembly;
            this.additionalTypes = additionalTypes.NullToEmpty();
            this.metadataName = outputName == null ? sourceAssembly.MetadataName : PathUtilities.RemoveExtension(outputName);

            AssemblyOrModuleSymbolToModuleRefMap.Add(sourceAssembly, this);
        }
开发者ID:riversky,项目名称:roslyn,代码行数:18,代码来源:PEAssemblyBuilder.cs

示例15: Create

        public static CompletionItem Create(
            string displayText,
            Glyph? glyph = null,
            ImmutableArray<SymbolDisplayPart> description = default(ImmutableArray<SymbolDisplayPart>),
            string sortText = null,
            string filterText = null,
            int? matchPriority = null,
            bool showsWarningIcon = false,
            bool shouldFormatOnCommit = false,
            ImmutableDictionary<string, string> properties = null,
            ImmutableArray<string> tags = default(ImmutableArray<string>),
            CompletionItemRules rules = null)
        {
            tags = tags.NullToEmpty();

            if (glyph != null)
            {
                // put glyph tags first
                tags = GlyphTags.GetTags(glyph.Value).AddRange(tags);
            }

            if (showsWarningIcon)
            {
                tags = tags.Add(CompletionTags.Warning);
            }

            properties = properties ?? ImmutableDictionary<string, string>.Empty;
            if (!description.IsDefault && description.Length > 0)
            {
                properties = properties.Add("Description", EncodeDescription(description));
            }

            rules = rules ?? CompletionItemRules.Default;
            rules = rules.WithMatchPriority(matchPriority.GetValueOrDefault())
                         .WithFormatOnCommit(shouldFormatOnCommit);

            return CompletionItem.Create(
                displayText: displayText,
                filterText: filterText,
                sortText: sortText,
                properties: properties,
                tags: tags,
                rules: rules);
        }
开发者ID:jkotas,项目名称:roslyn,代码行数:44,代码来源:CommonCompletionItem.cs


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