что за использование "[MenuAction (" apply "," global-menus / MenuTools / MenuToolsMyTools / Tool1 "," Apply ")]"? - PullRequest
0 голосов
/ 13 апреля 2010

MenuAction, ButtonAction, ... и т. Д., Почему мне нужно использовать этот тип. Я действительно, что это [ButtonAction («применить», «глобальные панели инструментов / ToolbarMyTools / Tool1», «Применить»)]. Можете ли вы дать мне несколько советов или совет или ссылку на сайт. Я действительно не знаю [Myclass]. это АОП?

 [MenuAction("apply", "global-menus/MenuTools/MenuToolsMyTools/Tool1", "Apply")]

    // Declares a toolbar button action with action ID "apply"
    // TODO: Change the action path hint to your desired toolbar path, or
    // remove this attribute if you do not want to create a toolbar button for this tool
    [ButtonAction("apply", "global-toolbars/ToolbarMyTools/Tool1", "Apply")]

    // Specifies tooltip text for the "apply" action
    // TODO: Replace tooltip text
    [Tooltip("apply", "Place tooltip text here")]

    // Specifies icon resources to use for the "apply" action
    // TODO: Replace the icon resource names with your desired icon resources
    [IconSet("apply", IconScheme.Colour, "Icons.Tool1Small.png", "Icons.Tool1Medium.png", "Icons.Tool1Large.png")]

    // Specifies that the enablement of the "apply" action in the user-interface
    // is controlled by observing a boolean property named "Enabled", listening to
    // an event named "EnabledChanged" for changes to this property
    [EnabledStateObserver("apply", "Enabled", "EnabledChanged")]

1 Ответ

0 голосов
/ 13 апреля 2010

Это атрибуты - они ничего не делают сами по себе, но вы можете подойти к ним, используя Reflection.

Вероятно, есть какой-то фреймворк, который анализирует эти атрибуты и создает для вас меню и всплывающие подсказки.

...