コード例 #1
0
 private bool IsAsyncFirstAssignmentStatement(Statement statement, out TypeDefinition asyncStateMachineType)
 {
     asyncStateMachineType = null;
     if (statement as ExpressionStatement != null)
     {
         V_0 = statement as ExpressionStatement;
         if (V_0.get_Expression() as BinaryExpression != null)
         {
             V_1 = V_0.get_Expression() as BinaryExpression;
             if (V_1.get_Right() as ThisReferenceExpression != null && V_1.get_Left() as FieldReferenceExpression != null)
             {
                 V_2 = (V_1.get_Left() as FieldReferenceExpression).get_Field().get_DeclaringType();
                 if (V_2 == null)
                 {
                     return(false);
                 }
                 V_3 = V_2.Resolve();
                 if (V_3 == null || (object)V_3.get_DeclaringType() != (object)this.methodContext.get_Method().get_DeclaringType() || !V_3.IsAsyncStateMachine())
                 {
                     return(false);
                 }
                 asyncStateMachineType = V_3;
                 return(true);
             }
         }
     }
     return(false);
 }