DesignerActionMethodItem Konstruktory

Definicja

Inicjuje nowe wystąpienie klasy DesignerActionMethodItem.

Przeciążenia

DesignerActionMethodItem(DesignerActionList, String, String)

Inicjuje DesignerActionMethodItem nowe wystąpienie klasy z określoną metodą i nazwami wyświetlanymi.

DesignerActionMethodItem(DesignerActionList, String, String, Boolean)

Inicjuje DesignerActionMethodItem nowe wystąpienie klasy z określoną metodą i nazwami wyświetlanymi oraz flagę wskazującą, czy element powinien być wyświetlany w innych kontekstach interfejsu użytkownika.

DesignerActionMethodItem(DesignerActionList, String, String, String)

Inicjuje DesignerActionMethodItem nowe wystąpienie klasy z określoną metodą, wyświetlaniem i nazwami kategorii.

DesignerActionMethodItem(DesignerActionList, String, String, String, Boolean)

Inicjuje DesignerActionMethodItem nowe wystąpienie klasy z określoną metodą, wyświetlaniem i nazwami kategorii oraz flagą wskazującą, czy element powinien być wyświetlany w innych kontekstach interfejsu użytkownika.

DesignerActionMethodItem(DesignerActionList, String, String, String, String)

Inicjuje DesignerActionMethodItem nowe wystąpienie klasy z określoną metodą i nazwami kategorii oraz tekstem wyświetlania i opisu.

DesignerActionMethodItem(DesignerActionList, String, String, String, String, Boolean)

Inicjuje DesignerActionMethodItem nowe wystąpienie klasy z określoną metodą i nazwami kategorii, tekstem wyświetlania i opisu oraz flagą wskazującą, czy element powinien być wyświetlany w innych kontekstach interfejsu użytkownika.

DesignerActionMethodItem(DesignerActionList, String, String)

Inicjuje DesignerActionMethodItem nowe wystąpienie klasy z określoną metodą i nazwami wyświetlanymi.

public:
 DesignerActionMethodItem(System::ComponentModel::Design::DesignerActionList ^ actionList, System::String ^ memberName, System::String ^ displayName);
public DesignerActionMethodItem (System.ComponentModel.Design.DesignerActionList actionList, string memberName, string displayName);
new System.ComponentModel.Design.DesignerActionMethodItem : System.ComponentModel.Design.DesignerActionList * string * string -> System.ComponentModel.Design.DesignerActionMethodItem
Public Sub New (actionList As DesignerActionList, memberName As String, displayName As String)

Parametry

actionList
DesignerActionList

Element DesignerActionList zawierający metodę, z którą jest skojarzony ten element.

memberName
String

Nazwa metody w klasie pochodzącej z DesignerActionList klasy , która ma być wywoływana za pośrednictwem elementu panelu.

displayName
String

Tekst panelu dla tego elementu.

Uwagi

Konstruktor DesignerActionMethodItem ustawia Category właściwości i Description na null, a IncludeAsDesignerVerb właściwość na false.

Zobacz też

Dotyczy

DesignerActionMethodItem(DesignerActionList, String, String, Boolean)

Inicjuje DesignerActionMethodItem nowe wystąpienie klasy z określoną metodą i nazwami wyświetlanymi oraz flagę wskazującą, czy element powinien być wyświetlany w innych kontekstach interfejsu użytkownika.

public:
 DesignerActionMethodItem(System::ComponentModel::Design::DesignerActionList ^ actionList, System::String ^ memberName, System::String ^ displayName, bool includeAsDesignerVerb);
public DesignerActionMethodItem (System.ComponentModel.Design.DesignerActionList actionList, string memberName, string displayName, bool includeAsDesignerVerb);
new System.ComponentModel.Design.DesignerActionMethodItem : System.ComponentModel.Design.DesignerActionList * string * string * bool -> System.ComponentModel.Design.DesignerActionMethodItem
Public Sub New (actionList As DesignerActionList, memberName As String, displayName As String, includeAsDesignerVerb As Boolean)

Parametry

actionList
DesignerActionList

Element DesignerActionList zawierający metodę, z którą jest skojarzony ten element.

memberName
String

Nazwa metody w klasie pochodzącej z DesignerActionList klasy , która ma być wywoływana za pośrednictwem elementu panelu.

displayName
String

Tekst panelu dla tego elementu.

includeAsDesignerVerb
Boolean

Flaga określająca, czy również traktować skojarzona metodę jako czasownik projektanta.

Uwagi

