Field 類別
代表Microsoft SharePoint Foundation網站上的清單中的欄位。
繼承階層架構
System.Object
Microsoft.SharePoint.Client.ClientObject
Microsoft.SharePoint.Client.Field
命名空間: 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 Field _
Inherits ClientObject
'用途
Dim instance As Field
public class Field : ClientObject
備註
欄位是清單或內容類型的結構描述,指定屬性的清單項目所追蹤的項目。欄位有內部的名稱,指定欄位的識別碼。欄位內部名稱是唯一在其他欄位] 清單內,而且不能包含空格。欄位有識別碼,這是 GUID。欄位具有指定的欄位類型。欄位也包含設定] 及 [其他欄位類型所指定的中繼資料的陳述式資訊。
範例
此程式碼範例會取得指定的欄位、 建立的描述] 欄位中,並顯示的欄位標題和新的描述。
using System;
using Microsoft.SharePoint.Client;
namespace Microsoft.SDK.SharePointFoundation.Samples
{
class FieldExample
{
static void Main()
{
string siteUrl = "http://MyServer/sites/MySiteCollection";
ClientContext clientContext = new ClientContext(siteUrl);
Web site = clientContext.Web;
List taskList = site.Lists.GetByTitle("Tasks");
FieldCollection collField = taskList.Fields;
Field oneField = collField.GetByInternalNameOrTitle("Title");
oneField.Description = "MyNewFieldDescription";
oneField.Update();
clientContext.Load(collField);
clientContext.Load(oneField);
clientContext.ExecuteQuery();
string fieldInfo = "Field Title: " + oneField.Title + "\n" +
"Description: " + oneField.Description + "\n";
Console.WriteLine(fieldInfo);
}
}
}
執行緒安全
這類型的任何公用 static (共用 於 Visual Basic 中) 成員是安全執行緒。不保證任何執行個體成員都是安全執行緒。
請參閱
參照
Microsoft.SharePoint.Client 命名空間
繼承階層架構
System.Object
Microsoft.SharePoint.Client.ClientObject
Microsoft.SharePoint.Client.Field
Microsoft.SharePoint.Client.FieldCalculated
Microsoft.SharePoint.Client.FieldComputed
Microsoft.SharePoint.Client.FieldDateTime
Microsoft.SharePoint.Client.FieldGeolocation
Microsoft.SharePoint.Client.FieldGuid
Microsoft.SharePoint.Client.FieldLookup
Microsoft.SharePoint.Client.FieldMultiChoice
Microsoft.SharePoint.Client.FieldMultiLineText
Microsoft.SharePoint.Client.FieldNumber
Microsoft.SharePoint.Client.FieldText
Microsoft.SharePoint.Client.FieldUrl