2010-04-13 4 views
0

MenuAction, ButtonAction, ... 등 왜이 유형의 사용이 필요합니다. 나는 그것이 무엇인지 [ButtonAction ("적용", "전역 도구 모음/ToolbarMyTools/도구 1", "적용")]. 당신은 나에게 조언이나 사이트 링크를 줄 수 있습니까? 나는 정말로 [Myclass]를 모른다. AOP인가요?사용법 "[MenuAction ("apply ","global-menus/MenuTools/MenuToolsMyTools/Tool1 ","Apply ")]"?

[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")]

답변

0

이들은 속성입니다. 자체적으로 아무 것도하지 않지만 리플렉션을 사용하여 접근 할 수 있습니다.

아마도 이러한 속성을 구문 분석하고 메뉴 및 툴팁을 생성하는 프레임 워크 유형의 것이 있습니다.

+0

세부 사항이나 샘플 또는 링크를 제공해 주시겠습니까? – programmerist

+0

MSDN의 자습서는 예제를 통해 설명합니다. http://msdn.microsoft.com/en-us/library/aa288454(VS.71).aspx –

관련 문제