15 references to Labels
Microsoft.CodeAnalysis.CSharp.Features (6)
ConvertIfToSwitch\CSharpConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (6)
39if (section.Labels.IsDefault) 42var pattern = AsPatternSyntax(section.Labels[0].Pattern, feature); 43var whenClause = AsWhenClause(section.Labels[0]); 45Debug.Assert(whenClause == null || section.Labels.Length == 1, "We shouldn't have guards when we're combining multiple cases into a single arm"); 47for (var i = 1; i < section.Labels.Length; i++) 49var label = section.Labels[i];
Microsoft.CodeAnalysis.Features (9)
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.cs (7)
115var labelCount = sections.Sum(section => section.Labels.IsDefault ? 1 : section.Labels.Length); 128if (!sections.Any(static section => section.Labels.IsDefault)) 162if (section.Labels.IsDefault) 166if (section.Labels.Length == 1) 169if (section.Labels.Length == 0) 177return supportsOrPattern && section.Labels.All(label => label.Guards.IsDefaultOrEmpty);
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (2)
61var sectionNode = section.Labels.IsDefault 63: generator.SwitchSectionFromLabels(section.Labels.Select(label => AsSwitchLabelSyntax(label, feature)), statements);