本文整理汇总了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();
}
示例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;
}
示例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);
}
示例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);
}
示例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();
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}