Este artigo foi traduzido por máquina. Para visualizar o arquivo em inglês, marque a caixa de seleção Inglês. Você também pode exibir o texto Em inglês em uma janela pop-up, movendo o ponteiro do mouse sobre o texto.
Tradução
Inglês

DesignerActionItem Classe

Fornece a classe base para tipos que representam um item do painel em um painel de marca inteligente.

Namespace:  System.ComponentModel.Design
Assembly:  System.Design (em System.Design. dll)

public abstract class DesignerActionItem

The DesignerActionItem class serves as an abstract base for classes that represent individual panel items in a smart tag panel, which represents a menu-like user interface (UI) for smart tags.The .NET Framework supplies derived classes that represent the different common entries in a smart tag panel, including plain text, header text, properties and methods of the associated DesignerActionList class, and designer verbs.

Typically, your DesignerAction feature is defined in a programmer-supplied class derived from DesignerActionList, which contains a GetSortedActionItems method that groups individual panel items together to form the smart tag panel.The DesignerActionPropertyItem and DesignerActionMethodItem types are associated with members of the class derived from DesignerActionList, and DesignerActionMethodItem objects are activated when their associated panel entry is selected by the user.

ObservaçãoObservação:

Forms and dialog boxes can be displayed by members of the class derived from DesignerActionList.Por padrão, the pai of these Windows will be the janela contêiner for the painel marca inteligente.Explicitly parenting these filho Windows to another serviço or janela May causar items to exibir de modo inadequado.

The following code example demonstrates how to create a collection of DesignerActionItem objects.

For a full example of implementing smart tags, see HOW TO: Anexar as marcas inteligentes a um componente Windows Formulários.

public override DesignerActionItemCollection GetSortedActionItems()
{
    DesignerActionItemCollection items = new DesignerActionItemCollection();

    //Define static section header entries.
    items.Add(new DesignerActionHeaderItem("Appearance"));
    items.Add(new DesignerActionHeaderItem("Information"));

    //Boolean property for locking color selections.
    items.Add(new DesignerActionPropertyItem("LockColors",
                     "Lock Colors", "Appearance",
                     "Locks the color properties."));
    if (!LockColors)
    {
        items.Add(new DesignerActionPropertyItem("BackColor",
                         "Back Color", "Appearance",
                         "Selects the background color."));
        items.Add(new DesignerActionPropertyItem("ForeColor",
                         "Fore Color", "Appearance",
                         "Selects the foreground color."));

        //This next method item is also added to the context menu 
        // (as a designer verb).
        items.Add(new DesignerActionMethodItem(this,
                         "InvertColors", "Invert Colors",
                         "Appearance",
                         "Inverts the fore and background colors.",
                          true));
    }
    items.Add(new DesignerActionPropertyItem("Text",
                     "Text String", "Appearance",
                     "Sets the display text."));

    //Create entries for static Information section.
    StringBuilder location = new StringBuilder("Location: ");
    location.Append(colLabel.Location);
    StringBuilder size = new StringBuilder("Size: ");
    size.Append(colLabel.Size);
    items.Add(new DesignerActionTextItem(location.ToString(),
                     "Information"));
    items.Add(new DesignerActionTextItem(size.ToString(),
                     "Information"));

    return items;
}


Quaisquer membros públicos estático (compartilhados na Visual Basic) desse tipo são Thread seguro. Não há garantia de que qualquer membro de instância seja isento de segmentos.

Contribuições da comunidade

ADICIONAR
Mostrar: