public virtual void CompletionAddControlStructures(ICompletionListBuilder items) { AddControlStructure <IfBlock>("if", items); if (this.Prev is IfBlock || this.Prev is ElseBlock) { AddControlStructure <ElseBlock>("else", items); } AddControlStructure <WhileBlock>("while", items); AddControlStructure <DoWhileBlock>("do", items); AddControlStructure <ForBlock>("for", items); AddControlStructure <ForeachBlock>("foreach", items); AddControlStructure <LockBlock>("lock", items); AddControlStructure <TryBlock>("try", items); if (this.Prev is TryBlock || this.Prev is CatchBlock) { AddControlStructure <CatchBlock>("catch", items); AddControlStructure <FinallyBlock>("finally", items); } AddControlStructure <UsingStatementBlock>("using", items); if (this.Next == null && ClassNavigator.FindContainingControlStructure(this) != null) { AddControlStructure <BreakStatement>("break", items); AddControlStructure <ContinueStatement>("continue", items); } }
private ContainerBlock FindNearestControlStructureParent() { return(ClassNavigator.FindContainingControlStructure(this)); }