public CreateReachabilityAnalysis ( Statement statement, ICSharpCode.NRefactory.CSharp.Analysis.ReachabilityAnalysis recursiveDetectorVisitor = null ) : ICSharpCode.NRefactory.CSharp.Analysis.ReachabilityAnalysis | ||
statement | Statement | /// The statement to start the analysis. /// |
recursiveDetectorVisitor | ICSharpCode.NRefactory.CSharp.Analysis.ReachabilityAnalysis | /// TODO. /// |
Résultat | ICSharpCode.NRefactory.CSharp.Analysis.ReachabilityAnalysis |
static void CollectSwitchSectionStatements(AstNodeCollection <Statement> result, BaseRefactoringContext context, Statement statement) { BlockStatement blockStatement = statement as BlockStatement; if (blockStatement != null) { result.AddRange(blockStatement.Statements.Select(s => s.Clone())); } else { result.Add(statement.Clone()); } // add 'break;' at end if necessary var reachabilityAnalysis = context.CreateReachabilityAnalysis(statement); if (reachabilityAnalysis.IsEndpointReachable(statement)) { result.Add(new BreakStatement()); } }