ProvideMetadataAttribute 클래스
메타데이터를 제공하는 클래스를 나타냅니다.
상속 계층 구조
System.Object
System.Attribute
Microsoft.Windows.Design.Metadata.ProvideMetadataAttribute
네임스페이스: Microsoft.Windows.Design.Metadata
어셈블리: Microsoft.Windows.Design.Extensibility(Microsoft.Windows.Design.Extensibility.dll)
구문
‘선언
<AttributeUsageAttribute(AttributeTargets.Assembly, AllowMultiple := True)> _
Public NotInheritable Class ProvideMetadataAttribute _
Inherits Attribute
[AttributeUsageAttribute(AttributeTargets.Assembly, AllowMultiple = true)]
public sealed class ProvideMetadataAttribute : Attribute
[AttributeUsageAttribute(AttributeTargets::Assembly, AllowMultiple = true)]
public ref class ProvideMetadataAttribute sealed : public Attribute
[<Sealed>]
[<AttributeUsageAttribute(AttributeTargets.Assembly, AllowMultiple = true)>]
type ProvideMetadataAttribute =
class
inherit Attribute
end
public final class ProvideMetadataAttribute extends Attribute
ProvideMetadataAttribute 형식에서는 다음과 같은 멤버를 노출합니다.
생성자
이름 | 설명 | |
---|---|---|
ProvideMetadataAttribute | ProvideMetadataAttribute 클래스의 새 인스턴스를 초기화합니다. |
위쪽
속성
이름 | 설명 | |
---|---|---|
MetadataProviderType | IProvideAttributeTable 인터페이스를 구현하는 형식을 가져옵니다. | |
TypeId | 파생 클래스에서 구현된 경우 이 Attribute에 대한 고유 식별자를 가져옵니다. (Attribute에서 상속됨) |
위쪽
메서드
이름 | 설명 | |
---|---|---|
Equals | 인프라입니다. 이 인스턴스가 지정된 개체와 같은지 여부를 나타내는 값을 반환합니다. (Attribute에서 상속됨) | |
Finalize | 가비지 수집에서 회수하기 전에 개체에서 리소스를 해제하고 다른 정리 작업을 수행할 수 있게 합니다. (Object에서 상속됨) | |
GetHashCode | 이 인스턴스에 대한 해시 코드를 반환합니다. (Attribute에서 상속됨) | |
GetType | 현재 인스턴스의 Type을 가져옵니다. (Object에서 상속됨) | |
IsDefaultAttribute | 파생 클래스에서 재정의된 경우 이 인스턴스의 값이 파생 클래스의 기본값인지 여부를 나타냅니다. (Attribute에서 상속됨) | |
Match | 파생 클래스에서 재정의된 경우 이 인스턴스가 지정된 개체와 같은지 여부를 나타내는 값을 반환합니다. (Attribute에서 상속됨) | |
MemberwiseClone | 현재 Object의 단순 복사본을 만듭니다. (Object에서 상속됨) | |
ToString | 현재 개체를 나타내는 문자열을 반환합니다. (Object에서 상속됨) |
위쪽
명시적 인터페이스 구현
이름 | 설명 | |
---|---|---|
_Attribute.GetIDsOfNames | 이름 집합을 해당하는 디스패치 식별자 집합에 매핑합니다. (Attribute에서 상속됨) | |
_Attribute.GetTypeInfo | 인터페이스의 형식 정보를 가져오는 데 사용할 수 있는 개체의 형식 정보를 검색합니다. (Attribute에서 상속됨) | |
_Attribute.GetTypeInfoCount | 개체에서 제공하는 형식 정보 인터페이스의 수를 검색합니다(0 또는 1). (Attribute에서 상속됨) | |
_Attribute.Invoke | 개체에서 노출하는 메서드와 속성에 대한 액세스를 제공합니다. (Attribute에서 상속됨) |
위쪽
설명
메타데이터를 제공하는 형식을 선언하려면 이 특성을 사용자의 어셈블리에 추가하십시오. 어셈블리의 형식은 IProvideAttributeTable 인터페이스를 구현하여 Visual Studio 및 Expression Blend 같은 디자인 도구에 디자인 타임 메타데이터 특성을 제공합니다. 자세한 내용은 디자인 타임 메타데이터 제공을 참조하십시오.
예제
다음 코드 예제에서는 특성 테이블을 만들고 값을 채우는 방법을 보여 줍니다. 자세한 내용은 연습: 디자인 타임 표시기 만들기을 참조하십시오.
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports System.ComponentModel
Imports System.Windows.Media
Imports System.Windows.Controls
Imports System.Windows
Imports CustomControlLibrary
Imports Microsoft.Windows.Design.Features
Imports Microsoft.Windows.Design.Metadata
' The ProvideMetadata assembly-level attribute indicates to designers
' that this assembly contains a class that provides an attribute table.
<Assembly: ProvideMetadata(GetType(CustomControlLibrary.VisualStudio.Design.Metadata))>
Namespace CustomControlLibrary.VisualStudio.Design
' Container for any general design-time metadata to initialize.
' Designers look for a type in the design-time assembly that
' implements IProvideAttributeTable. If found, designers instantiate
' this class and access its AttributeTable property automatically.
Friend Class Metadata
Implements IProvideAttributeTable
' Accessed by the designer to register any design-time metadata.
Public ReadOnly Property AttributeTable() As AttributeTable _
Implements IProvideAttributeTable.AttributeTable
Get
Dim builder As New AttributeTableBuilder()
' Add the adorner provider to the design-time metadata.
builder.AddCustomAttributes(GetType(ButtonWithDesignTime), _
New FeatureAttribute(GetType(OpacitySliderAdornerProvider)))
Return builder.CreateTable()
End Get
End Property
End Class
End Namespace
using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Windows.Media;
using System.Windows.Controls;
using System.Windows;
using CustomControlLibrary;
using Microsoft.Windows.Design.Features;
using Microsoft.Windows.Design.Metadata;
// The ProvideMetadata assembly-level attribute indicates to designers
// that this assembly contains a class that provides an attribute table.
[assembly: ProvideMetadata(typeof(CustomControlLibrary.VisualStudio.Design.Metadata))]
namespace CustomControlLibrary.VisualStudio.Design
{
// Container for any general design-time metadata to initialize.
// Designers look for a type in the design-time assembly that
// implements IProvideAttributeTable. If found, designers instantiate
// this class and access its AttributeTable property automatically.
internal class Metadata : IProvideAttributeTable
{
// Accessed by the designer to register any design-time metadata.
public AttributeTable AttributeTable
{
get
{
AttributeTableBuilder builder = new AttributeTableBuilder();
// Add the adorner provider to the design-time metadata.
builder.AddCustomAttributes(
typeof(ButtonWithDesignTime),
new FeatureAttribute(typeof(OpacitySliderAdornerProvider)));
return builder.CreateTable();
}
}
}
}
스레드로부터의 안전성
이 형식의 모든 공용 static(Visual Basic의 경우 Shared) 멤버는 스레드로부터 안전합니다. 인터페이스 멤버는 스레드로부터 안전하지 않습니다.
참고 항목
참조
Microsoft.Windows.Design.Metadata 네임스페이스