ViewTechnology 列挙体とは? わかりやすく解説

ViewTechnology 列挙体

デザイナ ホストサポートする一連の技術識別子定義します

名前空間: System.ComponentModel.Design
アセンブリ: System (system.dll 内)
構文構文

<ComVisibleAttribute(True)> _
Public Enumeration ViewTechnology
Dim instance As ViewTechnology
[ComVisibleAttribute(true)] 
public enum ViewTechnology
[ComVisibleAttribute(true)] 
public enum class ViewTechnology
/** @attribute ComVisibleAttribute(true) */ 
public enum ViewTechnology
ComVisibleAttribute(true) 
public enum ViewTechnology
メンバメンバ
 メンバ説明
Default既定ビュー技術サポート指定します。  

ルート デザイナ任意の型のオブジェクト返すことができますが、オブジェクトにはホスト技術アダプタとの互換性がある必要がありますVisual Studio などのホスト環境には、新しビュー技術アダプタ組み込むための手段も用意されています。Windows フォーム デザイナ既定ビュー オブジェクトは System.Windows.Forms.Control インスタンスです。

Passthroughビュー オブジェクト開発環境直接渡すモード表します。  

ビュー オブジェクトは、開発環境要求するすべてのインターフェイス実装する必要がありますVisual Studio 開発環境は、ActiveX コントロールアクティブ ドキュメント、または Visual Studio VSI (Visual Studio Integration) プログラム通じて利用できる IVsWindowPane インターフェイス実装したオブジェクトいずれかビュー オブジェクトサポートしてます。Visual Studio 開発環境では、このビュー技術サポートしてます。このビュー技術は、すべての開発環境サポートされているわけではありません。

WindowsFormsWindows フォーム コントロール オブジェクトルート デザイナにおける表示提供するモード表します。  

デザイナ ホストは、開発環境ドキュメント ウィンドウWindows フォーム コントロール表示します

解説解説

