Compartilhar via


SPUserStorageCollection Class

The SPUserStorageCollection class represents a collection of SPUserStorage objects used to maintain storage information for all users of a Web Part Page.

System.Object

   System.Collections.ReadOnlyCollectionBase

      Microsoft.SharePoint.SPUserStorageCollection

Public Methods

The following table shows the public methods of the SPUserStorageCollection class and a brief description of each.

Name Description
CopyTo Copies the elements of the collection to an array of user storage objects, starting at the specified array index.
GetEnumerator Returns an enumerator to iterate through the collection.

Public Properties

The following table shows the public properties of the SPUserStorageCollection class, the data type of each property, and a brief description of each.

Name Data Type Description
Count Int32 Gets the number of user storage objects in the collection.
IsSynchronized Boolean Gets a Boolean value that indicates whether access to the collection is synchronized or thread safe.
Item Microsoft.SharePoint.SPUserStorage Gets the user storage object at the specified index in the collection.
SyncRoot Object Gets an object used to synchronize access to the collection.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread safe.

Remarks

Use the LengthByUser property of the SPFile class to return a collection of user storage objects that contain information about each user of a Web Part Page. Use an indexer to return a single user storage object from the collection. For example, if the collection is assigned to a variable named myUserStorages, use myUserStorages[index] in C#, or myUserStorages(index) in Visual Basic .NET, where index is the index number of the user storage in the collection. You can also use a foreach statement (For Each in Visual Basic .NET) to iterate through the collection and return the user storage objects.

Requirements

Namespace: Microsoft.SharePoint

Platforms: Microsoft Windows Server 2003

Assembly: Windows SharePoint Services (in Microsoft.SharePoint.dll)

Security: Code Access Security