PropertyValueUIHandler Delegar
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Representa o método que adiciona um delegado a uma implementação de IPropertyValueUIService.
public delegate void PropertyValueUIHandler(ITypeDescriptorContext ^ context, PropertyDescriptor ^ propDesc, ArrayList ^ valueUIItemList);
public delegate void PropertyValueUIHandler(ITypeDescriptorContext context, PropertyDescriptor propDesc, ArrayList valueUIItemList);
type PropertyValueUIHandler = delegate of ITypeDescriptorContext * PropertyDescriptor * ArrayList -> unit
Public Delegate Sub PropertyValueUIHandler(context As ITypeDescriptorContext, propDesc As PropertyDescriptor, valueUIItemList As ArrayList)
Parâmetros
- context
- ITypeDescriptorContext
Um ITypeDescriptorContext que pode ser usado para obter informação de contexto.
- propDesc
- PropertyDescriptor
A PropertyDescriptor que representa a propriedade a ser consultada.
- valueUIItemList
- ArrayList
Um ArrayList de PropertyValueUIItem objetos que contêm os itens da interface de utilizador associados à propriedade.
Exemplos
Este exemplo de código a seguir demonstra a criação de um PropertyValueUIHandler método de gestor de eventos que fornece PropertyValueUIItem objetos para quaisquer propriedades nomeadas HorizontalMargin ou VerticalMargin.
// PropertyValueUIHandler delegate that provides PropertyValueUIItem
// objects to any properties named HorizontalMargin or VerticalMargin.
private void marginPropertyValueUIHandler(
System.ComponentModel.ITypeDescriptorContext context,
System.ComponentModel.PropertyDescriptor propDesc,
ArrayList itemList)
{
// A PropertyValueUIHandler added to the IPropertyValueUIService
// is queried once for each property of a component and passed
// a PropertyDescriptor that represents the characteristics of
// the property when the Properties window is set to a new
// component. A PropertyValueUIHandler can determine whether
// to add a PropertyValueUIItem for the object to its ValueUIItem
// list depending on the values of the PropertyDescriptor.
if (propDesc.DisplayName.Equals("HorizontalMargin"))
{
Image img = Image.FromFile("SampImag.jpg");
itemList.Add(new PropertyValueUIItem(img, new PropertyValueUIItemInvokeHandler(this.marginInvoke), "Test ToolTip"));
}
if (propDesc.DisplayName.Equals("VerticalMargin"))
{
Image img = Image.FromFile("SampImag.jpg");
img.RotateFlip(RotateFlipType.Rotate90FlipNone);
itemList.Add(new PropertyValueUIItem(img, new PropertyValueUIItemInvokeHandler(this.marginInvoke), "Test ToolTip"));
}
}
Observações
Quando este delegado é invocado, pode adicionar itens PropertyValueUIItem UI contendo para a propriedade especificada ao ArrayList passado como parâmetro valueUIItemList .
Métodos da Extensão
| Name | Description |
|---|---|
| GetMethodInfo(Delegate) |
Obtém um objeto que representa o método representado pelo delegado especificado. |