Nota
O acesso a esta página requer autorização. Pode tentar iniciar sessão ou alterar os diretórios.
O acesso a esta página requer autorização. Pode tentar alterar os diretórios.
Conecta metadados de time de design a um tipo de controle específico.
Namespace: Microsoft.Windows.Design.Metadata
Assembly: Microsoft.Windows.Design (em Microsoft.Windows.Design.dll)
Sintaxe
Sub Register
Dim instance As IRegisterMetadata
instance.Register()
void Register()
void Register()
function Register()
Comentários
The Register método é chamado durante a inicialização do designer.
Classes que implementam o Register método deve usar o AddAttributeTable método para adicionar metadados para o armazenamento.
Exemplos
O exemplo de código a seguir mostra como implementar o Register método. The Metadata classe anexa um provedor de adorno em um controle. Para obter mais informações, consulte Demonstra Passo a passo: Criando um Adorner de tempo de design.
' Container for any general design-time metadata to initialize.
' Designers look for a type in the design-time assembly that
' implements IRegisterMetadata. If found, designers instantiate
' this class and call its Register() method automatically.
Friend Class Metadata
Implements IRegisterMetadata
' Called by the designer to register any design-time metadata.
Public Sub Register() Implements IRegisterMetadata.Register
Dim builder As New AttributeTableBuilder()
' Add the adorner provider to the design-time metadata.
builder.AddCustomAttributes(GetType(ButtonWithDesignTime), _
New FeatureAttribute(GetType(OpacitySliderAdornerProvider)))
MetadataStore.AddAttributeTable(builder.CreateTable())
End Sub
End Class
// Container for any general design-time metadata to initialize.
// Designers look for a type in the design-time assembly that
// implements IRegisterMetadata. If found, designers instantiate
// this class and call its Register() method automatically.
internal class Metadata : IRegisterMetadata
{
// Called by the designer to register any design-time metadata.
public void Register()
{
AttributeTableBuilder builder = new AttributeTableBuilder();
// Add the adorner provider to the design-time metadata.
builder.AddCustomAttributes(
typeof(ButtonWithDesignTime),
new FeatureAttribute(typeof(OpacitySliderAdornerProvider)));
MetadataStore.AddAttributeTable(builder.CreateTable());
}
}
Permissões
- Confiança total para o chamador imediato. O membro não pode ser usado por código parcialmente confiável. Para obter mais informações, consulte Usando bibliotecas de códigos parcialmente Confiável.
Consulte também
Referência
Namespace Microsoft.Windows.Design.Metadata