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

Public Delegate Sub ActiveDesignerEventHandler ( _ sender As Object, _ e As ActiveDesignerEventArgs _ )
/** @delegate */ public delegate void ActiveDesignerEventHandler ( Object sender, ActiveDesignerEventArgs e )

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

ActiveDesignerEventHandler の登録と ActiveDesignerChanged イベントの処理の例を次に示します。
Public Sub LinkActiveDesignerEvent(ByVal eventService As IDesignerEventService) ' Registers an event handler for the ActiveDesignerChanged event. AddHandler eventService.ActiveDesignerChanged, AddressOf Me.OnActiveDesignerEvent End Sub Private Sub OnActiveDesignerEvent(ByVal sender As Object, ByVal e As ActiveDesignerEventArgs) ' Displays changed designer information on the console. If Not (e.NewDesigner.RootComponent.Site Is Nothing) Then Console.WriteLine(("Name of the component of the new active designer: " + e.NewDesigner.RootComponent.Site.Name)) End If Console.WriteLine(("Type of the component of the new active designer: " + e.NewDesigner.RootComponentClassName)) If Not (e.OldDesigner.RootComponent.Site Is Nothing) Then Console.WriteLine(("Name of the component of the previously active designer: " + e.OldDesigner.RootComponent.Site.Name)) End If Console.WriteLine(("Type of the component of the previously active designer: " + e.OldDesigner.RootComponentClassName)) End Sub
public void LinkActiveDesignerEvent(IDesignerEventService eventService) { // Registers an event handler for the ActiveDesignerChanged event. eventService.ActiveDesignerChanged += new ActiveDesignerEventHandler(this.OnActiveDesignerEvent); } private void OnActiveDesignerEvent(object sender, ActiveDesignerEventArgs e) { // Displays changed designer information on the console. if( e.NewDesigner.RootComponent.Site != null ) Console.WriteLine("Name of the component of the new active designer: "+e.NewDesigner.RootComponent.Site.Name); Console.WriteLine("Type of the component of the new active designer: "+e.NewDesigner.RootComponentClassName); if( e.OldDesigner.RootComponent.Site != null ) Console.WriteLine("Name of the component of the previously active designer: "+e.OldDesigner.RootComponent.Site.Name); Console.WriteLine("Type of the component of the previously active designer: "+e.OldDesigner.RootComponentClassName); }
public: void LinkActiveDesignerEvent( IDesignerEventService^ eventService ) { // Registers an event handler for the ActiveDesignerChanged event. eventService->ActiveDesignerChanged += gcnew ActiveDesignerEventHandler( this, &MiscCompModSamples::ActiveDesignerEventHandlerExample::OnActiveDesignerEvent ); } private: void OnActiveDesignerEvent( Object^ /*sender*/, ActiveDesignerEventArgs^ e ) { // Displays changed designer information on the console. if ( e->NewDesigner->RootComponent->Site != nullptr ) { Console::WriteLine( "Name of the component of the new active designer: {0}", e->NewDesigner->RootComponent->Site->Name ); } Console::WriteLine( "Type of the component of the new active designer: {0}", e->NewDesigner->RootComponentClassName ); if ( e->OldDesigner->RootComponent->Site != nullptr ) { Console::WriteLine( "Name of the component of the previously active designer: {0}", e->OldDesigner->RootComponent->Site->Name ); } Console::WriteLine( "Type of the component of the previously active designer: {0}", e->OldDesigner->RootComponentClassName ); }
public void LinkActiveDesignerEvent(IDesignerEventService eventService) { // Registers an event handler for the ActiveDesignerChanged event. eventService.add_ActiveDesignerChanged(new ActiveDesignerEventHandler( this.OnActiveDesignerEvent)); } //LinkActiveDesignerEvent private void OnActiveDesignerEvent(Object sender, ActiveDesignerEventArgs e) { // Displays changed designer information on the console. if (e.get_NewDesigner().get_RootComponent().get_Site() != null) { Console.WriteLine("Name of the component of the new active designer: " + e.get_NewDesigner().get_RootComponent().get_Site().get_Name()); } Console.WriteLine("Type of the component of the new active designer: " + e.get_NewDesigner().get_RootComponentClassName()); if (e.get_OldDesigner().get_RootComponent().get_Site() != null) { Console.WriteLine("Name of the component of the previously active" + " designer: " + e.get_OldDesigner().get_RootComponent(). get_Site().get_Name()); } Console.WriteLine("Type of the component of the previously active " + " designer: " + e.get_OldDesigner().get_RootComponentClassName()); } //OnActiveDesignerEvent

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からActiveDesignerEventHandler デリゲートを検索する場合は、下記のリンクをクリックしてください。

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