VerificationAttribute クラスとは? わかりやすく解説

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

VerificationAttribute クラス

メモ : このクラスは、.NET Framework version 2.0新しく追加されたものです。

Web コンテンツアクセシビリティ規則メタデータ属性定義します。このクラス継承できません。

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

<AttributeUsageAttribute(AttributeTargets.Class Or AttributeTargets.Property,
 AllowMultiple:=True)> _
Public NotInheritable Class
 VerificationAttribute
    Inherits Attribute
Dim instance As VerificationAttribute
[AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Property, AllowMultiple=true)]
 
public sealed class VerificationAttribute :
 Attribute
[AttributeUsageAttribute(AttributeTargets::Class|AttributeTargets::Property, AllowMultiple=true)]
 
public ref class VerificationAttribute sealed
 : public Attribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Property,
 AllowMultiple=true) */ 
public final class VerificationAttribute extends
 Attribute
AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Property, AllowMultiple=true)
 
public final class VerificationAttribute extends
 Attribute
解説解説

VerificationAttribute クラスインスタンスは、検証できる、Web コンテンツアクセシビリティ規則定義します。『Web Content Accessibility Guidelines』の詳細については、W3C (World Wide Web Consortium) Web サイト参照してください

VerificationAttributeインスタンス定義するために必要な最小限情報には、次のような種類あります

インスタンス作成時に指定できる検証規則オプションプロパティ

VerificationAttribute メタデータは、クラスプロパティ、およびインデクサの各宣言で定義できます

属性使用方法については、「属性使用したメタデータ拡張」を参照してください

使用例使用例

VerificationAttribute クラス使用するコード例次に示します検証メタデータ定義で使用するガイドラインは、"WCAG" (Web Content Accessibility Guideline) および "ADA" (Americans with Disabilities Act Guidelines) です。詳細については、W3C (World Wide Web Consortium) Web サイト参照してください

使用するチェックポイントは、WCAG場合は "1.1"、ADA場合は "1194.22(a)" です。これらのチェックポイントは、テキスト以外の要素等価テキスト確実に存在するようにします。VerificationAttribute は、ImageProperty という名前の別のプロパティ等価テキストを表す ImageText プロパティ適用されます。ImageText プロパティ設定されていない場合アクセシビリティ検証によって "The image is missing a text equivalent." のメッセージ返されます。

<Verification("ADA", "1194.22(a)",
 VerificationReportLevel.Error, 1, "The image is missing a text
 equivalent.", VerificationRule.NotEmptyString, "ImageUrl")> _
<Verification("WCAG", "1.1",
 VerificationReportLevel.Error, 1, "The image is missing a text
 equivalent.", VerificationRule.NotEmptyString, "ImageUrl")> _
Public Property ImageText() As
 String
    Get
        If ViewState("ImageText")
 Is Nothing Then
            Return String.Empty
        Else
            Return CType(ViewState("ImageText"),
 String)
        End If
    End Get
    Set(ByVal value As String)
        ViewState("ImageText") = value
    End Set
End Property


Public Property ImageUrl() As
 String
    Get
        If ViewState("ImageUrl")
 Is Nothing Then
            Return String.Empty
        Else
            Return CType(ViewState("ImageUrl"),
 String)
        End If
    End Get
    Set(ByVal value As String)
        ViewState("ImageUrl") = value
    End Set
End Property
[Verification("ADA", "1194.22(a)", 
    VerificationReportLevel.Error, 1,
    "The image is missing a text equivalent.", 
    VerificationRule.NotEmptyString, "ImageUrl"),
Verification("WCAG", "1.1", 
    VerificationReportLevel.Error, 1, 
    "The image is missing an text equivalent.", 
    VerificationRule.NotEmptyString, "ImageUrl")]
public virtual String ImageText
{
    get
    {
        object obj = ViewState["ImageText"];
        return ((obj == null) ? String.Empty
 : (string)obj);
    }
    set
    {
        ViewState["ImageText"] = value;
    }
}
public virtual String ImageUrl
{
    get 
    {
        object obj = ViewState["ImageUrl"];
        return ((obj == null) ? String.Empty
 : (string)obj);
    }
    set 
    { 
        ViewState["ImageUrl"] = value;
    }
}
.NET Framework のセキュリティ.NET Frameworkセキュリティ
継承階層継承階層
System.Object
   System.Attribute
    System.Web.UI.VerificationAttribute
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

「VerificationAttribute クラス」の関連用語

VerificationAttribute クラスのお隣キーワード
検索ランキング

   

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



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

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

©2025 GRAS Group, Inc.RSS