次の方法で共有


FieldCollection クラス

Represents a collection of Field objects.

継承階層

System.Object
  Microsoft.SharePoint.Client.ClientObject
    Microsoft.SharePoint.Client.ClientObjectCollection
      Microsoft.SharePoint.Client.ClientObjectCollection<Field>
        Microsoft.SharePoint.Client.FieldCollection

名前空間:  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 FieldCollection _
    Inherits ClientObjectCollection(Of Field)
'使用
Dim instance As FieldCollection
public class FieldCollection : ClientObjectCollection<Field>

注釈

The Document library templates sample app for SharePoint includes an example of how to use this object.

This code example displays the available fields in the Announcements list.

using System;
using Microsoft.SharePoint.Client;

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

            ClientContext clientContext = new ClientContext(siteUrl);
            Web site = clientContext.Web;
            List targetList = site.Lists.GetByTitle("Announcements");
            FieldCollection collField = targetList.Fields;
            clientContext.Load(
               collField, 
               fields => fields
                  .Include(field => field.Title)
               );
            clientContext.ExecuteQuery();

            Console.WriteLine("The following fields are available in the Announcements list:\n\n");
            foreach (Field myField in collField)
               Console.WriteLine(myField.Title);
        }
    }
}

スレッド セーフ

この型のパブリック static (Visual Basic のShared ) メンバーはいずれもスレッド セーフです。インスタンス メンバーはスレッド セーフになるという保証はありません。

関連項目

参照先

FieldCollection メンバー

Microsoft.SharePoint.Client 名前空間