LocalizationExtenderProvider クラス
メモ : このクラスは、互換性のために残されています。 旧式でない代替が必要な場合は、CodeDomLocalizationProvider を使用してください。
ローカリゼーション機能のデザイン時のサポートをルート デザイナに提供します。 名前空間: System.ComponentModel.Designアセンブリ: System.Design (system.design.dll 内)

<ObsoleteAttribute("This class has been deprecated. Use CodeDomLocalizationProvider instead. http://go.microsoft.com/fwlink/?linkid=14202")> _ Public Class LocalizationExtenderProvider Implements IExtenderProvider, IDisposable
[ObsoleteAttribute("This class has been deprecated. Use CodeDomLocalizationProvider instead. http://go.microsoft.com/fwlink/?linkid=14202")] public class LocalizationExtenderProvider : IExtenderProvider, IDisposable
[ObsoleteAttribute(L"This class has been deprecated. Use CodeDomLocalizationProvider instead. http://go.microsoft.com/fwlink/?linkid=14202")] public ref class LocalizationExtenderProvider : IExtenderProvider, IDisposable

LocalizationExtenderProvider は、.NET Framework のローカリセーション アーキテクチャのサポートを提供するプロパティやメソッドのセットを使用して、IRootDesigner を拡張できます。リソースの使用の詳細については、「ローカリゼーション」のトピックを参照してください。
ローカリゼーション サポート アーキテクチャを使用すると、デザイナは、実行時に交換できるリソース ファイルを使用して、コンポーネントのプロパティを初期化できるようになります。これにより、さまざまな言語、カルチャ固有のスタイル、および動的に構成可能な機能がサポートされます。このクラスのメソッドを使用すると、デザイナおよびコード生成シリアライザで、リソースからの読み込みとローカリゼーション機能を使用した初期化コードの作成が可能になります。
Visual Studio に同梱されている既定のシリアライザには、既にコンポーネントやコントロールをローカライズする機能がありますが、これが使用されるのは、.NET Framework のローカリゼーション アーキテクチャのサポートが見つかった場合だけです。ローカリゼーション サポートの存在を検出するには、シリアル化システムが、ルート デザイナ コンポーネント上で "Localizable" という名前のパブリックな Boolean プロパティを見つける必要があります。シリアライザは、このプロパティを見つけると、"Language" という名前の CultureInfo 型のプロパティを検索して、現在のリソース構成を確認します。既定のシリアライザは、これらのプロパティを使用して、コンポーネントのローカライズ可能なリソースをローカライズする必要があるかどうかを判断し、その必要がある場合は、リソース情報が保存される CultureInfo 形式を確認します。

