ListDataSource 类
表示与外部数据源连接关联的信息。
继承层次结构
System.Object
Microsoft.SharePoint.Client.ClientValueObject
Microsoft.SharePoint.Client.ListDataSource
命名空间: Microsoft.SharePoint.Client
程序集: Microsoft.SharePoint.Client.Silverlight(位于 Microsoft.SharePoint.Client.Silverlight.dll 中); Microsoft.SharePoint.Client.Phone(位于 Microsoft.SharePoint.Client.Phone.dll 中) Microsoft.SharePoint.Client(位于 Microsoft.SharePoint.Client.dll 中)
语法
声明
Public NotInheritable Class ListDataSource _
Inherits ClientValueObject
用法
Dim instance As ListDataSource
public sealed class ListDataSource : ClientValueObject
备注
此类用作List和外部列表之间网桥。使用关联的List检索实体字段和数据。
从HasExternalDataSource属性中检索的ListDataSource实例。HasExternalDataSource不为 null, List对象的数据时,外部Microsoft SharePoint Foundation。
示例
此指定的网站列出的代码示例演示将外部。
using System;
using Microsoft.SharePoint.Client;
namespace Microsoft.SDK.SharePointFoundation.Samples
{
class ListDataSourceExample
{
static void Main()
{
string siteUrl = "http://MyServer/sites/MySiteCollection";
ClientContext clientContext = new ClientContext(siteUrl);
Web site = clientContext.Web;
clientContext.Load(site);
ListCollection collList = site.Lists;
clientContext.Load(
collList,
lists => lists
.Include(
list => list.Title,
list => list.DataSource)
);
clientContext.ExecuteQuery();
string messageExternal = "External Lists:\n";
string messageNormal = "Normal Lists:\n";
foreach (List targetList in collList)
if (targetList.DataSource != null)
{
// Get connection properties of the ListDataSource object.
messageExternal += "\n\t" + targetList.Title
+ "(Entity=" + targetList.DataSource.Properties["Entity"] + "; "
+ "LOB System=" + targetList.DataSource.Properties["LobSystemInstance"];
}
else
{
messageNormal += "\n\t" + targetList.Title;
}
Console.WriteLine(messageExternal);
Console.WriteLine(messageNormal);
}
}
}
线程安全性
该类型的任何公共 静态 (已共享 在 Visual Basic 中) 成员都是线程安全的。不保证任何实例成员都是线程安全的。