共用方式為


SPFieldCollection Members

Include Protected Members
Include Inherited Members

Represents a collection of SPField objects.

The SPFieldCollection type exposes the following members.

Constructors

  Name Description
Public method SPFieldCollection Initializes a new instance of the SPFieldCollection class based on the specified website and schema.

Top

Properties

  Name Description
Public property Count Gets the number of fields in the collection. (Overrides SPBaseCollection.Count.)
Public property Item[Guid] Gets the field with the specified identifier (ID) from the collection.
Public property Item[Int32] Gets the field object at the specified index in the collection. In Microsoft C#, this property is an indexer for the SPFieldCollection class.
Public property Item[String] Gets the field with the specified display name from the collection. In Microsoft C#, this property is an indexer for the SPFieldCollection class.
Public property List Gets the parent list of the collection.
Public property SchemaXml Gets the schema that defines the collection.
Public property SchemaXmlWithResourceTokens Read-only property that retrieves extended XML schema for the field using resource tokens.
Public property UpgradedPersistedProperties (Inherited from SPAutoSerializingObject.)
Public property Web Gets the parent website of the fields.

Top

Methods

  Name Description
Public method Add(SPField) Adds a field to the collection based on the specified field.
Public method Add(String, SPFieldType, Boolean) Creates a field in the collection based on the specified display name, field type, and Boolean value.
Public method Add(String, SPFieldType, Boolean, Boolean, StringCollection) Creates a field in the collection based on the specified display name, field type, Boolean values for other field properties, and choices in the case of a Choice field.
Public method AddDependentLookup Adds a secondary lookup field that depends on a primary lookup field for its relationship to the list where it gets its information.
Public method AddFieldAsXml(String) Creates a field based on the specified schema.
Public method AddFieldAsXml(String, Boolean, SPAddFieldOptions) Creates a field based on the specified schema, Boolean value, and field options.
Public method AddLookup(String, Guid, Boolean) Creates a lookup field in the collection of fields for one list that points to a field in the collection for another list in the same website.
Public method AddLookup(String, Guid, Guid, Boolean) Creates a lookup field in the collection of fields for one list that points to a field in the collection for another list in a different website.
Public methodStatic member AddSPFieldCreatorDelegate Adds a SPField callback to the list of field creator delegates.
Public method Contains Returns a Boolean value that indicates whether the collection contains the field with the specified GUID.
Public method ContainsField Returns a Boolean value that indicates whether the collection contains the specified field.
Public method ContainsFieldWithStaticName Returns a Boolean value that indicates whether the collection contains the field with the specified static name.
Public method CreateNewField Creates a field based on the specified type name and display name.
Public method Delete Deletes the field with the specified internal, display or static name from the collection.
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method GetEnumerator Gets an enumerator to iterate through the collection. (Inherited from SPBaseCollection.)
Public method GetField Returns the field with the specified internal, display, or static name from the collection.
Public method GetFieldByInternalName Returns the field with the specified internal name from the collection.
Public method GetHashCode (Inherited from Object.)
Public method GetObjectData (Inherited from SPAutoSerializingObject.)
Public method GetType (Inherited from Object.)
Public method GetTypedEnumerator<T> Returns a type-safe enumerator to iterate through the collection. (Inherited from SPBaseCollection.)
Protected method MemberwiseClone (Inherited from Object.)
Protected method OnDeserialization (Inherited from SPAutoSerializingObject.)
Public method ToString (Inherited from Object.)
Public method TryGetFieldByStaticName Returns the field with the specified static name from the collection.
Protected method UpdateParent (Inherited from SPAutoSerializingObject.)

Top

Explicit Interface Implementations

  Name Description
Explicit interface implemetationPrivate method ICollection.CopyTo Copies the elements of the collection to an array, starting at the specified array index. (Inherited from SPBaseCollection.)
Explicit interface implemetationPrivate property ICollection.IsSynchronized Gets a Boolean value that indicates whether access to the collection is synchronized or thread-safe. (Inherited from SPBaseCollection.)
Explicit interface implemetationPrivate property ICollection.SyncRoot Gets an object that is used to synchronize access to the collection. (Inherited from SPBaseCollection.)

Top

See Also

Reference

SPFieldCollection Class

Microsoft.SharePoint Namespace