LocalizationExtenderProvider をコンポーネントに追加するコード例を次に示します。
' Adds a LocalizationExtenderProvider that provides localization support properties to the specified component. extender = New LocalizationExtenderProvider(Me.component_.Site, Me.component_)
// Adds a LocalizationExtenderProvider that provides localization support properties to the specified component. extender = new LocalizationExtenderProvider(this.component.Site, this.component);
// Adds a LocalizationExtenderProvider that provides localization // support properties to the specified component. extender = new LocalizationExtenderProvider( this.component.get_Site(), this.component);
次に示すのは、サンプルのコンポーネントとデザイナを使用したコード例です。このデザイナは、LocalizationExtenderProvider を使用してコンポーネントのローカリゼーション サポート プロパティを追加します。
Imports System Imports System.Collections Imports System.ComponentModel Imports System.ComponentModel.Design Imports System.Diagnostics Imports System.Drawing Imports System.Windows.Forms Imports System.Windows.Forms.Design ' This example demonstrates adding localization support to a component hierarchy from a ' custom IRootDesigner using the LocalizationExtenderProvider class. ' RootViewDesignerComponent is a component associated with the SampleRootDesigner ' IRootDesigner that provides LocalizationExtenderProvider localization support. ' This derived class is included at the top of this example to enable ' easy launching of designer view without having to put the class in its own file. Public Class RootViewDesignerComponent Inherits RootDesignedComponent Public Sub New() End Sub End Class ' The following attribute associates the RootDesignedComponent with the RootDesignedComponent component. <Designer(GetType(SampleRootDesigner), GetType(IRootDesigner))> _ Public Class RootDesignedComponent Inherits Component Public Sub New() End Sub End Class ' Example IRootDesigner implementation demonstrates LocalizationExtenderProvider support. Friend Class SampleRootDesigner Implements IRootDesigner ' RootDesignerView Control provides a full region designer view for this root designer's associated component. Private m_view As RootDesignerView ' Stores reference to the LocalizationExtenderProvider this designer adds, in order to remove it on Dispose. Private extender As LocalizationExtenderProvider ' Internally stores the IDesigner's component reference Private component_ As IComponent ' Adds a LocalizationExtenderProvider for the component this designer is initialized to support. Public Sub Initialize(ByVal component As System.ComponentModel.IComponent) Implements IRootDesigner.Initialize Me.component_ = component ' If no extender from this designer is active... If extender Is Nothing Then ' Adds a LocalizationExtenderProvider that provides localization support properties to the specified component. extender = New LocalizationExtenderProvider(Me.component_.Site, Me.component_) End If End Sub ' Provides a RootDesignerView object that supports ViewTechnology.WindowsForms. Function GetView(ByVal technology As ViewTechnology) As Object Implements IRootDesigner.GetView If technology <> ViewTechnology.WindowsForms Then Throw New ArgumentException("Not a supported view technology", "technology") End If If m_view Is Nothing Then ' Create the view control. In this example, a Control of type RootDesignerView is used. ' A WindowsForms ViewTechnology view provider requires a class that inherits from Control. m_view = New RootDesignerView(Me, Me.Component) End If Return m_view End Function ' This designer supports the WindowsForms view technology. ReadOnly Property SupportedTechnologies() As ViewTechnology() Implements IRootDesigner.SupportedTechnologies Get Return New ViewTechnology() {ViewTechnology.WindowsForms} End Get End Property ' If a LocalizationExtenderProvider has been added, removes the extender provider. Protected Overloads Sub Dispose(ByVal disposing As Boolean) ' If an extender has been added, remove it If Not (extender Is Nothing) Then ' Disposes of the extender provider. The extender ' provider removes itself from the extender provider ' service when it is disposed. extender.Dispose() extender = Nothing End If End Sub ' Empty IDesigner interface property and method implementations Public ReadOnly Property Verbs() As System.ComponentModel.Design.DesignerVerbCollection Implements IDesigner.Verbs Get Return Nothing End Get End Property Public ReadOnly Property Component() As System.ComponentModel.IComponent Implements IRootDesigner.Component Get Return Me.component_ End Get End Property Public Sub DoDefaultAction() Implements IDesigner.DoDefaultAction End Sub Public Overloads Sub Dispose() Implements IDisposable.Dispose End Sub ' RootDesignerView is a simple control that will be displayed in the designer window. Private Class RootDesignerView Inherits Control Private m_designer As SampleRootDesigner Private comp As IComponent Public Sub New(ByVal designer As SampleRootDesigner, ByVal component As IComponent) m_designer = designer Me.comp = component BackColor = Color.Blue Font = New Font(FontFamily.GenericMonospace, 12) End Sub ' Displays the name of the component and the name of the assembly of the component ' that this root designer is providing support for. Protected Overrides Sub OnPaint(ByVal pe As PaintEventArgs) MyBase.OnPaint(pe) If Not (m_designer Is Nothing) AndAlso Not (comp Is Nothing) Then ' Draws the name of the component in large letters. pe.Graphics.DrawString("Root Designer View", Font, Brushes.Yellow, 8, 4) pe.Graphics.DrawString("Design Name : " + comp.Site.Name, New Font("Arial", 10), Brushes.Yellow, 8, 28) ' Uses the site of the component to acquire an ISelectionService and sets the property grid focus to the component. Dim selectionService As ISelectionService = CType(comp.Site.GetService(GetType(ISelectionService)), ISelectionService) If Not (selectionService Is Nothing) Then selectionService.SetSelectedComponents(New IComponent() {m_designer.Component}) End If End If End Sub End Class End Class
using System; using System.Collections; using System.ComponentModel; using System.ComponentModel.Design; using System.Diagnostics; using System.Drawing; using System.Windows.Forms; using System.Windows.Forms.Design; // This example demonstrates adding localization support to a component hierarchy from a // custom IRootDesigner using the LocalizationExtenderProvider class. namespace LocalizationExtenderProviderExample { // RootViewDesignerComponent is a component associated with the SampleRootDesigner // IRootDesigner that provides LocalizationExtenderProvider localization support. // This derived class is included at the top of this example to enable // easy launching of designer view without having to put the class in its own file. public class RootViewDesignerComponent : RootDesignedComponent { public RootViewDesignerComponent() { } } // The following attribute associates the RootDesignedComponent with the RootDesignedComponent component. [Designer(typeof(SampleRootDesigner), typeof(IRootDesigner))] public class RootDesignedComponent : Component { public RootDesignedComponent() { } } // Example IRootDesigner implementation demonstrates LocalizationExtenderProvider support. internal class SampleRootDesigner : IRootDesigner { // RootDesignerView Control provides a full region designer view for this root designer's associated component. private RootDesignerView m_view; // Stores reference to the LocalizationExtenderProvider this designer adds, in order to remove it on Dispose. private LocalizationExtenderProvider extender; // Internally stores the IDesigner's component reference private IComponent component; // Adds a LocalizationExtenderProvider for the component this designer is initialized to support. public void Initialize(System.ComponentModel.IComponent component) { this.component = component; // If no extender from this designer is active... if( extender == null ) { // Adds a LocalizationExtenderProvider that provides localization support properties to the specified component. extender = new LocalizationExtenderProvider(this.component.Site, this.component); } } // Provides a RootDesignerView object that supports ViewTechnology.WindowsForms. object IRootDesigner.GetView(ViewTechnology technology) { if (technology != ViewTechnology.WindowsForms) { throw new ArgumentException("Not a supported view technology", "technology"); } if (m_view == null ) { // Create the view control. In this example, a Control of type RootDesignerView is used. // A WindowsForms ViewTechnology view provider requires a class that inherits from Control. m_view = new RootDesignerView(this, this.Component); } return m_view; } // This designer supports the WindowsForms view technology. ViewTechnology[] IRootDesigner.SupportedTechnologies { get { return new ViewTechnology[] {ViewTechnology.WindowsForms}; } } // If a LocalizationExtenderProvider has been added, removes the extender provider. protected void Dispose(bool disposing) { // If an extender has been added, remove it if( extender != null ) { // Disposes of the extender provider. The extender // provider removes itself from the extender provider // service when it is disposed. extender.Dispose(); extender = null; } } // Empty IDesigner interface property and method implementations public System.ComponentModel.Design.DesignerVerbCollection Verbs { get { return null; } } public System.ComponentModel.IComponent Component { get { return this.component; } } public void DoDefaultAction() { } public void Dispose() { } // RootDesignerView is a simple control that will be displayed in the designer window. private class RootDesignerView : Control { private SampleRootDesigner m_designer; private IComponent comp; public RootDesignerView(SampleRootDesigner designer, IComponent component) { m_designer = designer; this.comp = component; BackColor = Color.Blue; Font = new Font(FontFamily.GenericMonospace, 12); } // Displays the name of the component and the name of the assembly of the component // that this root designer is providing support for. protected override void OnPaint(PaintEventArgs pe) { base.OnPaint(pe); if( m_designer != null && comp != null ) { // Draws the name of the component in large letters. pe.Graphics.DrawString("Root Designer View", Font, Brushes.Yellow, 8, 4); pe.Graphics.DrawString("Design Name : "+comp.Site.Name, new Font("Arial", 10), Brushes.Yellow, 8, 28); pe.Graphics.DrawString("Assembly : "+comp.GetType().AssemblyQualifiedName, new Font("Arial", 10), Brushes.Yellow, new Rectangle(new Point(8, 44), new Size(ClientRectangle.Width-8, ClientRectangle.Height-44))); // Uses the site of the component to acquire an ISelectionService and sets the property grid focus to the component. ISelectionService selectionService = (ISelectionService)comp.Site.GetService(typeof(ISelectionService)); if( selectionService != null ) selectionService.SetSelectedComponents( new IComponent[] { m_designer.component } ); } } } } }
package LocalizationExtenderProviderExample; import System.*; import System.Collections.*; import System.ComponentModel.*; import System.ComponentModel.Design.*; import System.Diagnostics.*; import System.Drawing.*; import System.Windows.Forms.*; import System.Windows.Forms.Design.*; // This example demonstrates adding localization support to a // component hierarchy from a custom IRootDesigner // using the LocalizationExtenderProvider class. // RootViewDesignerComponent is a component associated with the // SampleRootDesigner IRootDesigner that provides LocalizationExtenderProvider // localization support. This derived class is included at the top of this // example to enable easy launching of designer view without having to // put the class in its own file. public class RootViewDesignerComponent extends RootDesignedComponent { public RootViewDesignerComponent() { } //RootViewDesignerComponent } //RootViewDesignerComponent // The following attribute associates the RootDesignedComponent with the // RootDesignedComponent component. /** @attribute Designer(SampleRootDesigner.class, IRootDesigner.class) */ public class RootDesignedComponent extends Component { public RootDesignedComponent() { } //RootDesignedComponent } //RootDesignedComponent // Example IRootDesigner implementation demonstrates // LocalizationExtenderProvider support. class SampleRootDesigner implements IRootDesigner { // RootDesignerView Control provides a full region designer view for // this root designer's associated component. private RootDesignerView mView; // Stores reference to the LocalizationExtenderProvider this designer adds, // in order to remove it on Dispose. private LocalizationExtenderProvider extender; // Internally stores the IDesigner's component reference private IComponent component; // Adds a LocalizationExtenderProvider for the component this designer is // initialized to support. public void Initialize(System.ComponentModel.IComponent component) { this.component = component; // If no extender from this designer is active... if (extender == null) { // Adds a LocalizationExtenderProvider that provides localization // support properties to the specified component. extender = new LocalizationExtenderProvider( this.component.get_Site(), this.component); } } //Initialize // Provides a RootDesignerView object that supports // ViewTechnology.WindowsForms. public Object GetView(ViewTechnology technology) { if (!technology.Equals(ViewTechnology.WindowsForms)) { throw new ArgumentException("Not a supported view technology", "technology"); } if (mView == null) { // Create the view control. In this example, a Control of type // RootDesignerView is used. // A WindowsForms ViewTechnology view provider requires a class // that inherits from Control. mView = new RootDesignerView(this, this.component); } return mView; } //IRootDesigner.GetView // This designer supports the WindowsForms view technology. /** @property */ public ViewTechnology[] get_SupportedTechnologies() { return new ViewTechnology[] { ViewTechnology.WindowsForms }; } // get_SupportedTechnologies // If a LocalizationExtenderProvider has been added, // removes the extender provider. protected void Dispose(boolean disposing) { // If an extender has been added, remove it if (extender != null) { // Disposes of the extender provider. The extender // provider removes itself from the extender provider // service when it is disposed. extender.Dispose(); extender = null; } } //Dispose // Empty IDesigner interface property and method implementations /** @property */ public System.ComponentModel.Design.DesignerVerbCollection get_Verbs() { return null; } //get_Verbs /** @property */ public System.ComponentModel.IComponent get_Component() { return this.component; } //get_Component public void DoDefaultAction() { } //DoDefaultAction public void Dispose() { } //Dispose // RootDesignerView is a simple control that will be displayed // in the designer window. private class RootDesignerView extends Control { private SampleRootDesigner mDesigner; private IComponent comp; public RootDesignerView(SampleRootDesigner designer, IComponent component) { mDesigner = designer; this.comp = component; set_BackColor(Color.get_Blue()); set_Font(new Font(FontFamily.get_GenericMonospace(), 12)); } //RootDesignerView // Displays the name of the component and the name of the assembly of // the component that this root designer is providing support for. protected void OnPaint(PaintEventArgs pe) { super.OnPaint(pe); if (mDesigner != null && comp != null) { // Draws the name of the component in large letters. pe.get_Graphics().DrawString("Root Designer View", get_Font(), Brushes.get_Yellow(), 8, 4); pe.get_Graphics().DrawString("Design Name : " + comp.get_Site().get_Name(), new Font("Arial", 10), Brushes.get_Yellow(), 8, 28); pe.get_Graphics().DrawString("Assembly : " + comp.GetType().get_AssemblyQualifiedName(), new Font("Arial", 10), Brushes.get_Yellow(), new RectangleF(new PointF(8, 44), new SizeF((float)(get_ClientRectangle().get_Width() - 8), (float)(get_ClientRectangle().get_Height() - 44)))); // Uses the site of the component to acquire an // ISelectionService and sets the property grid focus // to the component. ISelectionService selectionService = (ISelectionService)(comp. get_Site().GetService(ISelectionService.class.ToType())); if (selectionService != null) { selectionService.SetSelectedComponents(new IComponent[] { mDesigner.component }); } } } //OnPaint } //RootDesignerView } //SampleRootDesigner

