RelatedField 类

Specifies a relationship to a lookup field.

继承层次结构

System.Object
  Microsoft.SharePoint.Client.ClientObject
    Microsoft.SharePoint.Client.RelatedField

命名空间:  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 Class RelatedField _
    Inherits ClientObject
用法
Dim instance As RelatedField
public class RelatedField : ClientObject

示例

This code example displays the identifier of fields related to the Tasks list of the specified site.

using System;
using Microsoft.SharePoint.Client;

namespace Microsoft.SDK.SharePointFoundation.Samples
{
    class RelatedFieldExample
    {
        static void Main()
        {
            string siteUrl = "http://MyServer/sites/MySiteCollection";

            ClientContext clientContext = new ClientContext(siteUrl);
            Web site = clientContext.Web;

            List targetList = site.Lists.GetByTitle("Tasks");

            // Get a collection of lookup fields that use this list as a data source 
            // and that have FieldLookup.IsRelationship set to true.
            RelatedFieldCollection collRelatedField = targetList.GetRelatedFields();

            clientContext.Load(collRelatedField);
            clientContext.ExecuteQuery();

            foreach (RelatedField relField in collRelatedField)
               Console.WriteLine("Related Field ID: {0}", relField.FieldId);
        }
    }
}

线程安全性

该类型的任何公共 静态 (已共享 在 Visual Basic 中) 成员都是线程安全的。不保证任何实例成员都是线程安全的。

另请参阅

引用

RelatedField 成员

Microsoft.SharePoint.Client 命名空间