IExtenderListService 인터페이스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
Extender 공급자를 나열할 수 있는 인터페이스를 제공합니다.
public interface class IExtenderListService
public interface IExtenderListService
type IExtenderListService = interface
Public Interface IExtenderListService
예제
다음 예제에서는 를 사용하여 IExtenderListService 현재 활성 extender 공급자 집합을 가져오는 방법을 보여 줍니다.
#using <system.dll>
#using <system.drawing.dll>
#using <system.windows.forms.dll>
using namespace System;
using namespace System::Drawing;
using namespace System::ComponentModel;
using namespace System::ComponentModel::Design;
using namespace System::Windows::Forms;
namespace ExtenderListServiceExample
{
// This control lists any active extender providers.
public ref class ExtenderListServiceControl: public UserControl
{
private:
IExtenderListService^ extenderListService;
array<String^>^extenderNames;
public:
ExtenderListServiceControl()
{
this->Width = 600;
}
property ISite^ Site
{
// Queries the IExtenderListService when the control is sited
// in design mode.
virtual ISite^ get() override
{
return __super::Site;
}
virtual void set( ISite^ value ) override
{
__super::Site = value;
if ( this->DesignMode )
{
extenderListService = dynamic_cast<IExtenderListService^>(this->GetService( IExtenderListService::typeid ));
if ( extenderListService != nullptr )
{
array<IExtenderProvider^>^extenders = extenderListService->GetExtenderProviders();
extenderNames = gcnew array<String^>(extenders->Length);
for ( int i = 0; i < extenders->Length; i++ )
extenderNames[ i ] = String::Concat( "ExtenderProvider #", i.ToString(), ": ", extenders[ i ]->GetType()->FullName );
}
}
else
{
extenderListService = nullptr;
}
}
}
protected:
// Draws a list of any active extender providers
virtual void OnPaint( PaintEventArgs^ e ) override
{
if ( extenderNames->Length == 0 )
e->Graphics->DrawString( "No active extender providers", gcnew System::Drawing::Font( "Arial",9 ), gcnew SolidBrush( Color::Black ), 10, 10 );
else
e->Graphics->DrawString( "List of types of active extender providers", gcnew System::Drawing::Font( "Arial",9 ), gcnew SolidBrush( Color::Black ), 10, 10 );
for ( int i = 0; i < extenderNames->Length; i++ )
e->Graphics->DrawString( extenderNames[ i ], gcnew System::Drawing::Font( "Arial",8 ), gcnew SolidBrush( Color::Black ), 10, 25 + (i * 10) );
}
};
}
using System;
using System.Collections;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
namespace ExtenderListServiceExample
{
// This control lists any active extender providers.
public class ExtenderListServiceControl : System.Windows.Forms.UserControl
{
private IExtenderListService extenderListService;
private string[] extenderNames;
public ExtenderListServiceControl()
{
extenderNames = new string[0];
this.Width = 600;
}
// Queries the IExtenderListService when the control is sited
// in design mode.
public override System.ComponentModel.ISite Site
{
get
{
return base.Site;
}
set
{
base.Site = value;
if( this.DesignMode )
{
extenderListService = (IExtenderListService)this.GetService(typeof(IExtenderListService));
if( extenderListService != null )
{
IExtenderProvider[] extenders = extenderListService.GetExtenderProviders();
extenderNames = new string[extenders.Length];
for( int i=0; i<extenders.Length; i++ )
extenderNames[i] = "ExtenderProvider #"+i.ToString()+": "+extenders[i].GetType().FullName;
}
}
else
{
extenderListService = null;
extenderNames = new string[0];
}
}
}
// Draws a list of any active extender providers
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
{
if( extenderNames.Length == 0 )
e.Graphics.DrawString("No active extender providers", new Font("Arial", 9), new SolidBrush(Color.Black), 10, 10);
else
e.Graphics.DrawString("List of types of active extender providers", new Font("Arial", 9), new SolidBrush(Color.Black), 10, 10);
for(int i=0; i<extenderNames.Length; i++)
e.Graphics.DrawString(extenderNames[i], new Font("Arial", 8), new SolidBrush(Color.Black), 10, 25+(i*10));
}
}
}
Imports System.Collections
Imports System.ComponentModel
Imports System.ComponentModel.Design
Imports System.Drawing
Imports System.Data
Imports System.Windows.Forms
' This control lists any active extender providers.
Public Class ExtenderListServiceControl
Inherits System.Windows.Forms.UserControl
Private extenderListService As IExtenderListService
Private extenderNames() As String
Public Sub New()
extenderNames = New String(-1) {}
Me.Width = 600
End Sub
' Queries the IExtenderListService when the control is sited
' in design mode.
Public Overrides Property Site() As System.ComponentModel.ISite
Get
Return MyBase.Site
End Get
Set(ByVal Value As System.ComponentModel.ISite)
MyBase.Site = Value
If Me.DesignMode Then
extenderListService = CType(Me.GetService(GetType(IExtenderListService)), IExtenderListService)
If (extenderListService IsNot Nothing) Then
Dim extenders As IExtenderProvider() = extenderListService.GetExtenderProviders()
extenderNames = New String(extenders.Length) {}
Dim i As Integer
For i = 0 To extenders.Length - 1
Dim types As Type() = Type.GetTypeArray(extenders)
extenderNames(i) = "ExtenderProvider #" + i.ToString() + ": " + types(i).FullName
Next i
End If
Else
extenderListService = Nothing
extenderNames = New String(-1) {}
End If
End Set
End Property
' Draws a list of any active extender providers
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
If extenderNames.Length = 0 Then
e.Graphics.DrawString("No active extender providers", New Font("Arial", 9), New SolidBrush(Color.Black), 10, 10)
Else
e.Graphics.DrawString("List of types of active extender providers", New Font("Arial", 9), New SolidBrush(Color.Black), 10, 10)
End If
Dim i As Integer
For i = 0 To extenderNames.Length - 1
e.Graphics.DrawString(extenderNames(i), New Font("Arial", 8), New SolidBrush(Color.Black), 10, 25 + i * 10)
Next i
End Sub
End Class
설명
확장기 공급자 목록을 제공하려는 경우 사이트에서 이 서비스를 구현할 수 있습니다. 기본적으로 extender 목록은 각각 제공하는 extender에 대해 를 구현 IExtenderProvider 하는 컨테이너의 각 구성 요소를 쿼리하여 생성됩니다. 구성 요소 사이트에서 이 인터페이스를 구현하면 컨테이너가 공급자 목록을 재정의할 수 있습니다.
메서드
GetExtenderProviders() |
구성 요소에 대한 Extender 공급자 집합을 가져옵니다. |
적용 대상
추가 정보
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET