45 references to NewLineBeforeOpenBracePlacement
Microsoft.CodeAnalysis.CSharp.CodeStyle (45)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\CSharpFormattingOptions2.cs (15)
42
private static readonly BidirectionalMap<string,
NewLineBeforeOpenBracePlacement
> s_legacyNewLineOptionsEditorConfigMap =
45
KeyValuePair.Create("object_collection_array_initalizers",
NewLineBeforeOpenBracePlacement
.ObjectCollectionArrayInitializers),
47
private static readonly BidirectionalMap<string,
NewLineBeforeOpenBracePlacement
> s_newLineOptionsEditorConfigMap =
50
KeyValuePair.Create("all",
NewLineBeforeOpenBracePlacement
.All),
51
KeyValuePair.Create("accessors",
NewLineBeforeOpenBracePlacement
.Accessors),
52
KeyValuePair.Create("types",
NewLineBeforeOpenBracePlacement
.Types),
53
KeyValuePair.Create("methods",
NewLineBeforeOpenBracePlacement
.Methods),
54
KeyValuePair.Create("properties",
NewLineBeforeOpenBracePlacement
.Properties),
55
KeyValuePair.Create("anonymous_methods",
NewLineBeforeOpenBracePlacement
.AnonymousMethods),
56
KeyValuePair.Create("control_blocks",
NewLineBeforeOpenBracePlacement
.ControlBlocks),
57
KeyValuePair.Create("anonymous_types",
NewLineBeforeOpenBracePlacement
.AnonymousTypes),
58
KeyValuePair.Create("object_collection_array_initializers",
NewLineBeforeOpenBracePlacement
.ObjectCollectionArrayInitializers),
59
KeyValuePair.Create("lambdas",
NewLineBeforeOpenBracePlacement
.LambdaExpressionBody),
232
public static Option2<
NewLineBeforeOpenBracePlacement
> NewLineBeforeOpenBrace { get; } = CreateOption(
236
new EditorConfigValueSerializer<
NewLineBeforeOpenBracePlacement
>(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\CSharpFormattingOptions2.Parsers.cs (7)
76
internal static
NewLineBeforeOpenBracePlacement
ParseNewLineBeforeOpenBracePlacementList(string list)
77
=> (
NewLineBeforeOpenBracePlacement
)ParseEditorConfigFlags(
82
allValue: (int)
NewLineBeforeOpenBracePlacement
.All);
84
internal static string ToEditorConfigValue(
NewLineBeforeOpenBracePlacement
value)
87
NewLineBeforeOpenBracePlacement
.None => "none",
88
NewLineBeforeOpenBracePlacement
.All => "all",
89
_ => ToEditorConfigFlagList((int)value, static v => s_newLineOptionsEditorConfigMap[(
NewLineBeforeOpenBracePlacement
)v])
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\NewLineBeforeOpenBracePlacement.cs (23)
27
public static
NewLineBeforeOpenBracePlacement
ToNewLineBeforeOpenBracePlacement(this NewLinePlacement value)
28
=> (value.HasFlag(NewLinePlacement.BeforeOpenBraceInTypes) ?
NewLineBeforeOpenBracePlacement
.Types : 0) |
29
(value.HasFlag(NewLinePlacement.BeforeOpenBraceInMethods) ?
NewLineBeforeOpenBracePlacement
.Methods : 0) |
30
(value.HasFlag(NewLinePlacement.BeforeOpenBraceInProperties) ?
NewLineBeforeOpenBracePlacement
.Properties : 0) |
31
(value.HasFlag(NewLinePlacement.BeforeOpenBraceInAnonymousMethods) ?
NewLineBeforeOpenBracePlacement
.AnonymousMethods : 0) |
32
(value.HasFlag(NewLinePlacement.BeforeOpenBraceInControlBlocks) ?
NewLineBeforeOpenBracePlacement
.ControlBlocks : 0) |
33
(value.HasFlag(NewLinePlacement.BeforeOpenBraceInAnonymousTypes) ?
NewLineBeforeOpenBracePlacement
.AnonymousTypes : 0) |
34
(value.HasFlag(NewLinePlacement.BeforeOpenBraceInObjectCollectionArrayInitializers) ?
NewLineBeforeOpenBracePlacement
.ObjectCollectionArrayInitializers : 0) |
35
(value.HasFlag(NewLinePlacement.BeforeOpenBraceInLambdaExpressionBody) ?
NewLineBeforeOpenBracePlacement
.LambdaExpressionBody : 0) |
36
(value.HasFlag(NewLinePlacement.BeforeOpenBraceInAccessors) ?
NewLineBeforeOpenBracePlacement
.Accessors : 0);
38
public static NewLinePlacement ToNewLinePlacement(this
NewLineBeforeOpenBracePlacement
value)
39
=> (value.HasFlag(
NewLineBeforeOpenBracePlacement
.Types) ? NewLinePlacement.BeforeOpenBraceInTypes : 0) |
40
(value.HasFlag(
NewLineBeforeOpenBracePlacement
.Methods) ? NewLinePlacement.BeforeOpenBraceInMethods : 0) |
41
(value.HasFlag(
NewLineBeforeOpenBracePlacement
.Properties) ? NewLinePlacement.BeforeOpenBraceInProperties : 0) |
42
(value.HasFlag(
NewLineBeforeOpenBracePlacement
.AnonymousMethods) ? NewLinePlacement.BeforeOpenBraceInAnonymousMethods : 0) |
43
(value.HasFlag(
NewLineBeforeOpenBracePlacement
.ControlBlocks) ? NewLinePlacement.BeforeOpenBraceInControlBlocks : 0) |
44
(value.HasFlag(
NewLineBeforeOpenBracePlacement
.AnonymousTypes) ? NewLinePlacement.BeforeOpenBraceInAnonymousTypes : 0) |
45
(value.HasFlag(
NewLineBeforeOpenBracePlacement
.ObjectCollectionArrayInitializers) ? NewLinePlacement.BeforeOpenBraceInObjectCollectionArrayInitializers : 0) |
46
(value.HasFlag(
NewLineBeforeOpenBracePlacement
.LambdaExpressionBody) ? NewLinePlacement.BeforeOpenBraceInLambdaExpressionBody : 0) |
47
(value.HasFlag(
NewLineBeforeOpenBracePlacement
.Accessors) ? NewLinePlacement.BeforeOpenBraceInAccessors : 0);
49
public static
NewLineBeforeOpenBracePlacement
WithFlagValue(this
NewLineBeforeOpenBracePlacement
flags,
NewLineBeforeOpenBracePlacement
flag, bool value)