ISharePointConnection.ExecuteCommand<TResult> 方法 (String)
更新:2010 年 9 月
使用指定的标识符和返回值类型执行 SharePoint 命令。
命名空间: Microsoft.VisualStudio.SharePoint
程序集: Microsoft.VisualStudio.SharePoint(在 Microsoft.VisualStudio.SharePoint.dll 中)
语法
声明
Function ExecuteCommand(Of TResult) ( _
commandId As String _
) As TResult
TResult ExecuteCommand<TResult>(
string commandId
)
类型参数
- TResult
要执行的 SharePoint 命令的返回值的类型。 这必须是可由 Windows Communication Foundation (WCF) 序列化的类型。
参数
- commandId
类型:System.String
要执行的 SharePoint 命令的标识符。
返回值
类型:TResult
SharePoint 命令的返回值。
异常
异常 | 条件 |
---|---|
InvalidOperationException | SharePoint 命令的返回值类型与 TResult 类型不匹配。 |
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 序列化要求。 |
客户反馈 |