Implements the basic functionality for a personalization provider.
public ref class PersonalizationProvider abstract : System::Configuration::Provider::ProviderBase
public abstract class PersonalizationProvider : System.Configuration.Provider.ProviderBase
type PersonalizationProvider = class inherit ProviderBase
Public MustInherit Class PersonalizationProvider Inherits ProviderBase
This is the abstract base class that defines the required functionality of a personalization provider. A personalization provider both loads and stores personalization data on behalf of a WebPartPersonalization instance.
The base class defines standard behavior for a number of methods; only those methods that specifically deal with the underlying data store are marked abstract. This allows a developer to write a custom provider to interact with a specific data store, without needing to re-implement standard functionality used by the WebPartPersonalization class.
Notes to Inheritors
You can derive from PersonalizationProvider and provide implementations for only the abstract methods defined in this class. The abstract methods deal specifically with saving and loading data to a physical data store, and with data store administration. A custom provider must be capable of manipulating personalization information in a manner that distinguishes Shared data from User data. Furthermore, a provider must segment personalization data by page as well as by application.
Implementations of PersonalizationProvider are tightly coupled to implementations of PersonalizationState because some personalization provider methods return instances of PersonalizationState-derived classes. To ease development of custom providers, the PersonalizationProvider base class includes a default implementation of the personalization logic and serialization/deserialization logic that is used directly by the WebPartPersonalization class. As a result, authoring a custom provider solely for the purpose of working with a different data store only requires implementation of the following abstract methods:
GetCountOfState(PersonalizationScope, PersonalizationStateQuery) - This method needs to be able to count the number of rows of personalization data in the database for the supplied query parameters.
LoadPersonalizationBlobs(WebPartManager, String, String, Byte, Byte) - Given the path and user name, this method loads two binary large objects (BLOBs) from the database: one BLOB for shared data and one for user data. If you supply the user name and path, then you do not need the WebPartManager control to access the page information that can provide the user name/path information.
ResetPersonalizationBlob(WebPartManager, String, String) - Given the path and user name, this method deletes the corresponding row in the database. If you supply the user name and path, then you do not need the WebPartManager control to access the page information that can provide the user name/path information.
SavePersonalizationBlob(WebPartManager, String, String, Byte) - Given the path and user name, this method saves the supplied BLOB to the database. If you supply the user name and path, then you do not need the WebPartManager control to access the page information that can provide the user name/path information.
In all of these methods, if only a path is supplied, that indicates the shared personalization data for the page is being operated upon. If both a path and a username are passed to a method, then the user personalization data for the page should be acted upon. In the case of LoadPersonalizationBlobs(WebPartManager, String, String, Byte, Byte), the shared data for the specified path should always be loaded, and optionally the user personalization data for the path should also be loaded if the username is not
All other abstract methods are intended for use only in administrative applications and are not used by the Web Parts infrastructure at run time. For an example of an implementation of a personalization provider, see the SqlPersonalizationProvider class.
|PersonalizationProvider() PersonalizationProvider() PersonalizationProvider() PersonalizationProvider()||
Initializes a new instance of the PersonalizationProvider class.
|ApplicationName ApplicationName ApplicationName ApplicationName||
When overridden in a derived class, gets or sets the name of the application configured for the provider.
|Description Description Description Description||
Gets a brief, friendly description suitable for display in administrative tools or other user interfaces (UIs).(Inherited from ProviderBase)
|Name Name Name Name||
Gets the friendly name used to refer to the provider during configuration.(Inherited from ProviderBase)