TemplateInstanceAttribute.Instances プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > TemplateInstanceAttribute.Instances プロパティの意味・解説 

TemplateInstanceAttribute.Instances プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

現在のテンプレート インスタンスが表す TemplateInstance 列挙値。

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

Public ReadOnly Property
 Instances As TemplateInstance
Dim instance As TemplateInstanceAttribute
Dim value As TemplateInstance

value = instance.Instances
public TemplateInstance Instances { get; }
public:
property TemplateInstance Instances {
    TemplateInstance get ();
}
/** @property */
public TemplateInstance get_Instances ()
public function get Instances
 () : TemplateInstance

プロパティ
TemplateInstance

解説解説
使用例使用例

Instances プロパティ使用する方法次のコード例示しますASPX ページPage_Load イベントで、MyLoginViewA カスタム コントロールAnonymousTemplate プロパティの TemplateInstanceAttribute クラス照会されます

MyLoginViewA コントロール定義については、TemplateInstanceAttributeトピック参照してください

Protected Sub Page_Load(ByVal
 sender As Object, ByVal
 e As System.EventArgs)
  
  ' Get the class type for which to access metadata.
  Dim clsType As Type = GetType(MyLoginViewA)
  ' Get the PropertyInfo object for FirstTemplate.
  Dim pInfo As PropertyInfo = clsType.GetProperty("AnonymousTemplate")
  ' See if the TemplateInstanceAttribute is defined for this property.
  Dim isDef As Boolean =
 Attribute.IsDefined(pInfo, GetType(TemplateContainerAttribute))
  
  ' Display the result if the attribute exists.
  If isDef Then
    Dim tia As TemplateInstanceAttribute =
 CType(Attribute.GetCustomAttribute(pInfo, GetType(TemplateInstanceAttribute)),
 TemplateInstanceAttribute)
    Response.Write("The <AnonymousTemplate> has the TemplateInstanceAttribute
 = " & tia.Instances.ToString() & ".<br>")
    If (tia.IsDefaultAttribute()) Then
      Response.Write("The TemplateInstanceAttribute used is the
 same as the default instance.")
    Else
      Response.Write("The TemplateInstanceAttribute used is not
 the same as the default instance.")
    End If

  End If

End Sub
protected void Page_Load(object sender, EventArgs
 e)
{
      
  // Get the class type for which to access metadata.
  Type clsType = typeof(MyLoginViewA);
  // Get the PropertyInfo object for FirstTemplate.
  PropertyInfo pInfo = clsType.GetProperty("AnonymousTemplate");
  // See if the TemplateInstanceAttribute is defined for this property.
  bool isDef = Attribute.IsDefined(pInfo, typeof(TemplateInstanceAttribute));

  // Display the result if the attribute exists.
  if (isDef)
  {
    TemplateInstanceAttribute tia =
      (TemplateInstanceAttribute)Attribute.GetCustomAttribute(pInfo, typeof(TemplateInstanceAttribute));
    Response.Write("The <AnonymousTemplate> has the TemplateInstanceAttribute
 = " + tia.Instances.ToString() + ".<br>");
    if (tia.IsDefaultAttribute())
      Response.Write("The TemplateInstanceAttribute used is the same as the
 default instance.");
    else
      Response.Write("The TemplateInstanceAttribute used is not the same as
 the default instance.");
  }

}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
TemplateInstanceAttribute クラス
TemplateInstanceAttribute メンバ
System.Web.UI 名前空間
TemplateInstance 列挙


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

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

辞書ショートカット

すべての辞書の索引

TemplateInstanceAttribute.Instances プロパティのお隣キーワード
検索ランキング

   

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



TemplateInstanceAttribute.Instances プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS