Class PostedFileCollection
- Namespace
- Dynamicweb.Environment
- Assembly
- Dynamicweb.Core.dll
Base implementation for abstraction of filecollection for posted files, as used in Dynamicweb.
public class PostedFileCollection : ICollection<PostedFileBase>, IEnumerable<PostedFileBase>, IEnumerable
- Inheritance
-
Posted
File Collection
- Implements
- Inherited Members
- Extension Methods
Constructors
PostedFileCollection()
Constructs a default collection using a list as backing data collection.
Properties
AllKeys
Gets an array that contains the keys (names) of all posted file objects in the collection.
Property Value
- string[]
Collection
Backing data collection
Property Value
Count
Contains posted file objects.
Property Value
IsReadOnly
Gets a value indicating whether the collection is read-only.
Property Value
this[string]
Gets the posted file object that has the specified name from the collection.
Parameters
name
stringThe name of the object to return.
Property Value
Methods
Add(PostedFileBase)
Adds an item to the collection
Parameters
item
PostedFile Base The file to add to the collection
Clear()
Removes all items from the collection
Contains(PostedFileBase)
Determines whether the collection contains a specific value.
Parameters
item
PostedFile Base The file to locate in the collection
Returns
- bool
true if item is found in the collections; otherwise, false
CopyTo(PostedFileBase[], int)
Copies the elements of the collection to an array, starting at a particular array index.
Parameters
array
PostedFile []Base The one-dimensional array that is the destination of the elements copied from the collections. The array must have zero-based indexing
arrayIndex
intThe zero-based index in array at which copying begins
GetEnumerator()
Returns an enumerator that iterates through the collection
Returns
- IEnumerator
An enumerator that can be used to iterate through the collection
GetFile(string)
Returns the posted file object that has the specified name from the collection.
Parameters
name
stringThe name of the object to return.
Returns
- Posted
File Base The posted file object that is specified by name.
GetFiles(string)
When implemented in a derived class, returns all files that match the specified name.
Parameters
name
stringThe name to match.
Returns
- IList<Posted
File >Base The collection of files.
GetName(PostedFileBase)
Used to get the name of the file.
Parameters
file
PostedFile Base File to get name of
Returns
- string
Name of file
Remarks
Can be overriden to change how files are matched to name in collection
Remove(PostedFileBase)
Removes the first occurrence of a specific object from the collection
Parameters
item
PostedFile Base The file to remove from the collection
Returns
- bool
true if item was successfully removed from the collection; otherwise, false