ビュー アダプタ モデルViewTechnology 機能後継であり、新し機能追加しますが、選択により、下位互換性および将来使用のために ViewTechnology保持することもできます詳細については、Windows フォームサポート技術情報 (http://windowsforms.net/articles/shapedesigner.aspx) で「.NET Shape Library: A Sample Designer」を参照してください

ViewTechnology は、デザイナホストするドキュメント表示制御するモードを示す識別子定義します

デザイナ ホスト環境では、Default だけを使用します以前のバージョン.NET Framework では、ViewTechnology 列挙体がルート デザイナサポートされている UI モデルの種類指定指定していました。このモデルには拡張性がないため、代わりに view adapter モデル使用する必要がありますビュー アダプタは、オブジェクトの型を別の型に合わせて調整する型です。

たとえば、HTML デザイナはそのビューとして DemoDOM ツリー返しますHTML デザイナDefaultビュー技術返しますWindows フォーム ホスト環境では、1 つ上のビュー アダプタ クラス使用できますそのようなクラスDemoDOMWindows フォーム コントロール変換できた場合は、ホスト アプリケーションがこの種類デザイナサポートできますデザイナの GetView メソッドから返されデータ型処理できるアダプタない場合は、デザイナ読み込み失敗しユーザーエラー表示されます。

Visual Studio は、ビュー アダプタ提供するための拡張可能なスキーム備えているため、UI 技術合わせて調整できますサードパーティ テクノロジ プロバイダからビュー アダプタ提供される可能性あります。それらのオブジェクト モデルはすぐに使用できます

ビュー アダプタ使用する例については、Windows フォームサポート技術情報 (http://windowsforms.net/articles/shapedesigner.aspx) で「.NET Shape Library: A Sample Designer」を参照してください

使用例使用例

デザイナViewTechnology クラス使用する方法コード例次に示します。このコード例は IRootDesigner インターフェイストピック取り上げているコード例一部分です。

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

Namespace SampleRootDesigner

    ' This sample demonstrates how to provide the root designer view,
 or
    ' design mode background view, by overriding IRootDesigner.GetView().

    ' This sample component inherits from RootDesignedComponent which
 
    ' uses the SampleRootDesigner.
    Public Class RootViewSampleComponent
        Inherits RootDesignedComponent

        Public Sub New()
        End Sub

    End Class

    ' The following attribute associates the SampleRootDesigner designer
 
    ' with the SampleComponent component.
    <Designer(GetType(SampleRootDesigner), GetType(IRootDesigner))>
 _
    Public Class RootDesignedComponent
        Inherits Component

        Public Sub New()
        End Sub 

    End Class 

    Public Class SampleRootDesigner
        Inherits ComponentDesigner
        Implements IRootDesigner

        ' Member field of custom type RootDesignerView, a control that
 
        ' will be shown in the Forms designer view. This member is 
        ' cached to reduce processing needed to recreate the 
        ' view control on each call to GetView().
        Private m_view As RootDesignerView

        ' This method returns an instance of the view for this root
        ' designer. The "view" is the user interface that
 is presented
        ' in a document window for the user to manipulate. 
        Function GetView(ByVal technology As
 ViewTechnology) As Object Implements
 IRootDesigner.GetView
            If Not technology = ViewTechnology.Default
 Then
                Throw New ArgumentException("Not
 a supported view technology", "technology")
            End If
            If m_view Is Nothing
 Then
                ' Some type of displayable Form or control is required
 for a root designer that overrides 
                ' GetView(). In this example, a Control of type RootDesignerView
 is used.
                ' Any class that inherits from Control will work. 
                m_view = New RootDesignerView(Me)
            End If
            Return m_view
        End Function 

        ' IRootDesigner.SupportedTechnologies is a required override
 for an 
        ' IRootDesigner. Default is the view technology used by this
 designer.
        ReadOnly Property SupportedTechnologies()
 As ViewTechnology() Implements IRootDesigner.SupportedTechnologies
            Get
                Return New ViewTechnology()
 {ViewTechnology.Default}
            End Get
        End Property

        ' RootDesignerView is a simple control that will be displayed
 
        ' in the designer window.
        Private Class RootDesignerView
            Inherits Control
            Private m_designer As SampleRootDesigner

            Public Sub New(ByVal
 designer As SampleRootDesigner)
                m_designer = designer
                BackColor = Color.Blue
                Font = New Font(Font.FontFamily.Name, 24.0F)
            End Sub 

            Protected Overrides Sub
 OnPaint(ByVal pe As PaintEventArgs)
                MyBase.OnPaint(pe)
                ' Draws the name of the component in large letters.
                Dim rf As New
 RectangleF(ClientRectangle.X, ClientRectangle.Y, ClientRectangle.Width, ClientRectangle.Height)
                pe.Graphics.DrawString(m_designer.Component.Site.Name, Font, Brushes.Yellow,
 rf)
            End Sub 

        End Class
    End Class

End Namespace 
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;

namespace SampleRootDesigner
{    
    // This sample demonstrates how to provide the root designer view,
 or
    // design mode background view, by overriding IRootDesigner.GetView().

    // This sample component inherits from RootDesignedComponent which
 
    // uses the SampleRootDesigner.
    public class RootViewSampleComponent :
 RootDesignedComponent
    {
        public RootViewSampleComponent()
        {
        }
    }

    // The following attribute associates the SampleRootDesigner designer
 
    // with the SampleComponent component.
    [Designer(typeof(SampleRootDesigner), typeof(IRootDesigner))]
    public class RootDesignedComponent : Component
    {
        public RootDesignedComponent()
        {
        }
    }

    public class SampleRootDesigner : ComponentDesigner,
 IRootDesigner
    {
        // Member field of custom type RootDesignerView, a control that
 
        // will be shown in the Forms designer view. This member is
 
        // cached to reduce processing needed to recreate the 
        // view control on each call to GetView().
        private RootDesignerView m_view;            

        // This method returns an instance of the view for this root
        // designer. The "view" is the user interface that
 is presented
        // in a document window for the user to manipulate. 
        object IRootDesigner.GetView(ViewTechnology technology) 
        {
            if (technology != ViewTechnology.Default)
            {
                throw new ArgumentException("Not a supported
 view technology", "technology");
            }
            if (m_view == null)
            {
                   // Some type of displayable Form or control is required
 
                   // for a root designer that overrides GetView().
 In this 
                   // example, a Control of type RootDesignerView is
 used.
                   // Any class that inherits from Control will work.
                m_view = new RootDesignerView(this);
            }
            return m_view;
        }

        // IRootDesigner.SupportedTechnologies is a required override
 for an
        // IRootDesigner. Default is the view technology used by this
 designer.  
        ViewTechnology[] IRootDesigner.SupportedTechnologies 
        {
            get
            {
                return new ViewTechnology[]
 {ViewTechnology.Default};
            }
        }

        // RootDesignerView is a simple control that will be displayed
 
        // in the designer window.
        private class RootDesignerView : Control
 
        {
            private SampleRootDesigner m_designer;

            public RootDesignerView(SampleRootDesigner designer)
            {
                m_designer = designer;
                BackColor = Color.Blue;
                Font = new Font(Font.FontFamily.Name, 24.0f);
            }

            protected override void OnPaint(PaintEventArgs
 pe)
            {
                base.OnPaint(pe);

                // Draws the name of the component in large letters.
                pe.Graphics.DrawString(m_designer.Component.Site.Name, Font, Brushes.Yellow,
 ClientRectangle);
            }
        }        
    }
}
package SampleRootDesigner;

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 sample demonstrates how to provide the root designer view, or
// design mode background view, by overriding IRootDesigner.GetView().
// This sample component inherits from RootDesignedComponent which 
// uses the SampleRootDesigner.
public class RootViewSampleComponent extends
 RootDesignedComponent
{
    public RootViewSampleComponent()
    {
    } //RootViewSampleComponent
} //RootViewSampleComponent

// The following attribute associates the SampleRootDesigner designer
 
// with the SampleComponent component.
/** @ attribute Designer(SampleRootDesigner .class.ToType(),
    IRootDesigner .class.ToType())
 */
public class RootDesignedComponent extends
 Component
{
    public RootDesignedComponent()
    {
    } //RootDesignedComponent
} //RootDesignedComponent

public class SampleRootDesigner extends  ComponentDesigner
 
    implements  IRootDesigner
{
    // Member field of custom type RootDesignerView, a control that
 
    // will be shown in the Forms designer view. This member is 
    // cached to reduce processing needed to recreate the 
    // view control on each call to GetView().
    private RootDesignerView mView;

    // This method returns an instance of the view for this root
    // designer. The "view" is the user interface that is
 presented
    // in a document window for the user to manipulate. 
    public Object GetView(ViewTechnology technology)
    {
        if (!(technology.Equals(ViewTechnology.WindowsForms)))
 {
            throw new ArgumentException(
                "Not a supported view technology", "technology");
        }
        if (mView == null) {
            // Some type of displayable Form or control is required
 
            // for a root designer that overrides GetView(). In this
 
            // example, a Control of type RootDesignerView is used.
            // Any class that inherits from Control will work.
            mView = new RootDesignerView(this);
        }
        return mView;
    } //GetView

    // IRootDesigner.SupportedTechnologies is a required override for
 an
    // IRootDesigner. WindowsForms is the view technology used by this
 designer.  
    /** @property 
     */
    public ViewTechnology[] get_SupportedTechnologies()
    {
        return new ViewTechnology[] { ViewTechnology.WindowsForms
 };
    } //get_SupportedTechnologies

    // RootDesignerView is a simple control that will be displayed 
    // in the designer window.
    private class RootDesignerView extends
 Control
    {
        private SampleRootDesigner mDesigner;

        public RootDesignerView(SampleRootDesigner designer)
        {
            mDesigner = designer;
            set_BackColor(Color.get_Blue());
            set_Font(new Font(get_Font().get_FontFamily().get_Name(),
 24));
        } //RootDesignerView

        protected void OnPaint(PaintEventArgs
 pe)
        {
            super.OnPaint(pe);

            // Draws the name of the component in large letters.
            pe.get_Graphics().DrawString(
                mDesigner.get_Component().get_Site().get_Name(), 
                get_Font(), Brushes.get_Yellow(), 
                RectangleF.op_Implicit(get_ClientRectangle()));
        } //OnPaint
    } //RootDesignerView
} //SampleRootDesigner
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
System.ComponentModel.Design 名前空間


このページでは「.NET Framework クラス ライブラリ リファレンス」からViewTechnology 列挙体を検索した結果を表示しています。
Weblioに収録されているすべての辞書からViewTechnology 列挙体を検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からViewTechnology 列挙体 を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「ViewTechnology 列挙体」の関連用語

ViewTechnology 列挙体のお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



ViewTechnology 列挙体のページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS