43 references to TypeKindOptions
Microsoft.CodeAnalysis.Features (43)
GenerateType\AbstractGenerateTypeService.CodeAction.cs (19)
106
var
typeKindValue = GetTypeKindOption(_state);
120
private
TypeKindOptions
GetTypeKindOption(State state)
122
var gotPreassignedTypeOptions = GetPredefinedTypeKindOption(state, out
var
typeKindValue);
125
typeKindValue = state.IsSimpleNameGeneric ? TypeKindOptionsHelper.RemoveOptions(typeKindValue,
TypeKindOptions
.GenericInCompatibleTypes) : typeKindValue;
126
typeKindValue = state.IsMembersWithModule ? TypeKindOptionsHelper.AddOption(typeKindValue,
TypeKindOptions
.Module) : typeKindValue;
127
typeKindValue = state.IsInterfaceOrEnumNotAllowedInTypeContext ? TypeKindOptionsHelper.RemoveOptions(typeKindValue,
TypeKindOptions
.Interface,
TypeKindOptions
.Enum) : typeKindValue;
128
typeKindValue = state.IsDelegateAllowed ? typeKindValue : TypeKindOptionsHelper.RemoveOptions(typeKindValue,
TypeKindOptions
.Delegate);
129
typeKindValue = state.IsEnumNotAllowed ? TypeKindOptionsHelper.RemoveOptions(typeKindValue,
TypeKindOptions
.Enum) : typeKindValue;
135
private bool GetPredefinedTypeKindOption(State state, out
TypeKindOptions
typeKindValueFinal)
139
typeKindValueFinal =
TypeKindOptions
.Attribute;
143
if (_service.TryGetBaseList(state.NameOrMemberAccessExpression, out
var
typeKindValue))
151
typeKindValueFinal =
TypeKindOptions
.BaseList;
157
typeKindValueFinal =
TypeKindOptions
.Delegate;
163
typeKindValueFinal = state.IsSimpleNameGeneric ? TypeKindOptionsHelper.RemoveOptions(
TypeKindOptions
.MemberAccessWithNamespace,
TypeKindOptions
.GenericInCompatibleTypes) :
TypeKindOptions
.MemberAccessWithNamespace;
164
typeKindValueFinal = state.IsEnumNotAllowed ? TypeKindOptionsHelper.RemoveOptions(typeKindValueFinal,
TypeKindOptions
.Enum) : typeKindValueFinal;
168
typeKindValueFinal =
TypeKindOptions
.AllOptions;
GenerateType\AbstractGenerateTypeService.cs (1)
57
internal abstract bool TryGetBaseList(TExpressionSyntax expression, out
TypeKindOptions
returnValue);
GenerateType\GenerateTypeDialogOptions.cs (3)
11
TypeKindOptions
typeKindOptions =
TypeKindOptions
.AllOptions,
15
public
TypeKindOptions
TypeKindOptions { get; } = typeKindOptions;
GenerateType\TypeKindOptions.cs (20)
43
public static bool IsClass(
TypeKindOptions
option)
44
=> (option &
TypeKindOptions
.Class) != 0 ? true : false;
46
public static bool IsStructure(
TypeKindOptions
option)
47
=> (option &
TypeKindOptions
.Structure) != 0 ? true : false;
49
public static bool IsInterface(
TypeKindOptions
option)
50
=> (option &
TypeKindOptions
.Interface) != 0 ? true : false;
52
public static bool IsEnum(
TypeKindOptions
option)
53
=> (option &
TypeKindOptions
.Enum) != 0 ? true : false;
55
public static bool IsDelegate(
TypeKindOptions
option)
56
=> (option &
TypeKindOptions
.Delegate) != 0 ? true : false;
58
public static bool IsModule(
TypeKindOptions
option)
59
=> (option &
TypeKindOptions
.Module) != 0 ? true : false;
61
public static
TypeKindOptions
RemoveOptions(
TypeKindOptions
fromValue, params
TypeKindOptions
[] removeValues)
63
var
tempReturnValue = fromValue;
64
foreach (
var
removeValue in removeValues)
72
internal static
TypeKindOptions
AddOption(
TypeKindOptions
toValue,
TypeKindOptions
addValue)