ComponentChangingEventHandler デリゲート
アセンブリ: System (system.dll 内)

<ComVisibleAttribute(True)> _ Public Delegate Sub ComponentChangingEventHandler ( _ sender As Object, _ e As ComponentChangingEventArgs _ )
[ComVisibleAttribute(true)] public delegate void ComponentChangingEventHandler ( Object sender, ComponentChangingEventArgs e )
[ComVisibleAttribute(true)] public delegate void ComponentChangingEventHandler ( Object^ sender, ComponentChangingEventArgs^ e )
/** @delegate */ /** @attribute ComVisibleAttribute(true) */ public delegate void ComponentChangingEventHandler ( Object sender, ComponentChangingEventArgs e )

ComponentChangingEventHandler デリゲートを作成する場合は、イベントを処理するメソッドを識別してください。イベントをイベント ハンドラに関連付けるには、デリゲートのインスタンスをイベントに追加します。デリゲートを削除しない限り、そのイベントが発生すると常にイベント ハンドラが呼び出されます。イベント ハンドラ デリゲートの詳細については、「イベントとデリゲート」を参照してください。
![]() |
---|
このクラスに適用される HostProtectionAttribute 属性の Resources プロパティの値は、SharedState です。HostProtectionAttribute は、デスクトップ アプリケーション (一般的には、アイコンをダブルクリック、コマンドを入力、またはブラウザに URL を入力して起動するアプリケーション) には影響しません。詳細については、HostProtectionAttribute クラスのトピックまたは「SQL Server プログラミングとホスト保護属性」を参照してください。 |

ComponentChangingEventHandler の登録と ComponentChanging イベントの処理の例を次に示します。
Public Sub LinkComponentChangingEvent(ByVal changeService As IComponentChangeService) ' Registers an event handler for the ComponentChanging event. AddHandler changeService.ComponentChanging, AddressOf Me.OnComponentChanging End Sub Private Sub OnComponentChanging(ByVal sender As Object, ByVal e As ComponentChangingEventArgs) ' Displays changing component information on the console. Console.WriteLine(("Type of the component that is about to change: " + e.Component.GetType().FullName)) Console.WriteLine(("Name of the member of the component that is about to change: " + e.Member.Name)) End Sub
public void LinkComponentChangingEvent(IComponentChangeService changeService) { // Registers an event handler for the ComponentChanging event. changeService.ComponentChanging += new ComponentChangingEventHandler(this.OnComponentChanging); } private void OnComponentChanging(object sender, ComponentChangingEventArgs e) { // Displays changing component information on the console. Console.WriteLine("Type of the component that is about to change: "+e.Component.GetType().FullName); Console.WriteLine("Name of the member of the component that is about to change: "+e.Member.Name); }
public: void LinkComponentChangingEvent( IComponentChangeService^ changeService ) { // Registers an event handler for the ComponentChanging event. changeService->ComponentChanging += gcnew ComponentChangingEventHandler( this, &ComponentChangingEventHandlerExample::OnComponentChanging ); } private: void OnComponentChanging( Object^ sender, ComponentChangingEventArgs^ e ) { // Displays changing component information on the console. Console::WriteLine( "Type of the component that is about to change: " + e->Component->GetType()->FullName ); Console::WriteLine( "Name of the member of the component that is about to change: " + e->Member->Name ); }
public void LinkComponentChangingEvent(IComponentChangeService changeService) { // Registers an event handler for the ComponentChanging event. changeService.add_ComponentChanging(new ComponentChangingEventHandler( this.OnComponentChanging)); } //LinkComponentChangingEvent private void OnComponentChanging(Object sender, ComponentChangingEventArgs e) { // Displays changing component information on the console. Console.WriteLine("Type of the component that is about to change: " + e.get_Component().GetType().get_FullName()); Console.WriteLine("Name of the member of the component that is about" + " to change: " + e.get_Member().get_Name()); } //OnComponentChanging

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- ComponentChangingEventHandler デリゲートのページへのリンク