执行指定的命令。
命名空间: EnvDTE80
程序集: EnvDTE80(在 EnvDTE80.dll 中)
语法
声明
Sub Raise ( _
Guid As String, _
ID As Integer, _
<OutAttribute> ByRef CustomIn As Object, _
<OutAttribute> ByRef CustomOut As Object _
)
void Raise(
string Guid,
int ID,
out Object CustomIn,
out Object CustomOut
)
void Raise(
[InAttribute] String^ Guid,
[InAttribute] int ID,
[InAttribute] [OutAttribute] Object^% CustomIn,
[InAttribute] [OutAttribute] Object^% CustomOut
)
abstract Raise :
Guid:string *
ID:int *
CustomIn:Object byref *
CustomOut:Object byref -> unit
function Raise(
Guid : String,
ID : int,
CustomIn : Object,
CustomOut : Object
)
参数
Guid
类型:String必需。 该命令的 GUID。
ID
类型:Int32必需。 该命令的 ID。
CustomIn
类型:Object%必需。 在 OLECommandTarget 的参数。
CustomOut
类型:Object%必需。 OLECommandTarget 的输出参数。
示例
Sub RaiseExample()
' Before running, you must add a reference to the Office
' typelib to gain access to the CommandBar object.
Dim cmds As Commands
Dim cmdobj As Command
Dim customin, customout As Object
Dim colAddins As AddIns
' Set references.
colAddins = DTE.AddIns()
cmds = DTE.Commands
cmdobj = cmds.Item("File.NewFile")
' Execute the File.NewFile command.
cmds.Raise(cmdobj.Guid, cmdobj.ID, customin, customout)
End Sub
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关详细信息,请参阅通过部分受信任的代码使用库。