1 write to Labels
Microsoft.CodeAnalysis.Features (1)
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.AnalyzedNodes.cs (1)
32Labels = labels;
15 references to Labels
Microsoft.CodeAnalysis.CSharp.Features (6)
ConvertIfToSwitch\CSharpConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (6)
40if (section.Labels.IsDefault) 43var pattern = AsPatternSyntax(section.Labels[0].Pattern, feature); 44var whenClause = AsWhenClause(section.Labels[0]); 46Debug.Assert(whenClause == null || section.Labels.Length == 1, "We shouldn't have guards when we're combining multiple cases into a single arm"); 48for (var i = 1; i < section.Labels.Length; i++) 50var label = section.Labels[i];
Microsoft.CodeAnalysis.Features (9)
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.cs (7)
114var labelCount = sections.Sum(section => section.Labels.IsDefault ? 1 : section.Labels.Length); 127if (!sections.Any(static section => section.Labels.IsDefault)) 161if (section.Labels.IsDefault) 165if (section.Labels.Length == 1) 168if (section.Labels.Length == 0) 176return supportsOrPattern && section.Labels.All(label => label.Guards.IsDefaultOrEmpty);
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (2)
63var sectionNode = section.Labels.IsDefault 65: generator.SwitchSectionFromLabels(section.Labels.Select(label => AsSwitchLabelSyntax(label, feature)), statements);