DataBindingHandlerAttribute コンストラクタとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > DataBindingHandlerAttribute コンストラクタの意味・解説 

DataBindingHandlerAttribute コンストラクタ (String)

指定した型名使用して DataBindingHandlerAttribute クラス新しインスタンス初期化します。

名前空間: System.Web.UI
アセンブリ: System.Web (system.web.dll 内)
構文構文

Dim typeName As String

Dim instance As New DataBindingHandlerAttribute(typeName)
public DataBindingHandlerAttribute (
    string typeName
)
public:
DataBindingHandlerAttribute (
    String^ typeName
)
public DataBindingHandlerAttribute (
    String typeName
)
public function DataBindingHandlerAttribute
 (
    typeName : String
)

パラメータ

typeName

データ バインディング ハンドラ Type の完全修飾名。

解説解説

このコンストラクタ型名は、アセンブリ名を含む、型の完全修飾名です。

使用例使用例

DataBindingHandlerAttribute コンストラクタ使用してWeb コントロールカスタム DataBindingHandler クラス指定するコード例次に示します

' The following example uses the 
' DataBindingHandlerAttribute(String) constructor to designate
' the custom DataBindingHandler class, named MyDataBindingHandler,
' for the custom MyWebControl class.
Imports System
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.Design
Imports System.ComponentModel.Design
Imports System.Security.Permissions

