Condividi tramite


SPFileCollection Members

Include Protected Members
Include Inherited Members

Represents a collection of SPFile objects.

The SPFileCollection type exposes the following members.

Properties

  Name Description
Public property Count Gets the number of files in the collection. (Overrides SPBaseCollection.Count.)
Public property Folder Gets the parent folder of the collection.
Public property Item[Int32] Gets the file object at the specified index in the collection. In Microsoft Visual C#, this property is an indexer for the SPFileCollection class.
Public property Item[String] Gets the file object with the specified URL from the collection. In Microsoft Visual C#, this property is an indexer for the SPFileCollection class.
Public property UpgradedPersistedProperties (Inherited from SPAutoSerializingObject.)
Public property Web Gets the site to which the collection belongs.

Top

Methods

  Name Description
Public method Add(String, SPTemplateFileType) Creates a file in the collection using the specified URL and template file type.
Public method Add(String, []) Creates a file in the collection using the specified URL and a byte array that contains the file.
Public method Add(String, Stream) Creates a file in the collection using the specified URL and a stream that contains the contents of a file.
Public method Add(String, [], SPFileCollectionAddParameters) Creates a file in the collection using the specified URL, a byte array that contains the contents of a file, and an SPFileCollectionAddParameters object.
Public method Add(String, [], Boolean) Creates a file in the collection using the specified URL, a byte array that contains the contents of a file, and a Boolean value that specifies whether to overwrite any file that has the same name.
Public method Add(String, [], Hashtable) Creates a file in the collection using the specified URL, a byte array that contains the contents of a file, and a hash table that contains metadata for the file.
Public method Add(String, Stream, SPFileCollectionAddParameters) Creates a file in the collection using the specified URL, a stream that contains the contents of a file, and an SPFileCollectionAddParameters object.
Public method Add(String, Stream, Boolean) Creates a file in the collection using the specified URL, a stream that contains the contents of a file, and a Boolean value that specifies whether to overwrite any file that has the same name.
Public method Add(String, Stream, Hashtable) Creates a file in the collection using the specified URL, a stream that contains the contents of a file, and a hash table that contains metadata for the file.
Public method Add(String, [], Hashtable, Boolean) Creates a file in the collection using the specified URL, a byte array that contains the contents of a file, a hash table that contains metadata for the file, and a Boolean value that specifies whether to overwrite any file that has the same name.
Public method Add(String, Stream, Hashtable, Boolean) Creates a file in the collection using the specified URL, a stream that contains the contents of a file, a hash table that contains metadata for the file, and a Boolean value that specifies whether to overwrite any file that has the same name.
Public method Add(String, [], Boolean, String, Boolean) Creates a file in the collection using the specified URL, a byte array that contains the contents of a file, a Boolean value that specifies whether to overwrite any file that has the same name, a check-in comment, and a Boolean value that specifies whether to check required fields.
Public method Add(String, Stream, Boolean, String, Boolean) Creates a file in the collection using the specified URL, a stream that contains the contents of a file, a Boolean value that specifies whether to overwrite any file that has the same name, a check-in comment, and a Boolean value that specifies whether to check required fields.
Public method Add(String, Stream, Hashtable, Boolean, Boolean) Creates a file in the collection based on the specified URL, a Stream object that contains a file, and a hash table that contains metadata for the file.
Public method Add(String, [], SPUser, SPUser, DateTime, DateTime) Creates a file in the collection using the specified URL, a byte array that contains the contents of a file, user objects that represent the users who created and last modified the file, and DateTime values that specify when they did so.
Public method Add(String, Stream, SPUser, SPUser, DateTime, DateTime) Creates a file in the collection using the specified URL, a stream that contains the contents of a file, user objects that represent the users who created and last modified the file, and DateTime values that specify when they did so.
Public method Add(String, Stream, Boolean, Boolean, Stream, String) Creates a file in the collection using the specified URL, a stream that contains the contents of a file, a Boolean value that specifies whether to overwrite any file that has the same name, a Boolean value that specifies whether to check required fields, a stream that contains file format metadata, and an output variable to receive an ETag.
Public method Add(String, [], Hashtable, SPUser, SPUser, DateTime, DateTime, Boolean) Creates a file in the collection using the specified URL, a byte array that contains the contents of a file, a hash table that contains metadata for the file, user objects that represent the users who created and last modified the file, DateTime values that specify when they did so, and a Boolean value that specifies whether to overwrite any file that has the same name.
Public method Add(String, Stream, Hashtable, SPUser, SPUser, DateTime, DateTime, String, Boolean) Creates a file in the collection using the specified URL, a stream that contains the contents of a file, a hash table that contains metadata for the file, user objects that represent the users who created and last modified the file, DateTime values that specify when they did so, a check-in comment, and a Boolean value that specifies whether to overwrite any file that has the same name.
Public method Add(String, Stream, Hashtable, SPUser, SPUser, DateTime, DateTime, String, Boolean, Boolean) Creates a file in the collection based on the specified URL, on a Stream object that contains a file, a Hashtable object that contains metadata for the file, on SPUser objects that represent the users who created and last modified the file, and on DateTime values that specify when they did so.
Public method Delete Deletes the file located at the specified URL.
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 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.)
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

SPFileCollection Class

Microsoft.SharePoint Namespace