includeAsDesignerVerb Jeśli parametr jest ustawiony na truewartość , ten element jest również uznawany za element DesignerVerb; w związku z tym zostanie dodany do menu skrótów czasu projektowania składnika. W programie Visual Studio polecenie zostanie również dodane do okienka Atrybuty okno Właściwości. Dostęp do listy czasowników projektanta można uzyskać za pośrednictwem właściwości kolekcji projektanta Verbs .

Konstruktor DesignerActionMethodItem ustawia Category właściwości i Description na nullwartość .

Zobacz też

Dotyczy

DesignerActionMethodItem(DesignerActionList, String, String, String)

Inicjuje DesignerActionMethodItem nowe wystąpienie klasy z określoną metodą, wyświetlaniem i nazwami kategorii.

public:
 DesignerActionMethodItem(System::ComponentModel::Design::DesignerActionList ^ actionList, System::String ^ memberName, System::String ^ displayName, System::String ^ category);
public DesignerActionMethodItem (System.ComponentModel.Design.DesignerActionList actionList, string memberName, string displayName, string category);
new System.ComponentModel.Design.DesignerActionMethodItem : System.ComponentModel.Design.DesignerActionList * string * string * string -> System.ComponentModel.Design.DesignerActionMethodItem
Public Sub New (actionList As DesignerActionList, memberName As String, displayName As String, category As String)

Parametry

actionList
DesignerActionList

Element DesignerActionList zawierający metodę, z którą jest skojarzony ten element.

memberName
String

Nazwa metody w klasie pochodzącej z DesignerActionList klasy , która ma być wywoływana za pośrednictwem elementu panelu.

displayName
String

Tekst panelu dla tego elementu.

category
String

Wielkość liter String używana do grupowania podobnych elementów na panelu.

Uwagi

Konstruktor DesignerActionMethodItem ustawia Description właściwość na null , a IncludeAsDesignerVerb właściwość na false.

Aby uzyskać więcej informacji na temat sposobu użycia parametru category do grupowania elementów na panelu, zobacz metodę GetSortedActionItems .

Zobacz też

Dotyczy

DesignerActionMethodItem(DesignerActionList, String, String, String, Boolean)

Inicjuje DesignerActionMethodItem nowe wystąpienie klasy z określoną metodą, wyświetlaniem i nazwami kategorii oraz flagą wskazującą, czy element powinien być wyświetlany w innych kontekstach interfejsu użytkownika.

public:
 DesignerActionMethodItem(System::ComponentModel::Design::DesignerActionList ^ actionList, System::String ^ memberName, System::String ^ displayName, System::String ^ category, bool includeAsDesignerVerb);
public DesignerActionMethodItem (System.ComponentModel.Design.DesignerActionList actionList, string memberName, string displayName, string category, bool includeAsDesignerVerb);
new System.ComponentModel.Design.DesignerActionMethodItem : System.ComponentModel.Design.DesignerActionList * string * string * string * bool -> System.ComponentModel.Design.DesignerActionMethodItem
Public Sub New (actionList As DesignerActionList, memberName As String, displayName As String, category As String, includeAsDesignerVerb As Boolean)

Parametry

actionList
DesignerActionList

Element DesignerActionList zawierający metodę, z którą jest skojarzony ten element.

memberName
String

Nazwa metody w klasie pochodzącej z DesignerActionList klasy , która ma być wywoływana za pośrednictwem elementu panelu.

displayName
String

Tekst panelu dla tego elementu.

category
String

Wielkość liter String używana do grupowania podobnych elementów na panelu.

includeAsDesignerVerb
Boolean

Flaga określająca, czy również traktować skojarzoną metodę jako czasownik projektanta dla skojarzonego składnika.

Uwagi

includeAsDesignerVerb Jeśli parametr jest ustawiony na truewartość , element jest również uznawany za element DesignerVerb; w związku z tym zostanie dodany do menu skrótów czasu projektowania składnika. Dostęp do listy czasowników projektanta można uzyskać za pośrednictwem właściwości kolekcji projektanta Verbs .

Konstruktor DesignerActionMethodItem ustawia Description właściwość na nullwartość .

Aby uzyskać więcej informacji na temat sposobu użycia parametru category do grupowania elementów na panelu, zobacz metodę GetSortedActionItems .

Zobacz też

Dotyczy

DesignerActionMethodItem(DesignerActionList, String, String, String, String)

Inicjuje DesignerActionMethodItem nowe wystąpienie klasy z określoną metodą i nazwami kategorii oraz tekstem wyświetlania i opisu.

public:
 DesignerActionMethodItem(System::ComponentModel::Design::DesignerActionList ^ actionList, System::String ^ memberName, System::String ^ displayName, System::String ^ category, System::String ^ description);
