ISharePointConnection.ExecuteCommand<T> 方法 (String, T)
更新:2010 年 9 月
使用指定的标识符和参数类型执行 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 Serializer 和 Using the XmlSerializer Class.
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。
请参见
参考
Microsoft.VisualStudio.SharePoint 命名空间
修订记录
Date |
修订记录 |
原因 |
---|---|---|
2010 年 9 月 |
记录参数的 WCF 序列化要求。 |
客户反馈 |