示例#1
0
 private TypeDefinition GetGeneratedType()
 {
     if (this.statements.get_Item(0).get_CodeNodeType() != 5)
     {
         return(null);
     }
     V_0 = this.statements.get_Item(0) as ExpressionStatement;
     if (V_0.get_Expression().get_CodeNodeType() != 24)
     {
         if (V_0.get_Expression().get_CodeNodeType() != 57)
         {
             return(null);
         }
         V_5 = V_0.get_Expression() as ReturnExpression;
         if (V_5.get_Value() == null || V_5.get_Value().get_CodeNodeType() != 40)
         {
             return(null);
         }
         V_1 = V_5.get_Value() as ObjectCreationExpression;
     }
     else
     {
         if (!(V_0.get_Expression() as BinaryExpression).get_IsAssignmentExpression())
         {
             return(null);
         }
         V_4 = V_0.get_Expression() as BinaryExpression;
         if (V_4.get_Right().get_CodeNodeType() != 40)
         {
             return(null);
         }
         V_1 = V_4.get_Right() as ObjectCreationExpression;
     }
     V_2 = V_1.get_Constructor();
     if (V_2 == null || V_2.get_DeclaringType() == null)
     {
         return(null);
     }
     V_3 = V_2.get_DeclaringType().Resolve();
     if (V_3 != null && V_3.get_IsNestedPrivate() && V_3.HasCompilerGeneratedAttribute())
     {
         return(V_3);
     }
     return(null);
 }