مشاركة عبر


Commands.CommandInfo أسلوب

الأمر بإرجاع معرف فريد عمومي "و" معرف المقترنة Microsoft.VisualStudio.CommandBars.CommandBar المعطاة عنصر تحكم.

مساحة الاسم:  EnvDTE
التجميع:  EnvDTE (في EnvDTE.dll)

بناء الجملة

'إقرار
Sub CommandInfo ( _
    CommandBarControl As Object, _
    <OutAttribute> ByRef Guid As String, _
    <OutAttribute> ByRef ID As Integer _
)
void CommandInfo(
    Object CommandBarControl,
    out string Guid,
    out int ID
)
void CommandInfo(
    [InAttribute] Object^ CommandBarControl, 
    [OutAttribute] String^% Guid, 
    [OutAttribute] int% ID
)
abstract CommandInfo : 
        CommandBarControl:Object * 
        Guid:string byref * 
        ID:int byref -> unit 
function CommandInfo(
    CommandBarControl : Object, 
    Guid : String, 
    ID : int
)

المعلمات

  • CommandBarControl
    النوع: System.Object
    مطلوبة.عنصر التحكم Microsoft.VisualStudio.الأمرBars.الأمرBar المقترنة الأمر.
  • Guid
    النوع: System.String%
    مطلوبة.معرّف فريد عالمي الأمر's.
  • ID
    النوع: System.Int32%
    مطلوبة.المعرف. الأمر

أمثلة

' Macro code.
Sub CommandInfoExample()
   Dim cmds As Commands
   Dim cmdobj As Command
   Dim cmdbarobj As CommandBar
   Dim cmdbarctl As CommandBarControl
   Dim colAddins As AddIns
   Dim GUID As String
   Dim ID As Long

   ' Set references.
   colAddins = DTE.AddIns()
   cmds = DTE.Commands
   cmdobj = cmds.Item("File.NewFile")
   GUID = ""
   ID = 0

   ' Create a toolbar and add the File.NewFile command to it.
   cmdbarobj = cmds.AddCommandBar("AACmdBar", _
   vsCommandBarType.vsCommandBarTypeToolbar)
   MsgBox("Commandbar name: " & cmdbarobj.Name)
   cmdbarctl = cmdobj.AddControl(cmdbarobj)
   ' Assign new GUID and ID to the command bar control.
   cmds.CommandInfo(cmdbarctl, GUID, ID)
End Sub

أمن NET Framework.

راجع أيضًَا

المرجع

Commands واجهة

Commands الأعضاء

EnvDTE مساحة الاسم