CodeDomEventBindingService::FreeMethod Method (IComponent^, EventDescriptor^, String^)

 

Removes the specified method from the code if no event handlers are using it and it is empty.

Namespace:   Microsoft.VisualStudio.Shell.Design.Serialization.CodeDom
Assembly:  Microsoft.VisualStudio.Shell.Design (in Microsoft.VisualStudio.Shell.Design.dll)

protected:
virtual void FreeMethod(
	IComponent^ component,
	EventDescriptor^ e,
	String^ methodName
) override

Parameters

component
Type: System.ComponentModel::IComponent^

IComponent.

e
Type: System.ComponentModel::EventDescriptor^

EventDescriptor.

methodName
Type: System::String^

The name of the method to remove.

This method removes the method from the code if the number of event handlers using the method is zero and the number of statements inside the method is zero also. If the handler count and the statement count are both non-zero, or if there was an exception when parsing the method statements (indicating that there was non-CLS-compliant code), the method is not removed.

Return to top
Show: