public static ICollection <ImplementedMember> GetExplicitlyImplementedEvents(this EventDefinition self) { V_0 = new List <ImplementedMember>(); if (!self.IsExplicitImplementation()) { return(V_0); } if (self.get_AddMethod() != null) { V_1 = self.get_AddMethod().GetExplicitlyImplementedMethods().GetEnumerator(); try { while (V_1.MoveNext()) { V_2 = V_1.get_Current(); V_3 = EventDefinitionExtensions.GetMethodDeclaringEvent(V_2.get_Member() as MethodReference); if (V_3 == null) { continue; } V_0.Add(new ImplementedMember(V_2.get_DeclaringType(), V_3)); } } finally { if (V_1 != null) { V_1.Dispose(); } } return(V_0); } if (self.get_RemoveMethod() == null) { return(V_0); } V_1 = self.get_RemoveMethod().GetExplicitlyImplementedMethods().GetEnumerator(); try { while (V_1.MoveNext()) { V_4 = V_1.get_Current(); V_5 = EventDefinitionExtensions.GetMethodDeclaringEvent(V_4.get_Member() as MethodReference); if (V_5 == null) { continue; } V_0.Add(new ImplementedMember(V_4.get_DeclaringType(), V_5)); } } finally { if (V_1 != null) { V_1.Dispose(); } } return(V_0); }
private bool CheckVariableInitialization(ExpressionStatement node) { if (!node.IsAssignmentStatement()) { return(false); } V_0 = node.get_Expression() as BinaryExpression; if (V_0.get_Left().get_CodeNodeType() != 26) { return(false); } V_1 = V_0.get_Right(); if (V_1.get_CodeNodeType() == 31) { V_1 = (V_1 as ExplicitCastExpression).get_Expression(); } if (V_1.get_CodeNodeType() != 22 || (V_1 as LiteralExpression).get_Value() != null && V_1.get_CodeNodeType() != 30) { return(false); } if (V_1.get_CodeNodeType() == 30) { V_2 = V_1 as FieldReferenceExpression; V_3 = V_2.get_ExpressionType().Resolve(); if (V_3 == null || V_3.get_BaseType() == null || String.op_Inequality(V_3.get_BaseType().get_FullName(), "System.MulticastDelegate")) { return(false); } V_4 = V_2.get_Field().Resolve(); if ((object)V_4.get_DeclaringType() != (object)this.context.get_MethodContext().get_Method().get_DeclaringType() && !V_4.get_DeclaringType().IsNestedIn(this.context.get_MethodContext().get_Method().get_DeclaringType()) || !V_4.get_DeclaringType().IsCompilerGenerated()) { return(false); } } this.initializationsToRemove.set_Item((V_0.get_Left() as VariableReferenceExpression).get_Variable(), node); return(true); }