System.ComponentModel.Design.LocalizationExtenderProvider


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


LocalizationExtenderProvider コンストラクタ
アセンブリ: System.Design (system.design.dll 内)

Public Sub New ( _ serviceProvider As ISite, _ baseComponent As IComponent _ )
Dim serviceProvider As ISite Dim baseComponent As IComponent Dim instance As New LocalizationExtenderProvider(serviceProvider, baseComponent)
public LocalizationExtenderProvider ( ISite serviceProvider, IComponent baseComponent )
public: LocalizationExtenderProvider ( ISite^ serviceProvider, IComponent^ baseComponent )
public LocalizationExtenderProvider ( ISite serviceProvider, IComponent baseComponent )
public function LocalizationExtenderProvider ( serviceProvider : ISite, baseComponent : IComponent )

既定では、新しい LocalizationExtenderProvider は、現在の言語として、既定の汎用的な言語リソース設定である InvariantCulture を設定します。この設定では、デザイナは汎用言語リソースを参照するコードを生成します。ほかの CultureInfo オブジェクトを作成して、プログラムが実行時に使用できる、ローカライズされた別のリソース データを表したり識別したりできます。

' Adds a LocalizationExtenderProvider that provides localization support properties to the specified component. extender = New LocalizationExtenderProvider(Me.component_.Site, Me.component_)
// Adds a LocalizationExtenderProvider that provides localization support properties to the specified component. extender = new LocalizationExtenderProvider(this.component.Site, this.component);
// Adds a LocalizationExtenderProvider that provides localization // support properties to the specified component. extender = new LocalizationExtenderProvider( this.component.get_Site(), this.component);


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


