43 references to TypeKindOptions
Microsoft.CodeAnalysis.Features (43)
GenerateType\AbstractGenerateTypeService.CodeAction.cs (19)
105
var
typeKindValue = GetTypeKindOption(_state);
119
private
TypeKindOptions
GetTypeKindOption(State state)
121
var gotPreassignedTypeOptions = GetPredefinedTypeKindOption(state, out
var
typeKindValue);
124
typeKindValue = state.IsSimpleNameGeneric ? TypeKindOptionsHelper.RemoveOptions(typeKindValue,
TypeKindOptions
.GenericInCompatibleTypes) : typeKindValue;
125
typeKindValue = state.IsMembersWithModule ? TypeKindOptionsHelper.AddOption(typeKindValue,
TypeKindOptions
.Module) : typeKindValue;
126
typeKindValue = state.IsInterfaceOrEnumNotAllowedInTypeContext ? TypeKindOptionsHelper.RemoveOptions(typeKindValue,
TypeKindOptions
.Interface,
TypeKindOptions
.Enum) : typeKindValue;
127
typeKindValue = state.IsDelegateAllowed ? typeKindValue : TypeKindOptionsHelper.RemoveOptions(typeKindValue,
TypeKindOptions
.Delegate);
128
typeKindValue = state.IsEnumNotAllowed ? TypeKindOptionsHelper.RemoveOptions(typeKindValue,
TypeKindOptions
.Enum) : typeKindValue;
134
private bool GetPredefinedTypeKindOption(State state, out
TypeKindOptions
typeKindValueFinal)
138
typeKindValueFinal =
TypeKindOptions
.Attribute;
142
if (_service.TryGetBaseList(state.NameOrMemberAccessExpression, out
var
typeKindValue))
150
typeKindValueFinal =
TypeKindOptions
.BaseList;
156
typeKindValueFinal =
TypeKindOptions
.Delegate;
162
typeKindValueFinal = state.IsSimpleNameGeneric ? TypeKindOptionsHelper.RemoveOptions(
TypeKindOptions
.MemberAccessWithNamespace,
TypeKindOptions
.GenericInCompatibleTypes) :
TypeKindOptions
.MemberAccessWithNamespace;
163
typeKindValueFinal = state.IsEnumNotAllowed ? TypeKindOptionsHelper.RemoveOptions(typeKindValueFinal,
TypeKindOptions
.Enum) : typeKindValueFinal;
167
typeKindValueFinal =
TypeKindOptions
.AllOptions;
GenerateType\AbstractGenerateTypeService.cs (1)
51
internal abstract bool TryGetBaseList(TExpressionSyntax expression, out
TypeKindOptions
returnValue);
GenerateType\GenerateTypeDialogOptions.cs (3)
9
TypeKindOptions
typeKindOptions =
TypeKindOptions
.AllOptions,
13
public
TypeKindOptions
TypeKindOptions { get; } = typeKindOptions;
GenerateType\TypeKindOptions.cs (20)
41
public static bool IsClass(
TypeKindOptions
option)
42
=> (option &
TypeKindOptions
.Class) != 0 ? true : false;
44
public static bool IsStructure(
TypeKindOptions
option)
45
=> (option &
TypeKindOptions
.Structure) != 0 ? true : false;
47
public static bool IsInterface(
TypeKindOptions
option)
48
=> (option &
TypeKindOptions
.Interface) != 0 ? true : false;
50
public static bool IsEnum(
TypeKindOptions
option)
51
=> (option &
TypeKindOptions
.Enum) != 0 ? true : false;
53
public static bool IsDelegate(
TypeKindOptions
option)
54
=> (option &
TypeKindOptions
.Delegate) != 0 ? true : false;
56
public static bool IsModule(
TypeKindOptions
option)
57
=> (option &
TypeKindOptions
.Module) != 0 ? true : false;
59
public static
TypeKindOptions
RemoveOptions(
TypeKindOptions
fromValue, params
TypeKindOptions
[] removeValues)
61
var
tempReturnValue = fromValue;
62
foreach (
var
removeValue in removeValues)
70
internal static
TypeKindOptions
AddOption(
TypeKindOptions
toValue,
TypeKindOptions
addValue)