Condividi tramite


CodeDomEventBindingService.FreeMethod Method

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)

Syntax

'Dichiarazione
Protected Overrides Sub FreeMethod ( _
    component As IComponent, _
    e As EventDescriptor, _
    methodName As String _
)
'Utilizzo
Dim component As IComponent
Dim e As EventDescriptor
Dim methodName As String

Me.FreeMethod(component, e, methodName)
protected override void FreeMethod(
    IComponent component,
    EventDescriptor e,
    string methodName
)
protected:
virtual void FreeMethod(
    IComponent^ component, 
    EventDescriptor^ e, 
    String^ methodName
) override
abstract FreeMethod : 
        component:IComponent * 
        e:EventDescriptor * 
        methodName:string -> unit 
override FreeMethod : 
        component:IComponent * 
        e:EventDescriptor * 
        methodName:string -> unit 
protected override function FreeMethod(
    component : IComponent, 
    e : EventDescriptor, 
    methodName : String
)

Parameters

  • methodName
    Type: System.String
    The name of the method to remove.

Remarks

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.

.NET Framework Security

See Also

Reference

CodeDomEventBindingService Class

CodeDomEventBindingService Members

Microsoft.VisualStudio.Shell.Design.Serialization.CodeDom Namespace