Command 요소

명령 정의를 나타냅니다.

사용량

<Command
  Name = "xs:string"
  Symbol = "xs:string"
  Id = "xs:positiveInteger union xs:string"
  Comment = "xs:string"
  LabelTitle = "xs:string"
  LabelDescription = "xs:string"
  TooltipTitle = "xs:string"
  TooltipDescription = "xs:string"
  Keytip = "xs:string">
  child elements
</Command>

특성

attribute Type 필수 설명
설명
xs:string
No
명령 요소에 주석을 추가하는 데 사용됩니다.

(xs:string)
공백 및 줄 바꿈 문자를 포함하여 모든 문자 시퀀스로 구성된 문자열입니다.
최대 길이: 250자.
ID
xs:positiveInteger union xs:string
No
고유한 리소스 ID입니다.

(xs:positiveInteger 및 xs:string의 공용 구조체)
2에서 59999 사이의 정수 값(포함 또는 0x2 및 0xea5f 16진수 포함)입니다.
최대 길이는 선택적 선행 0을 포함하여 10자입니다.
Keytip
xs:string
No
명령 요소의 바로 가기 키를 나타내는 문자열입니다.

(xs:string)
공백을 포함하여 모든 문자 시퀀스로 구성된 문자열입니다.
LabelDescription
xs:string
No
명령 요소에 표시되는 텍스트를 나타내는 문자열입니다.

(xs:string)
공백 및 줄 바꿈 문자를 포함하여 모든 문자 시퀀스로 구성된 문자열입니다.
LabelTitle
xs:string
No
명령 요소에 표시되는 텍스트를 나타내는 문자열입니다.

(xs:string)
공백 및 줄 바꿈 문자를 포함하여 모든 문자 시퀀스로 구성된 문자열입니다.
이름
xs:string
No
(xs:string)
문자 또는 밑줄과 숫자, 문자 또는 밑줄 시퀀스로 구성된 문자열입니다.
최대 길이: 100자.
기호
xs:string
No
(xs:string)
문자 또는 밑줄과 숫자, 문자 또는 밑줄 시퀀스로 구성된 문자열입니다.
최대 길이: 100자.
TooltipDescription
xs:string
No
명령 요소에 표시되는 텍스트를 나타내는 문자열입니다.

(xs:string)
공백 및 줄 바꿈 문자를 포함하여 모든 문자 시퀀스로 구성된 문자열입니다.
TooltipTitle
xs:string
No
명령 요소에 표시되는 텍스트를 나타내는 문자열입니다.

(xs:string)
공백 및 줄 바꿈 문자를 포함하여 모든 문자 시퀀스로 구성된 문자열입니다.

자식 요소

요소 Description
Command.Comment
최대 한 번 발생할 수 있습니다.

Command.Id
최대 한 번 발생할 수 있습니다.

Command.Keytip
최대 한 번 발생할 수 있습니다.

Command.LabelDescription
최대 한 번 발생할 수 있습니다.

Command.LabelTitle
최대 한 번 발생할 수 있습니다.

Command.LargeHighContrastImages
최대 한 번 발생할 수 있습니다.

Command.LargeImages
최대 한 번 발생할 수 있습니다.

Command.Name
최대 한 번 발생할 수 있습니다.

Command.SmallHighContrastImages
최대 한 번 발생할 수 있습니다.

Command.SmallImages
최대 한 번 발생할 수 있습니다.

Command.Symbol
최대 한 번 발생할 수 있습니다.

Command.TooltipDescription
최대 한 번 발생할 수 있습니다.

Command.TooltipTitle
최대 한 번 발생할 수 있습니다.

부모 요소

요소
Application.Commands

설명

필수 사항입니다.

Application.Commands 요소에 대해 한 번 이상 발생할 수 있습니다.

Command 요소의 자식 요소는 순서에 따라 발생할 수 있습니다.