LocalizationExtenderProvider メソッド

名前 | 説明 | |
---|---|---|
![]() | CanExtend | オブジェクトが、指定したオブジェクトに対してエクステンダ プロパティを提供できるかどうかを示します。 |
![]() | Dispose | オーバーロードされます。 LocalizationExtenderProvider によって使用されているリソースを解放します。 |
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetLanguage | 指定したオブジェクトの現在のリソース カルチャを取得します。 |
![]() | GetLoadLanguage | デザイン時にローカライズされるオブジェクトの値を初期化するときに使用する既定のリソース カルチャを取得します。 |
![]() | GetLocalizable | 指定したオブジェクトがリソースのローカリゼーションをサポートしているかどうかを示す値を取得します。 |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ResetLanguage | 指定したオブジェクトのリソース カルチャをリセットします。 |
![]() | SetLanguage | 指定したオブジェクトの現在のリソース カルチャとして、指定したリソース カルチャを設定します。 |
![]() | SetLocalizable | 指定したオブジェクトでローカライズされたリソースがサポートされているかどうかを示す値を設定します。 |
![]() | ShouldSerializeLanguage | 指定したオブジェクトがローカライズ可能な値をリソースに永続化する必要があるかどうかを示す値を取得します。 |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Dispose | オーバーロードされます。 LocalizationExtenderProvider によって使用されているリソースを解放します。 |
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

