src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (18)
332private readonly SymbolCategory _category;
338public SymbolKindOrTypeKind(SymbolCategory category, byte kind)
345: this(SymbolCategory.Other, checked((byte)symbolKind))
350: this(SymbolCategory.Type, checked((byte)typeKind))
355: this(SymbolCategory.Method, checked((byte)methodKind))
359public SymbolKind? SymbolKind => (_category == SymbolCategory.Other) ? (SymbolKind)_kind : null;
360public TypeKind? TypeKind => (_category == SymbolCategory.Type) ? (TypeKind)_kind : null;
361public MethodKind? MethodKind => (_category == SymbolCategory.Method) ? (MethodKind)_kind : null;
366SymbolCategory.Other => symbol.IsKind((SymbolKind)_kind),
367SymbolCategory.Type => symbol is ITypeSymbol type && type.TypeKind == (TypeKind)_kind,
368SymbolCategory.Method => symbol is IMethodSymbol method && method.MethodKind == (MethodKind)_kind,
375SymbolCategory.Other => new XElement(nameof(SymbolKind), (SymbolKind)_kind),
376SymbolCategory.Type => new XElement(nameof(TypeKind), GetTypeKindString((TypeKind)_kind)),
377SymbolCategory.Method => new XElement(nameof(MethodKind), GetMethodKindString((MethodKind)_kind)),
411if (_category != SymbolCategory.Invalid)
419var category = (SymbolCategory)reader.ReadInt32();
420var kind = (byte)((category != SymbolCategory.Invalid) ? reader.ReadInt32() : 0);