일반적으로 명령 리소스는 리본 태그에 선언되지만 SetUICommandProperty를 호출하여 런타임에 설정할 수도 있습니다. 예를 들어 Command.Keytip 요소를 사용하여 태그에 값을 선언하는 대신 Command에 대한 UI_PKEY_Keytip 속성을 설정할 수 있습니다.

레이블 및 이미지와 같은 Command 속성을 SetUICommandProperty 로 설정할 수 없는 경우 InvalidateUICommand를 호출하여 무효화할 수 있습니다. 무효화 후 프레임워크는 호스트 애플리케이션에 리소스 세부 정보를 쿼리합니다.

참고

리소스가 무효화된 후에는 태그 리소스 테이블에서 리소스를 복원할 수 없습니다.

명령 정의는 태그에 선언된 각 명령에 대한 리본 태그 헤더 파일에 추가됩니다.

Keytip 값은 명령이 메뉴 항목을 통해 노출되지 않는 한 명령의 키보드 가속기 역할을 합니다. 이 경우 프레임워크는 Keytip 값을 무시하고 대신 LabelTitle 또는 UI_PKEY_Label 지정된 대로 앰퍼샌드 앞에 오는 문자를 사용합니다. LabelTitle 또는 UI_PKEY_Label 앰퍼샌드를 지정하지 않으면 키 설명이나 키보드 가속기가 노출되지 않습니다.

예제

다음 예제에서는 탭에 대한 명령 요소의 매니페스트를 보여줍니다.

<Application.Commands>
<Command Name="cmdHomeTab"
         LabelTitle="Home"
         Keytip="H" />
<Command Name="cmdClipboardGroup"
         Symbol="IDR_CMD_CLIPBOARD"
         Id="10000"
         Comment="Command definition for clipboard group"
         LabelTitle="Clipboard"
         Keytip="CB" />
<Command Name="cmdCopy"
         Symbol="IDR_CMD_COPY"
         LabelTitle="Copy"
         LabelDescription="Copy"
         Keytip="C"
         TooltipTitle="Copy"
         TooltipDescription="Click to copy">
  <Command.SmallImages>
    <Image>res/copyS_16.bmp</Image>
  </Command.SmallImages>
  <Command.LargeImages>
    <Image>res/copyL_32.bmp</Image>
  </Command.LargeImages>
</Command>
<Command Name="cmdPaste"
         Symbol="IDR_CMD_PASTE" >
  <Command.LabelTitle>Paste</Command.LabelTitle>
  <Command.LabelDescription>
    <String Content="Paste contents of clipboard"
            Id="10001"
            Symbol="IDR_RES_LABELDESC_PASTE" />
  </Command.LabelDescription>
  <Command.Keytip>P</Command.Keytip>
  <Command.TooltipTitle>
    <String Content="Paste contents of clipboard"
            Id="10002"
            Symbol="IDR_RES_TOOLTIP_PASTE"/>
  </Command.TooltipTitle>
  <Command.TooltipDescription>
    <String Content="Click to paste contents of clipboard"/>
  </Command.TooltipDescription>
  <Command.SmallImages>
    <Image
      Id="10010"
      MinDPI="96"
      Symbol="IDR_RES_SMALL_IMAGE96">
      <Image.Source>res/pasteS_96bpp.bmp</Image.Source>
    </Image>
    <Image Source="res/pasteS_120bpp.bmp"
           Id="10011"
           MinDPI="120"
           Symbol="IDR_RES_SMALL_IMAGE120" />
  </Command.SmallImages>
  <Command.LargeImages>
    <Image>res/pasteL_32.bmp</Image>
  </Command.LargeImages>
</Command>
<Command Name="cmdMinimize"
         Symbol="IDR_CMD_MINIMIZE"
         Id="10001"
         LabelTitle="Minimize" />
</Application.Commands>

요소 정보

  • 지원되는 최소 시스템: Windows 7
  • 비워 둘 수 있음: 아니요