ISharePointConnection.ExecuteCommand<T> 方法 (String, T)

使用指定的标识符和参数类型执行 SharePoint 命令。

命名空间:  Microsoft.VisualStudio.SharePoint
程序集:  Microsoft.VisualStudio.SharePoint(在 Microsoft.VisualStudio.SharePoint.dll 中)

语法

声明
Sub ExecuteCommand(Of T) ( _
    commandId As String, _
    arg As T _
)
void ExecuteCommand<T>(
    string commandId,
    T arg
)

类型参数

  • T
    要执行的 SharePoint 命令的参数的类型。这必须是可由 Windows Communication Foundation (WCF) 序列化的类型。

参数

  • commandId
    类型:System.String
    要执行的 SharePoint 命令的标识符。
  • arg
    类型:T
    要传递给 SharePoint 命令的参数。

异常

异常 条件
InvalidOperationException

SharePoint 命令的参数类型与 T 类型不匹配。

SharePointConnectionException

与 SharePoint 连接时发生错误。

ArgumentOutOfRangeException

commandId 与任何可用的 SharePoint 命令都不匹配。

SharePointCommandException

SharePoint 命令失败引发异常。

备注

使用此方法执行具有自定义参数但没有返回值的 SharePoint 命令。有关更多信息,请参见如何:创建 SharePoint 命令如何:执行 SharePoint 命令

关于可以被 Windows Communication Foundation (WCF) 序列化的类型的详细信息,请参见 Types Supported by the Data Contract SerializerUsing the XmlSerializer Class.

.NET Framework 安全性

请参见

参考

ISharePointConnection 接口

ExecuteCommand 重载

Microsoft.VisualStudio.SharePoint 命名空间