LocalizationExtenderProvider メンバ
ローカリゼーション機能のデザイン時のサポートをルート デザイナに提供します。
LocalizationExtenderProvider データ型で公開されるメンバを以下の表に示します。

名前 | 説明 | |
---|---|---|
![]() | LocalizationExtenderProvider | サービス プロバイダと基本コンポーネントを指定して、LocalizationExtenderProvider クラスの新しいインスタンスを初期化します。 |

名前 | 説明 | |
---|---|---|
![]() | CanExtend | オブジェクトが、指定したオブジェクトに対してエクステンダ プロパティを提供できるかどうかを示します。 |
![]() | Dispose | オーバーロードされます。 LocalizationExtenderProvider によって使用されているリソースを解放します。 |
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetLanguage | 指定したオブジェクトの現在のリソース カルチャを取得します。 |
![]() | GetLoadLanguage | デザイン時にローカライズされるオブジェクトの値を初期化するときに使用する既定のリソース カルチャを取得します。 |
![]() | GetLocalizable | 指定したオブジェクトがリソースのローカリゼーションをサポートしているかどうかを示す値を取得します。 |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ResetLanguage | 指定したオブジェクトのリソース カルチャをリセットします。 |
![]() | SetLanguage | 指定したオブジェクトの現在のリソース カルチャとして、指定したリソース カルチャを設定します。 |
![]() | SetLocalizable | 指定したオブジェクトでローカライズされたリソースがサポートされているかどうかを示す値を設定します。 |
![]() | ShouldSerializeLanguage | 指定したオブジェクトがローカライズ可能な値をリソースに永続化する必要があるかどうかを示す値を取得します。 |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Dispose | オーバーロードされます。 LocalizationExtenderProvider によって使用されているリソースを解放します。 |
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

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

- LocalizationExtenderProviderのページへのリンク