public DesignerActionMethodItem (System.ComponentModel.Design.DesignerActionList actionList, string memberName, string displayName, string category, string description);
new System.ComponentModel.Design.DesignerActionMethodItem : System.ComponentModel.Design.DesignerActionList * string * string * string * string -> System.ComponentModel.Design.DesignerActionMethodItem
Public Sub New (actionList As DesignerActionList, memberName As String, displayName As String, category As String, description As String)

Parametry

actionList
DesignerActionList

Element DesignerActionList zawierający metodę, z którą jest skojarzony ten element.

memberName
String

Nazwa metody w klasie pochodzącej z DesignerActionList klasy , która ma być wywoływana za pośrednictwem elementu panelu.

displayName
String

Tekst panelu dla tego elementu.

category
String

Wielkość liter String używana do grupowania podobnych elementów na panelu.

description
String

Tekst uzupełniający dla tego elementu, używany w etykietkach narzędzi lub pasku stanu.

Uwagi

Konstruktor DesignerActionMethodItem ustawia IncludeAsDesignerVerb właściwość na falsewartość .

Aby uzyskać więcej informacji na temat sposobu użycia parametru category do grupowania elementów na panelu, zobacz metodę GetSortedActionItems .

Zobacz też

Dotyczy

DesignerActionMethodItem(DesignerActionList, String, String, String, String, Boolean)

Inicjuje DesignerActionMethodItem nowe wystąpienie klasy z określoną metodą i nazwami kategorii, tekstem wyświetlania i opisu oraz flagą wskazującą, czy element powinien być wyświetlany w innych kontekstach interfejsu użytkownika.

public:
 DesignerActionMethodItem(System::ComponentModel::Design::DesignerActionList ^ actionList, System::String ^ memberName, System::String ^ displayName, System::String ^ category, System::String ^ description, bool includeAsDesignerVerb);
public DesignerActionMethodItem (System.ComponentModel.Design.DesignerActionList actionList, string memberName, string displayName, string category, string description, bool includeAsDesignerVerb);
new System.ComponentModel.Design.DesignerActionMethodItem : System.ComponentModel.Design.DesignerActionList * string * string * string * string * bool -> System.ComponentModel.Design.DesignerActionMethodItem
Public Sub New (actionList As DesignerActionList, memberName As String, displayName As String, category As String, description As String, includeAsDesignerVerb As Boolean)

Parametry

actionList
DesignerActionList

Element DesignerActionList zawierający metodę, z którą jest skojarzony ten element.

memberName
String

Nazwa metody w klasie pochodzącej z DesignerActionList klasy , która ma być wywoływana za pośrednictwem elementu panelu.

displayName
String

Tekst panelu dla tego elementu.

category
String

Wielkość liter String używana do grupowania podobnych elementów na panelu.

description
String

Tekst uzupełniający dla tego elementu, używany w etykietkach narzędzi lub pasku stanu.

includeAsDesignerVerb
Boolean

Flaga określająca, czy również traktować skojarzoną metodę jako czasownik projektanta dla skojarzonego składnika.

Przykłady

W poniższym przykładzie kodu pokazano, jak utworzyć kolekcję DesignerActionItem obiektów.

Pełny przykład implementowania tagów inteligentnych można znaleźć w temacie How to: Attach Smart Tags to a Windows Forms Component (Instrukcje: dołączanie tagów inteligentnych do składnika Windows Forms).

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;
}
Public Overrides Function GetSortedActionItems() _
As DesignerActionItemCollection
    Dim items As 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 Not LockColors Then
        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( _
        Me, _
        "InvertColors", _
        "Invert Colors", _
        "Appearance", _
        "Inverts the fore and background colors.", _
        True))
    End If
    items.Add( _
    New DesignerActionPropertyItem( _
    "Text", _
    "Text String", _
    "Appearance", _
    "Sets the display text."))

    'Create entries for static Information section.
    Dim location As New StringBuilder("Location: ")
    location.Append(colLabel.Location)
    Dim size As New StringBuilder("Size: ")
    size.Append(colLabel.Size)

    items.Add( _
    New DesignerActionTextItem( _
    location.ToString(), _
    "Information"))

    items.Add( _
    New DesignerActionTextItem( _
    size.ToString(), _
    "Information"))

    Return items
End Function

Uwagi

includeAsDesignerVerb Jeśli parametr jest ustawiony na truewartość , ten element jest również uznawany za element DesignerVerb; w związku z tym zostanie dodany do menu skrótów czasu projektowania składnika. Dostęp do listy czasowników projektanta można uzyskać za pośrednictwem właściwości kolekcji projektanta Verbs .

Aby uzyskać więcej informacji na temat sposobu użycia parametru category do grupowania elementów na panelu, zobacz metodę GetSortedActionItems .

Zobacz też

Dotyczy