Namespace MyTextCustomControl

 <DataBindingHandlerAttribute("MyTextCustomControl.MyDataBindingHandler")>
  _
 <AspNetHostingPermission(SecurityAction.Demand, _
   Level:=AspNetHostingPermissionLevel.Minimal)> _
 Public NotInheritable Class
 MyWebControl
   Inherits WebControl
   
   Protected Overrides Sub
 Render(output As HtmlTextWriter)
      output.Write("This class uses the DataBindingHandlerAttribute
 class.")
   End Sub 'Render 
 End Class 'MyWebControl


 Public Class MyDataBindingHandler
   Inherits TextDataBindingHandler
   
   Public Overrides Sub
 DataBindControl(host As IDesignerHost, myControl As
 Control)
      CType(myControl, TextBox).Text = "Added by MyDataBindingHandler"
   End Sub 'DataBindControl
 End Class 'MyDataBindingHandler
End Namespace 'MyTextCustomControl
// The following example uses the 
// DataBindingHandlerAttribute(String) constructor to designate
// the custom DataBindingHandler class, named MyDataBindingHandler,
// for the custom MyWebControl class.
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.Design;
using System.ComponentModel.Design;
using System.Security.Permissions;

namespace MyTextCustomControl
{
   [ DataBindingHandlerAttribute("MyTextCustomControl.MyDataBindingHandler")
 ]
   [AspNetHostingPermission(SecurityAction.Demand, 
      Level=AspNetHostingPermissionLevel.Minimal)]
   public sealed class MyWebControl : WebControl
   {
      protected override void Render(HtmlTextWriter
 output)
      {
         output.Write("This class uses the DataBindingHandlerAttribute
 class.");
      }
   }

   public class MyDataBindingHandler : TextDataBindingHandler
   {
      public override void DataBindControl(IDesignerHost
 host, Control myControl)
      {
         ((TextBox)myControl).Text = "Added by MyDataBindingHandler";
      }
   }
}
// The following example uses the 
// DataBindingHandlerAttribute(String) constructor to designate
// the custom DataBindingHandler class, named MyDataBindingHandler,
// for the custom MyWebControl class.

package MyTextCustomControl;

import System.*;
import System.Web.UI.*;
import System.Web.UI.WebControls.*;
import System.Web.UI.Design.*;
import System.ComponentModel.Design.*;

/** @attribute DataBindingHandlerAttribute(
    "MyTextCustomControl.MyDataBindingHandler")
 */
public class MyWebControl extends WebControl
{
    protected void Render(HtmlTextWriter output)
    {
        output.Write("This class uses the DataBindingHandlerAttribute
 class.");
    } //Render
} //MyWebControl

public class MyDataBindingHandler extends TextDataBindingHandler
{
    public void DataBindControl(IDesignerHost
 host, Control myControl)
    {
        ((TextBox)myControl).set_Text("Added by MyDataBindingHandler");
    } //DataBindControl
} //MyDataBindingHandler
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DataBindingHandlerAttribute クラス
DataBindingHandlerAttribute メンバ
System.Web.UI 名前空間

DataBindingHandlerAttribute コンストラクタ (Type)

指定した Type の DataBindingHandlerAttribute クラス新しインスタンス初期化します。

名前空間: System.Web.UI
アセンブリ: System.Web (system.web.dll 内)
構文構文

Dim type As Type

Dim instance As New DataBindingHandlerAttribute(type)
public DataBindingHandlerAttribute (
    Type type
)
public:
DataBindingHandlerAttribute (
    Type^ type
)
public DataBindingHandlerAttribute (
    Type type
)
public function DataBindingHandlerAttribute
 (
    type : Type
)

パラメータ

type

データ連結ハンドラType

解説解説

この属性構文次のとおりです。

[DataBindingHandlerAttribute
  (typeof(dataBindingHandlerType))]
使用例使用例

編集モード時にデザイナ使用するMyDataBindingHandler という名前のデータ バインディング ハンドラ定義するコード例次に示します編集モード終了時に、Text プロパティ値が表示されます。

Namespace CustomControls

  <DataBindingHandler(GetType(MyDataBindingHandler)), ToolboxData("<{0}:MyLabel
 runat=server></{0}:MyLabel>")>  _
    Public Class MyLabel
      Inherits Label
      
      Public Sub New()
        'Insert your code here.
      End Sub 'New
      
    End Class 'MyLabel
   
    Public Class MyDataBindingHandler
      Inherits DataBindingHandler
      
      Public Overrides Sub
 DataBindControl(host As IDesignerHost, control As
 Control)
         CType(control, Label).Text = "Added by data binding handler."
      End Sub 'DataBindControl
      
    End Class 'MyDataBindingHandler
    
End Namespace 'CustomControls
 

using System;
using System.Collections;
using System.Web.UI;
using System.Web.UI.Design;
using System.Web.UI.WebControls;
using System.ComponentModel;
using System.ComponentModel.Design;


namespace CustomControls
{
  [
    DataBindingHandler(typeof(MyDataBindingHandler)),
    ToolboxData("<{0}:MyLabel runat=server></{0}:MyLabel>")
  ]
  public class MyLabel : Label 
  {
    public  MyLabel()
    { 
      // Insert your code here.
    } 
  }

  public class MyDataBindingHandler : DataBindingHandler
  {
    public override void DataBindControl(IDesignerHost
 host, Control control)
    {
      ((Label)control).Text = "Added by data binding handler.";
    }
  }

}

package CustomControls;

import System.*;
import System.Collections.*;
import System.Web.UI.*;
import System.Web.UI.Design.*;
import System.Web.UI.WebControls.*;
import System.ComponentModel.*;
import System.ComponentModel.Design.*;

/** @attribute DataBindingHandler(MyDataBindingHandler.class)
    @attribute ToolboxData("<{0}:MyLabel runat=server></{0}:MyLabel>")
 */

public class MyLabel extends Label
{
    public MyLabel()
    {
        // Insert your code here.
    } //MyLabel
} //MyLabel

public class MyDataBindingHandler extends DataBindingHandler
{
    public void DataBindControl(IDesignerHost
 host, Control control)
    {
        ((Label)control).set_Text("Added by data binding handler.");
    } //DataBindControl
} //MyDataBindingHandler
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DataBindingHandlerAttribute クラス
DataBindingHandlerAttribute メンバ
System.Web.UI 名前空間

DataBindingHandlerAttribute コンストラクタ

DataBindingHandlerAttribute クラス新しインスタンス初期化します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
DataBindingHandlerAttribute () パラメータ使用せずDataBindingHandlerAttribute クラス新しインスタンス初期化します。これは、既定コンストラクタです。
DataBindingHandlerAttribute (String) 指定した型名使用して DataBindingHandlerAttribute クラス新しインスタンス初期化します。
DataBindingHandlerAttribute (Type) 指定した TypeDataBindingHandlerAttribute クラス新しインスタンス初期化します。
参照参照

関連項目

DataBindingHandlerAttribute クラス
DataBindingHandlerAttribute メンバ
System.Web.UI 名前空間

DataBindingHandlerAttribute コンストラクタ ()

パラメータ使用せずに DataBindingHandlerAttribute クラス新しインスタンス初期化します。これは、既定コンストラクタです。

名前空間: System.Web.UI
アセンブリ: System.Web (system.web.dll 内)
構文構文

Dim instance As New DataBindingHandlerAttribute
public DataBindingHandlerAttribute ()
public:
DataBindingHandlerAttribute ()
public DataBindingHandlerAttribute ()
public function DataBindingHandlerAttribute
 ()
使用例使用例

DataBindingHandlerAttribute コンストラクタ使用するコード例次に示します

' The following example uses the Default
' DataBindingHandlerAttribute constructor.
Imports System
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Security.Permissions

Namespace MyTextCustomControl

 <DataBindingHandlerAttribute()>  _
 <AspNetHostingPermission(SecurityAction.Demand, _
   Level:=AspNetHostingPermissionLevel.Minimal)> _
 Public NotInheritable Class
 MyTextBox
   Inherits TextBox
   
   Protected Overrides Sub
 Render(output As HtmlTextWriter)
      output.Write("This class uses the DataBindingHandlerAttribute
 class.")
   End Sub 'Render 

 End Class 'MyTextBox
End Namespace 'MyTextCustomControl
// The following example uses the Default
// DataBindingHandlerAttribute constructor.
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Security.Permissions;

namespace MyTextCustomControl
{
   [ DataBindingHandlerAttribute() ]
   [AspNetHostingPermission(SecurityAction.Demand, 
      Level=AspNetHostingPermissionLevel.Minimal)]
   public sealed class MyTextBox : TextBox
   {
      protected override void Render(HtmlTextWriter
 output)
      {
         output.Write("This class uses the DataBindingHandlerAttribute
 class.");
      }
   }
}
// The following example uses the Default
// DataBindingHandlerAttribute constructor.

package MyTextCustomControl; 

import System.*;
import System.Web.UI.*;
import System.Web.UI.WebControls.*;

/** @attribute DataBindingHandlerAttribute()
 */
public class MyTextBox extends TextBox
{
    protected void Render(HtmlTextWriter output)
    {
        output.Write("This class uses the DataBindingHandlerAttribute
 class.");
    } //Render
} //MyTextBox
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DataBindingHandlerAttribute クラス
DataBindingHandlerAttribute メンバ
System.Web.UI 名前空間


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

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

辞書ショートカット

すべての辞書の索引

「DataBindingHandlerAttribute コンストラクタ」の関連用語

DataBindingHandlerAttribute コンストラクタのお隣キーワード
検索ランキング

   

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



DataBindingHandlerAttribute コンストラクタのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS