private bool TryRemoveOuterTryCatch(StatementCollection statements) { V_0 = 0; while (V_0 < statements.get_Count()) { V_3 = statements.get_Item(V_0); if (V_3.get_CodeNodeType() == 17 && (V_3 as TryStatement).get_CatchClauses().get_Count() == 1) { break; } V_0 = V_0 + 1; } if (V_0 == statements.get_Count()) { return(false); } V_1 = statements.get_Item(V_0) as TryStatement; V_2 = V_1.get_Try().get_Statements(); if (this.asyncData.get_StateField() == null && !this.TryGetStateField(V_1.get_CatchClauses().get_Item(0).get_Body())) { return(false); } statements.RemoveAt(V_0); V_4 = 0; while (V_4 < V_2.get_Count()) { statements.Insert(V_0 + V_4, V_2.get_Item(V_4)); V_4 = V_4 + 1; } return(true); }
private bool TryRemoveOuterTryCatch(StatementCollection statements) { int index = 0; for (; index < statements.Count; index++) { Statement currentStatement = statements[index]; if (currentStatement.CodeNodeType == CodeNodeType.TryStatement && (currentStatement as TryStatement).CatchClauses.Count == 1) { break; } } if (index == statements.Count) { return(false); } TryStatement theTry = statements[index] as TryStatement; StatementCollection tryStatements = theTry.Try.Statements; if (asyncData.StateField == null && !TryGetStateField(theTry.CatchClauses[0].Body)) { return(false); } statements.RemoveAt(index); for (int i = 0; i < tryStatements.Count; i++) { statements.Insert(index + i, tryStatements[i]); } return(true); }
private bool TryRemoveOuterTryCatch(StatementCollection statements) { int index = 0; for (; index < statements.Count; index++) { Statement currentStatement = statements[index]; if (currentStatement.CodeNodeType == CodeNodeType.TryStatement && (currentStatement as TryStatement).CatchClauses.Count == 1) { break; } } if (index == statements.Count) { return false; } TryStatement theTry = statements[index] as TryStatement; StatementCollection tryStatements = theTry.Try.Statements; if (asyncData.StateField == null && !TryGetStateField(theTry.CatchClauses[0].Body)) { return false; } statements.RemoveAt(index); for (int i = 0; i < tryStatements.Count; i++) { statements.Insert(index + i, tryStatements[i]); } return true; }