Click here to Skip to main content
15,896,606 members
Articles / Programming Languages / C#

Pfz.Caching - ViewIds instead of ViewStates

Rate me:
Please Sign up or sign in to vote.
4.85/5 (13 votes)
10 May 2010CPOL8 min read 43K   239   25  
Framework for caching data that includes the possibility to store ViewStates in files, reutilizing identical files as an way to avoid too much HD usage
<?xml version="1.0"?>
<doc>
    <assembly>
        <name>Pfz.Caching</name>
    </assembly>
    <members>
        <member name="T:Pfz.Caching.PfzPageAdapter">
            <summary>
            Uses the caching mechanism to
            </summary>
        </member>
        <member name="M:Pfz.Caching.PfzPageAdapter.GetStatePersister">
            <summary>
            Returns a PfzPageStatePersister for the actual page.
            </summary>
        </member>
        <member name="T:Pfz.Caching.Cache`1">
            <summary>
            This object is capable of caching any serializable object.
            It saves the information in a file in a directory specified by Cache.CacheDirectory. If two
            objects are identical, they end-up saved as only one file. This cache object can also be serialized,
            so you can put large information into a ViewState as a cache object, so the file stays at the server,
            and only a reference to that information is sent to the client.
            StatedPage simple reads the State dictionary from the ViewState, creating it if the ViewState does not
            contains it.
            </summary>
            <typeparam name="T"></typeparam>
        </member>
        <member name="T:Pfz.Caching.ICache">
            <summary>
            Use this interface if you know you will receive a Cache object, but you
            don't care about the real typing of the data, so everything is returned simple
            as object.
            </summary>
        </member>
        <member name="P:Pfz.Caching.ICache.Target">
            <summary>
            Gets the cached item from memory or file.
            </summary>
            <returns></returns>
        </member>
        <member name="P:Pfz.Caching.ICache.InMemoryTarget">
            <summary>
            Gets the cached item only if it is still in memory.
            </summary>
            <returns></returns>
        </member>
        <member name="M:Pfz.Caching.Cache`1.#ctor(`0)">
            <summary>
            Creates a Cache object for the specified item.
            </summary>
            <param name="value">The item to be cached.</param>
        </member>
        <member name="M:Pfz.Caching.Cache`1.#ctor(`0,System.Boolean)">
            <summary>
            Creates a Cache object for the specified item, and allows you to
            tell if immediate expiration is allowed or not.
            </summary>
            <param name="value">The item to be cached.</param>
            <param name="allowImmediateExpiration">
            A boolean value indicating if the object can be collected as soon as
            possible or not.
            If not, a KeepAlive is done.
            </param>
        </member>
        <member name="M:Pfz.Caching.Cache`1.CreateFromSerializedBuffer(System.Byte[])">
            <summary>
            Creates a new cache object using the given serialized information from
            a BinaryFormatter.
            You must guarantee that such serialized information is of type T.
            </summary>
            <param name="buffer">The buffer that you already serialized.</param>
            <returns>A new cache object that can be reconstructed from such buffer.</returns>
        </member>
        <member name="M:Pfz.Caching.Cache`1.GetHashCode">
            <summary>
            Returns the checksum of the serialized buffer as the HashCode.
            </summary>
        </member>
        <member name="M:Pfz.Caching.Cache`1.Equals(System.Object)">
            <summary>
            Compares this object to another object.
            </summary>
        </member>
        <member name="M:Pfz.Caching.Cache`1.Equals(Pfz.Caching.Cache{`0})">
            <summary>
            Compares if this Cache points to the same cache information of another cache.
            Only the reference (not the actual object) is compared.
            </summary>
        </member>
        <member name="P:Pfz.Caching.Cache`1.Target">
            <summary>
            Gets the cached item from memory or file and keeps it alive.
            </summary>
            <returns>The cached item, or null if it is not in memory and it's file was also deleted.</returns>
        </member>
        <member name="P:Pfz.Caching.Cache`1.InMemoryTarget">
            <summary>
            Gets the cached item only if it is still in memory.
            </summary>
            <returns>
            The cached item.
            Can cause an exception if the item was collected and T is a value-type.
            </returns>
        </member>
        <member name="P:Pfz.Caching.Cache`1.InMemoryTargetAllowingExpiration">
            <summary>
            Gets the target that is in memory, without trying to reload it and
            without calling KeepAlive.
            </summary>
        </member>
        <member name="P:Pfz.Caching.Cache`1.LongHashCode">
            <summary>
            Gets a 64-bit hashcode.
            </summary>
        </member>
        <member name="T:Pfz.Caching.PaginatedCollection`1">
            <summary>
            This collection is able to paginate data and also uses caching.
            When it is created, all data is enumerated and paginated. Then, you
            will only use the cached pages, as read-only objects. If you modify the
            items in the page, you may receive the "old" version of data when it is
            collected and read again from buffer, so if your type is modifiable,
            you must guarantee not to modify it.
            Also, the serialization of this object will serialize the references
            to each page. If you want only one reference, serialize a CacheManager.Create()
            of this collection. This is not needed if this object is put inside a
            CacheDictionary, as the CacheDictionary already does this.
            </summary>
            <typeparam name="T">The type of the items in each page.</typeparam>
        </member>
        <member name="T:Pfz.Caching.IPaginatedCollection`1">
            <summary>
            Interface that must be implemented by PaginatedCollections.
            </summary>
            <typeparam name="T">The type of the items present in each page.</typeparam>
        </member>
        <member name="T:Pfz.Caching.IPaginatedCollection">
            <summary>
            Interface that must be implemented as part of generic IPaginatedCollection.
            It is here so classes that do not know the specific type of the paginator
            can work with it.
            </summary>
        </member>
        <member name="P:Pfz.Caching.IPaginatedCollection.PageSize">
            <summary>
            Gets the PageSize of this PaginatedCollection.
            </summary>
        </member>
        <member name="P:Pfz.Caching.IPaginatedCollection.UnpaginatedView">
            <summary>
            Gets a list of items that works as if it was unpaginated, but it still
            uses the page files when acessing items.
            </summary>
        </member>
        <member name="P:Pfz.Caching.IPaginatedCollection`1.UnpaginatedView">
            <summary>
            Gets a typed list of items that works as if it was unpaginated, but is
            still uses the page files when acessing items, so reducing the memory 
            usage.
            </summary>
        </member>
        <member name="M:Pfz.Caching.PaginatedCollection`1.#ctor(System.Collections.Generic.IEnumerable{`0},System.Int32)">
            <summary>
            Creates a paginated collection based on any enumerable collection.
            </summary>
            <param name="unpaginatedCollection">The enumerable object to paginate.</param>
            <param name="pageSize">The pageSize of each page.</param>
        </member>
        <member name="M:Pfz.Caching.PaginatedCollection`1.Contains(System.Collections.Generic.IList{`0})">
            <summary>
            Returns true if this PaginatedCollection contains the specific page.
            </summary>
        </member>
        <member name="M:Pfz.Caching.PaginatedCollection`1.IndexOf(System.Collections.Generic.IList{`0})">
            <summary>
            Returns the index of the specific page, or -1 if the page does not exist.
            </summary>
        </member>
        <member name="M:Pfz.Caching.PaginatedCollection`1.CopyTo(System.Collections.Generic.IList{`0}[],System.Int32)">
            <summary>
            Copies the pages in this collection to an array.
            </summary>
            <param name="array">The array to copy the items to.</param>
            <param name="arrayIndex">The startIndex at the destination array.</param>
        </member>
        <member name="M:Pfz.Caching.PaginatedCollection`1.GetEnumerator">
            <summary>
            Returns an enumerator of Pages. Remember that each page is
            composed of many items.
            </summary>
        </member>
        <member name="P:Pfz.Caching.PaginatedCollection`1.PageSize">
            <summary>
            Gets the PageSize for this PaginatedCollection.
            </summary>
        </member>
        <member name="P:Pfz.Caching.PaginatedCollection`1.Count">
            <summary>
            Gets the number of pages present in this PaginatedCollection.
            </summary>
        </member>
        <member name="P:Pfz.Caching.PaginatedCollection`1.Item(System.Int32)">
            <summary>
            Gets an specific page.
            </summary>
            <param name="index">The page index. Begins at zero.</param>
            <returns>The specific page as an IList. After all, each page is composed of many items.</returns>
        </member>
        <member name="P:Pfz.Caching.PaginatedCollection`1.UnpaginatedView">
            <summary>
            Returns an unpaginated view of this PaginatedCollection.
            But, this is only a view, the data is still loaded from page to
            page into memory, so acessing items of index 1 to 15 for a paginated
            collection with pagesize 10 will only load two pages into memory.
            </summary>
        </member>
        <member name="T:Pfz.Caching.PaginatedCollection`1.UnpaginatedViewStruct">
            <summary>
            This is the structure that views the PaginatedCollection as an unpaginated
            collection. It does not implement IList to avoid processing all pages for
            methods like Contains.
            </summary>
        </member>
        <member name="T:Pfz.Caching.IUnpaginatedView`1">
            <summary>
            Sees a PaginatedCollection as if it was unpaginated, but still uses
            the pages to control memory usage.
            </summary>
        </member>
        <member name="T:Pfz.Caching.IUnpaginatedView">
            <summary>
            Sees a PaginatedCollection as if it was unpaginated, but still uses
            the pages to control memory usage.
            </summary>
        </member>
        <member name="P:Pfz.Caching.IUnpaginatedView.Count">
            <summary>
            Gets the total number of items, as if all pages were a single sequence of
            items.
            </summary>
        </member>
        <member name="P:Pfz.Caching.IUnpaginatedView.Item(System.Int32)">
            <summary>
            Gets an item at the specified index, considering all items as a sequence
            independent of the page.
            </summary>
        </member>
        <member name="P:Pfz.Caching.IUnpaginatedView`1.Item(System.Int32)">
            <summary>
            Gets a typed item at the specified index, considering all items as a sequence
            independent of the page.
            </summary>
        </member>
        <member name="P:Pfz.Caching.PaginatedCollection`1.UnpaginatedViewStruct.Item(System.Int32)">
            <summary>
            Returns the item at specified index, considering all items in all
            pages to be a single sequence. But, it internally keeps using pages
            as an way to optimize memory usage.
            </summary>
        </member>
        <member name="P:Pfz.Caching.PaginatedCollection`1.UnpaginatedViewStruct.Count">
            <summary>
            Gets the total number of items, considering all items in all pages.
            </summary>
        </member>
        <member name="T:Pfz.Caching.PfzSessionStateStoreProvider">
            <summary>
            Class that provides session management features using CacheDictionary class.
            </summary>
        </member>
        <member name="M:Pfz.Caching.PfzSessionStateStoreProvider.Initialize(System.String,System.Collections.Specialized.NameValueCollection)">
            <summary>
            Connects to the SessionStateServer.
            </summary>
        </member>
        <member name="M:Pfz.Caching.PfzSessionStateStoreProvider.Dispose">
            <summary>
            Does nothing.
            </summary>
        </member>
        <member name="M:Pfz.Caching.PfzSessionStateStoreProvider.CreateNewStoreData(System.Web.HttpContext,System.Int32)">
            <summary>
            Only initializes an empty dictionary.
            </summary>
        </member>
        <member name="M:Pfz.Caching.PfzSessionStateStoreProvider.CreateUninitializedItem(System.Web.HttpContext,System.String,System.Int32)">
            <summary>
            Does nothing.
            </summary>
        </member>
        <member name="M:Pfz.Caching.PfzSessionStateStoreProvider.EndRequest(System.Web.HttpContext)">
            <summary>
            Does nothing.
            </summary>
        </member>
        <member name="M:Pfz.Caching.PfzSessionStateStoreProvider.GetItem(System.Web.HttpContext,System.String,System.Boolean@,System.TimeSpan@,System.Object@,System.Web.SessionState.SessionStateActions@)">
            <summary>
            Loads a session from disk. The values are then loaded from disk or memory.
            </summary>
        </member>
        <member name="M:Pfz.Caching.PfzSessionStateStoreProvider.GetItemExclusive(System.Web.HttpContext,System.String,System.Boolean@,System.TimeSpan@,System.Object@,System.Web.SessionState.SessionStateActions@)">
            <summary>
            Loads a session from disk and renames (locks) it. The values are then 
            loaded from disk or memory.
            </summary>
        </member>
        <member name="M:Pfz.Caching.PfzSessionStateStoreProvider.InitializeRequest(System.Web.HttpContext)">
            <summary>
            Does nothing.
            </summary>
        </member>
        <member name="M:Pfz.Caching.PfzSessionStateStoreProvider.ReleaseItemExclusive(System.Web.HttpContext,System.String,System.Object)">
            <summary>
            Only executed on exceptions.
            </summary>
        </member>
        <member name="M:Pfz.Caching.PfzSessionStateStoreProvider.RemoveItem(System.Web.HttpContext,System.String,System.Object,System.Web.SessionState.SessionStateStoreData)">
            <summary>
            Delete the file from disk.
            </summary>
        </member>
        <member name="M:Pfz.Caching.PfzSessionStateStoreProvider.ResetItemTimeout(System.Web.HttpContext,System.String)">
            <summary>
            Does a keep alive to the session.
            </summary>
            <param name="context"></param>
            <param name="id"></param>
        </member>
        <member name="M:Pfz.Caching.PfzSessionStateStoreProvider.SetAndReleaseItemExclusive(System.Web.HttpContext,System.String,System.Web.SessionState.SessionStateStoreData,System.Object,System.Boolean)">
            <summary>
            Saves the session to the disk.
            </summary>
        </member>
        <member name="M:Pfz.Caching.PfzSessionStateStoreProvider.SetItemExpireCallback(System.Web.SessionState.SessionStateItemExpireCallback)">
            <summary>
            Does nothing. The callback is not registered.
            </summary>
        </member>
        <member name="T:Pfz.Caching.StatedPage">
            <summary>
            This page has a State property, that is very similar to ViewState in functionality, but it is better
            because only a little piece of information is sent to the client, even if the objects put in that
            dictionary are huge. And, that dictionary is a CacheDictionary, with saves the information in files.
            To use this StatedPage, simple change the inhetance from System.Web.UI.Page to StatedPage.
            </summary>
        </member>
        <member name="M:Pfz.Caching.StatedPage.OnPreLoad(System.EventArgs)">
            <summary>
            Verifies if it is comming from a redirect next or redirect back.
            </summary>
        </member>
        <member name="M:Pfz.Caching.StatedPage.OnLoad(System.EventArgs)">
            <summary>
            Invokes the RedirectCallback method if this page was called from
            a redirect back.
            </summary>
        </member>
        <member name="M:Pfz.Caching.StatedPage.SaveViewState">
            <summary>
            Saves the State reference into the ViewState.
            </summary>
        </member>
        <member name="M:Pfz.Caching.StatedPage.RedirectNext(System.String,System.Object,System.Action{System.Object})">
            <summary>
            Redirects you to another page, considering that such page is a "modal"
            dialog for this page, so it can call a RedirectBack to came here again.
            </summary>
        </member>
        <member name="M:Pfz.Caching.StatedPage.RedirectBack(System.Object)">
            <summary>
            Redirects a page back to the original caller.
            If there is no caller, this method returns. If not, it will
            abort.
            </summary>
            <param name="result">The result you want to give to the caller.</param>
        </member>
        <member name="P:Pfz.Caching.StatedPage.RedirectType">
            <summary>
            Gets a value indicating if this page was invoked as a result to
            a redirect next or a redirect back.
            </summary>
        </member>
        <member name="P:Pfz.Caching.StatedPage.RedirectNextParameter">
            <summary>
            This parameter is set to the parameter used in the RedirectNext
            call that invoked this page. If this page is not being processed
            by such invoke, this parameter will be null.
            </summary>
        </member>
        <member name="P:Pfz.Caching.StatedPage.State">
            <summary>
            Returns a dictionary similar to ViewState, but that uses Caching to work, sending little
            information to the client.
            As happens in ViewState, setting an item to null will remove it.
            But, you can also have the common Dictionary functionality, by acessing
            the State.RealDictionary.
            </summary>
        </member>
        <member name="T:Pfz.Caching.ViewStateNotFoundEventArgs">
            <summary>
            Argument passed to PfzPageStatePersister.ViewStateNotFound event.
            </summary>
        </member>
        <member name="P:Pfz.Caching.ViewStateNotFoundEventArgs.Persister">
            <summary>
            Gets the Persister that threw invoked the event.
            </summary>
        </member>
        <member name="P:Pfz.Caching.ViewStateNotFoundEventArgs.ViewId">
            <summary>
            Gets the requested ViewId that was not found.
            </summary>
        </member>
        <member name="P:Pfz.Caching.ViewStateNotFoundEventArgs.MustGenerateException">
            <summary>
            Gets or sets a value indicating if an exception must be thrown.
            </summary>
        </member>
        <member name="T:Pfz.Caching.RedirectType">
            <summary>
            Enum used to discover if a page is comming from a redirect next or
            redirect back.
            </summary>
        </member>
        <member name="F:Pfz.Caching.RedirectType.None">
            <summary>
            The actual page call is not coming from a redirect next or back.
            </summary>
        </member>
        <member name="F:Pfz.Caching.RedirectType.Next">
            <summary>
            The actual page was called from a RedirectNext call.
            </summary>
        </member>
        <member name="F:Pfz.Caching.RedirectType.Back">
            <summary>
            The actual page was called from a RedirectBack call.
            </summary>
        </member>
        <member name="T:Pfz.Caching.CacheDictionary`1">
            <summary>
            Dictionary used by StatedPage. This dictionary is capable of doing it's cache.
            It creates the Cache objects only during serialization, but it only
            loads them again when the items are read for the first time. So, if you put many large
            information into State, but only read one of them, only this one is brought
            back to memory. This helps when you are paginating into the state. You
            create many pages and save them into State, but you only read one of them
            at a time.
            </summary>
            <typeparam name="T">
            The type of the data this dictionary supports. When this typeparam is a reference
            type, the this[] returns null when an item does not exists, and setting a value
            to null will remove it from the dictionary. But, when value types are used, trying
            to read a key that does not exist throws an exception, like any dictionary.
            The return of null is done to keep compatibility with StateBag, so you
            can simple change all your calls to ViewState[] to State[].
            </typeparam>
        </member>
        <member name="M:Pfz.Caching.CacheDictionary`1.#ctor">
            <summary>
            Creates a new cache dictionary.
            </summary>
        </member>
        <member name="M:Pfz.Caching.CacheDictionary`1.Clear">
            <summary>
            Clears this dictionary.
            </summary>
        </member>
        <member name="M:Pfz.Caching.CacheDictionary`1.Add(System.String,`0)">
            <summary>
            Adds an item to this dictionary, or throws an exception if an item
            with the same key already exists.
            </summary>
            <param name="key">The key of the item.</param>
            <param name="value">The value to add.</param>
        </member>
        <member name="M:Pfz.Caching.CacheDictionary`1.ContainsKey(System.String)">
            <summary>
            Returns true if this dictionary contains an item with the specified key,
            false otherwise.
            </summary>
        </member>
        <member name="M:Pfz.Caching.CacheDictionary`1.Remove(System.String)">
            <summary>
            Removes an item with the specified key.
            </summary>
            <returns>
            Returns true if an item was removed, false if there was no item
            with the specified key.
            </returns>
        </member>
        <member name="M:Pfz.Caching.CacheDictionary`1.TryGetValue(System.String,`0@)">
            <summary>
            Tries to get a value with the specified key.
            </summary>
            <param name="key">The key to find an item for.</param>
            <param name="value">The output variable to store the value.</param>
            <returns>True if a value with that key was found, false otherwise.</returns>
        </member>
        <member name="M:Pfz.Caching.CacheDictionary`1.GetEnumerator">
            <summary>
            Returns an enumerator with all the Key/Value pairs that compose this
            dictionary.
            </summary>
        </member>
        <member name="M:Pfz.Caching.CacheDictionary`1.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)">
            <summary>
            Serialization constructor. Creates the dictionary with the appropriate
            serialization information.
            </summary>
        </member>
        <member name="P:Pfz.Caching.CacheDictionary`1.Item(System.String)">
            <summary>
            Gets or sets an item in the dictionary. If you try to read an inexisting item, null is returned.
            And, if you set an item to null, you simple remove it from the dictionary.
            </summary>
            <param name="key"></param>
            <returns></returns>
        </member>
        <member name="P:Pfz.Caching.CacheDictionary`1.Count">
            <summary>
            Gets the number of items in this dictionary.
            </summary>
        </member>
        <member name="P:Pfz.Caching.CacheDictionary`1.Keys">
            <summary>
            Gets all the keys present in this dictionary.
            </summary>
        </member>
        <member name="P:Pfz.Caching.CacheDictionary`1.Values">
            <summary>
            Gets all the values present in this dictionary.
            Caution when using this method, as it forces all cached values
            to be brought to memory.
            </summary>
        </member>
        <member name="T:Pfz.Caching.CacheException">
            <summary>
            Exception thrown by the Pfz.Caching framework when something wrong happens.
            </summary>
        </member>
        <member name="M:Pfz.Caching.CacheException.#ctor">
            <summary>
            Default exception constructor. Only following the Exception pattern.
            </summary>
        </member>
        <member name="M:Pfz.Caching.CacheException.#ctor(System.String)">
            <summary>
            Constructor by message. Only following the Exception pattern.
            </summary>
        </member>
        <member name="M:Pfz.Caching.CacheException.#ctor(System.String,System.Exception)">
            <summary>
            Constructor by message and innerException. Only following the Exception pattern.
            </summary>
        </member>
        <member name="M:Pfz.Caching.CacheException.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)">
            <summary>
            Serialization constructor. Only following the Exception pattern.
            </summary>
        </member>
        <member name="T:Pfz.Caching.StatedMasterPage">
            <summary>
            A MasterPage that has a cached State property.
            </summary>
        </member>
        <member name="P:Pfz.Caching.StatedMasterPage.Page">
            <summary>
            Returns the Page as a StatedPage. You must always inherit your pages that uses StatedMasterPage
            from StatedPage.
            </summary>
        </member>
        <member name="P:Pfz.Caching.StatedMasterPage.Master">
            <summary>
            Gets the Master as another StatedMasterPage. You must only use StatedMasterPages as the 
            master pages of another StatedMasterPage.
            </summary>
        </member>
        <member name="P:Pfz.Caching.StatedMasterPage.State">
            <summary>
            Returns the cached State dictionary of this Page.
            </summary>
        </member>
        <member name="T:Pfz.Caching.PfzPageStatePersister">
            <summary>
            Uses the Caching structure as the ViewState persister.
            </summary>
        </member>
        <member name="M:Pfz.Caching.PfzPageStatePersister.#ctor(System.Web.UI.Page)">
            <summary>
            Creates the Persister for the given page.
            </summary>
            <param name="page"></param>
        </member>
        <member name="M:Pfz.Caching.PfzPageStatePersister.Load">
            <summary>
            Loads the information for the given page.
            </summary>
        </member>
        <member name="M:Pfz.Caching.PfzPageStatePersister.Save">
            <summary>
            Saves information from the given page.
            </summary>
        </member>
        <member name="M:Pfz.Caching.PfzPageStatePersister.OnViewStateNotFound(System.String)">
            <summary>
            This method is invoked when a requested ViewState is not found.
            It invokes the ViewStateNotFoundEvent and, if it must generate an
            exception, throws a ViewStateNotFoundException with the id of the
            view state that could not be loaded.
            </summary>
        </member>
        <member name="P:Pfz.Caching.PfzPageStatePersister.MustThrowExceptionWhenViewStateNotFound">
            <summary>
            Gets or sets a value indicating if an exception must be thrown if
            a requested ViewState is not found. 
            If true (the default) a ViewStateNotFoundException is thrown. If false,
            no exception is thrown but the ViewState and ControlState are not loaded, 
            as if this was the first load of the page (but the IsPostBack will keep 
            it's value of true, so you must treat yourself such situation).
            See the ViewStateNotFound event if you have a better solution than 
            throwing exceptions.
            </summary>
        </member>
        <member name="P:Pfz.Caching.PfzPageStatePersister.MustDeleteViewStatesWhenSessionEnds">
            <summary>
            Gets or sets a value indicating that the ViewState files must be deleted
            together with the Session files when the session ends. Be careful that
            setting this value to true when you throw exceptions if ViewStates are
            not found will end-up throwing exceptions everytime a user "log-offs"
            and then tries to go back some pages, even before you get a chance
            to redirect the user to the login page.
            See the ViewStateNotFound event if you have a better solution than 
            throwing exceptions.
            </summary>
        </member>
        <member name="E:Pfz.Caching.PfzPageStatePersister.ViewStateNotFound">
            <summary>
            This event is called everytime a ViewState could not be loaded.
            </summary>
        </member>
        <member name="T:Pfz.Caching.IPfzSessionStateStoreProvider">
            <summary>
            Interface used by the PfzSessionStateStoreProvider to communicate to the
            PfzSessionServer.
            </summary>
        </member>
        <member name="M:Pfz.Caching.IPfzSessionStateStoreProvider.CountActiveSessions">
            <summary>
            Gets the number of sessions currently active.
            </summary>
            <returns>The number of active sessions.</returns>
        </member>
        <member name="M:Pfz.Caching.IPfzSessionStateStoreProvider.GetItem(System.String,System.Int64@,System.TimeSpan@,System.TimeSpan@)">
            <summary>
            Gets an item in readonly mode.
            </summary>
        </member>
        <member name="M:Pfz.Caching.IPfzSessionStateStoreProvider.GetItemExclusive(System.String,System.Int64@,System.Boolean@,System.TimeSpan@,System.TimeSpan@)">
            <summary>
            Gets an item to modifiy.
            </summary>
        </member>
        <member name="M:Pfz.Caching.IPfzSessionStateStoreProvider.KeepAlive(System.String)">
            <summary>
            Updates the LastAccessed field.
            </summary>
        </member>
        <member name="M:Pfz.Caching.IPfzSessionStateStoreProvider.ReleaseItem(System.String,System.Int64)">
            <summary>
            Releases a locked item without modifying it's contents.
            </summary>
        </member>
        <member name="M:Pfz.Caching.IPfzSessionStateStoreProvider.SetAndReleaseItem(System.String,System.Int64,System.Byte[])">
            <summary>
            Releases a locked item changing it's contents.
            </summary>
        </member>
        <member name="M:Pfz.Caching.IPfzSessionStateStoreProvider.RemoveItem(System.String,System.Int64)">
            <summary>
            Removes a session from memory.
            </summary>
        </member>
        <member name="T:Pfz.Caching.ViewStateNotFoundException">
            <summary>
            Exception thrown by the PfzPageStatePersister when trying to load a 
            non-existing (or deleted) ViewState if 
            PfzPageStatePersister.MustThrowExceptionWhenViewStateNotFound is set
            to true.
            </summary>
        </member>
        <member name="M:Pfz.Caching.ViewStateNotFoundException.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)">
            <summary>
            Adds SessionId and ViewId to the info.
            </summary>
        </member>
        <member name="P:Pfz.Caching.ViewStateNotFoundException.SessionId">
            <summary>
            Gets the SessionId that generated this exception.
            </summary>
        </member>
        <member name="P:Pfz.Caching.ViewStateNotFoundException.ViewId">
            <summary>
            Gets the ViewId that was not found and originated this exception.
            </summary>
        </member>
        <member name="T:Pfz.Caching.ICachePersister">
            <summary>
            Interface that must be implemented by "persisters" of CacheManager caching.
            The DefaultCachePersister saves the files to the HD. You can build your own
            persister to save the files to the database.
            </summary>
        </member>
        <member name="M:Pfz.Caching.ICachePersister.GetBuffer(System.Int64,System.Int64)">
            <summary>
            Gets a buffer given it's hashCode and id. The ID will never be the same
            for two buffers, even if they have different hashCodes. It is used only
            as an additional parameter for searching purposes.
            </summary>
            <param name="hashCode"></param>
            <param name="id"></param>
            <returns>The read buffer or null if there is no such buffer.</returns>
        </member>
        <member name="M:Pfz.Caching.ICachePersister.SaveBuffer(System.Byte[],System.Int64)">
            <summary>
            Saves a given buffer, and returns the generated id and hashCode.
            If another identical buffer already exists, the persister should recognize 
            it.
            </summary>
            <param name="buffer">The buffer to save.</param>
            <param name="hashCode">The generated hashCode. Two different buffers CAN have the same hashCode.</param>
        </member>
        <member name="M:Pfz.Caching.ICachePersister.KeepBufferAlive(System.Int64,System.Int64)">
            <summary>
            Used by the CacheManager when a buffer that is still in memory must be kept
            alive. This function is not called when a call to GetBuffer is done.
            </summary>
            <param name="hashCode"></param>
            <param name="id"></param>
            <returns>Must return false if the buffer does not exist.</returns>
        </member>
        <member name="M:Pfz.Caching.ICachePersister.RecreateBuffer(System.Int64,System.Int64,System.Byte[])">
            <summary>
            Used by the CacheManager when a buffer that was still in memory but already
            deleted is used again, so it is recreated.
            </summary>
            <param name="hashCode"></param>
            <param name="id"></param>
            <param name="buffer"></param>
        </member>
        <member name="M:Pfz.Caching.ICachePersister.GetViewState(System.String,System.Int64)">
            <summary>
            Gets a view-state given it's sessionId and viewId.
            </summary>
            <returns>The viewstate or null if it was not found.</returns>
        </member>
        <member name="M:Pfz.Caching.ICachePersister.SaveViewState(System.String,System.Byte[])">
            <summary>
            Saves a viewstate information and gets the new generated id.
            </summary>
        </member>
        <member name="M:Pfz.Caching.ICachePersister.KeepViewStateAlive(System.String,System.Int64)">
            <summary>
            Tries to keep a view state alive.
            </summary>
            <returns>Must return false if the viewstate was not found.</returns>
        </member>
        <member name="M:Pfz.Caching.ICachePersister.RecreateViewState(System.String,System.Int64,System.Byte[])">
            <summary>
            Recreates a view-state with the given information. Only invoked when
            KeepViewStateAlive returns false.
            </summary>
        </member>
        <member name="M:Pfz.Caching.ICachePersister.InterlockedGetOrCreateAndAdd(System.String,System.Int64,System.Int32)">
            <summary>
            Gets an interlocked variable value or, if one does not exists, create
            it with the given value, also doing an atomic add immediatelly.
            </summary>
        </member>
        <member name="M:Pfz.Caching.ICachePersister.InterlockedAdd(System.String,System.Int32)">
            <summary>
            Adds the given amount to an interlocked variable.
            Returns null if the variable does not exist.
            </summary>
        </member>
        <member name="T:Pfz.Caching.RemoteCachePersister">
            <summary>
            Static class that helps you to create a CachePersister that resides in a remote
            PfzSessionServer.
            </summary>
        </member>
        <member name="M:Pfz.Caching.RemoteCachePersister.Create(System.String,System.Int32)">
            <summary>
            Creates a new CachePersister using the given remote PfzSessionServer.
            </summary>
        </member>
        <member name="T:Pfz.Caching.FileCachePersister">
            <summary>
            The default persister used by CacheManager.
            </summary>
        </member>
        <member name="M:Pfz.Caching.FileCachePersister.#ctor(System.String)">
            <summary>
            Creates the FileCachePersister using the given directory as it's working directory.
            CAUTION - All files and subdirectories in this directory will eventually be deleted.
            </summary>
            <param name="path"></param>
        </member>
        <member name="M:Pfz.Caching.FileCachePersister.#ctor(System.String,System.TimeSpan,System.TimeSpan,System.Security.Principal.WindowsIdentity)">
            <summary>
            Creates the FileCachePersister with all parameters.
            </summary>
            <param name="path"></param>
            <param name="cleaningInterval"></param>
            <param name="cleanFilesOlderThan"></param>
            <param name="cleaningThreadImpersonation"></param>
        </member>
        <member name="M:Pfz.Caching.FileCachePersister.GetBuffer(System.Int64,System.Int64)">
            <summary>
            Reads the buffer using the hashCode as a directory and the id as the filename.
            </summary>
            <returns>The read buffer or null.</returns>
        </member>
        <member name="M:Pfz.Caching.FileCachePersister.SaveBuffer(System.Byte[],System.Int64)">
            <summary>
            Saves the buffer using the hashCode as a sub-directory and the id as the file name.
            </summary>
        </member>
        <member name="M:Pfz.Caching.FileCachePersister.KeepBufferAlive(System.Int64,System.Int64)">
            <summary>
            Resets the file LastWriteTime.
            </summary>
        </member>
        <member name="M:Pfz.Caching.FileCachePersister.RecreateBuffer(System.Int64,System.Int64,System.Byte[])">
            <summary>
            Recreates a buffer that is still in memory, but was deleted.
            </summary>
        </member>
        <member name="M:Pfz.Caching.FileCachePersister.GetViewState(System.String,System.Int64)">
            <summary>
            Gets a view state.
            </summary>
            <param name="sessionId"></param>
            <param name="viewId"></param>
            <returns></returns>
        </member>
        <member name="M:Pfz.Caching.FileCachePersister.SaveViewState(System.String,System.Byte[])">
            <summary>
            Saves a view state.
            </summary>
            <param name="sessionId"></param>
            <param name="bytes"></param>
            <returns></returns>
        </member>
        <member name="M:Pfz.Caching.FileCachePersister.KeepViewStateAlive(System.String,System.Int64)">
            <summary>
            Resets the file LastWriteTime.
            </summary>
            <param name="sessionId"></param>
            <param name="key"></param>
            <returns></returns>
        </member>
        <member name="M:Pfz.Caching.FileCachePersister.RecreateViewState(System.String,System.Int64,System.Byte[])">
            <summary>
            Recreates a given viewstate that is in memory, but deleted.
            </summary>
            <param name="sessionId"></param>
            <param name="key"></param>
            <param name="bytes"></param>
        </member>
        <member name="M:Pfz.Caching.FileCachePersister.InterlockedGetOrCreateAndAdd(System.String,System.Int64,System.Int32)">
            <summary>
            Gets an interlocked variable value or, if one does not exists, create
            it with the given value, also doing an atomic add immediatelly.
            </summary>
        </member>
        <member name="M:Pfz.Caching.FileCachePersister.InterlockedAdd(System.String,System.Int32)">
            <summary>
            Adds the given amount to an interlocked variable.
            Returns null if the variable does not exist.
            </summary>
        </member>
        <member name="P:Pfz.Caching.FileCachePersister.CleaningInterval">
            <summary>
            Gets the time in which cleaning thread executes to delete old files. This is
            the interval between executions, not how old files can be.
            The default interval is 30 minutes.
            If CleaningInterval is set to Zero, the automatic cleaning will
            never be executed. Set it to Zero only if you do your own cleaning.
            </summary>
        </member>
        <member name="P:Pfz.Caching.FileCachePersister.CleanFilesOlderThan">
            <summary>
            Gets or sets how old files can be and kept alive. Older will be deleted at the
            next execution of Cleaner Thread.
            The default value is 4 hours.
            </summary>
        </member>
        <member name="P:Pfz.Caching.FileCachePersister.CleaningThreadImpersonation">
            <summary>
            Gets or sets the impersonation used by the cleaning thread.
            If this value is null, the impersonation of the thread that 
            calls Start() will be used.
            </summary>
        </member>
        <member name="P:Pfz.Caching.FileCachePersister.BasePath">
            <summary>
            Gets the path used to create this FileCachePersister.
            </summary>
        </member>
        <member name="P:Pfz.Caching.FileCachePersister.BuffersPath">
            <summary>
            Gets the path used by this FileCachePersister to store it's cache buffers.
            </summary>
        </member>
        <member name="P:Pfz.Caching.FileCachePersister.ViewStatesPath">
            <summary>
            Gets the path used by this FileCachePersister to store it's viewstates.
            </summary>
        </member>
        <member name="T:Pfz.Caching.CacheManager">
            <summary>
            This is the class needed to start the caching process.
            You must first call CacheManager.Start() to be able to use caching.
            Also, this class has alternative Create() methods to help create cache 
            objects for types with very long names or when you only discover the 
            data type at run-time.
            </summary>
        </member>
        <member name="M:Pfz.Caching.CacheManager.Start">
            <summary>
            Sets the caching parameters and starts the cleaning thread.
            You must call this method before using any Cache object, and you
            can only call this method once. It is preferrable that you call
            it from Application_Start in web applications.
            </summary>
        </member>
        <member name="M:Pfz.Caching.CacheManager.Create``1(``0)">
            <summary>
            This methods only helps creating a typed cache object. You call Cache.Create() passing an
            object with a very ugly type name, and the result is a Cache&lt;veryUglyClassName&gt;
            </summary>
            <typeparam name="T">Will discover the object type implicity.</typeparam>
            <param name="value">The item to be cached.</param>
            <returns>A typed cache object.</returns>
        </member>
        <member name="M:Pfz.Caching.CacheManager.Create``1(``0,System.Boolean)">
            <summary>
            This methods only helps creating a typed cache object. You call Cache.Create() passing an
            object with a very ugly type name, and the result is a Cache&lt;veryUglyClassName&gt;
            </summary>
            <typeparam name="T">Will discover the object type implicity.</typeparam>
            <param name="value">The item to be cached.</param>
            <param name="allowImmediateExpiration">
            A boolean value indicating if the object can be collected as soon as possible or not.
            If not, a KeepAlive is done.
            </param>
            <returns>A typed cache object.</returns>
        </member>
        <member name="M:Pfz.Caching.CacheManager.UntypedCreate(System.Object)">
            <summary>
            Creates a Cache of the right run-time type, and returns it as an
            ICache so you can use it as it was "untyped".
            </summary>
            <param name="value">The item to create a cache for.</param>
            <returns>
            A rightly-typed cache object, but as an ICache to be ready for use.
            </returns>
        </member>
        <member name="M:Pfz.Caching.CacheManager.UntypedCreate(System.Object,System.Boolean)">
            <summary>
            Creates a Cache of the right run-time type, and returns it as an
            ICache so you can use it as it was "untyped".
            </summary>
            <param name="value">The item to create a cache for.</param>
            <param name="allowImmediateExpiration">
            A boolean value indicating if the object can be collected as soon as possible or not.
            If not, a KeepAlive is done.
            </param>
            <returns>
            A rightly-typed cache object, but as an ICache to be ready for use.
            </returns>
        </member>
        <member name="P:Pfz.Caching.CacheManager.Persister">
            <summary>
            Gets or sets the persister used by this cache manager.
            The default persister is FileCachePersister.
            </summary>
        </member>
        <member name="P:Pfz.Caching.CacheManager.MaxLengthCacheDictionaryCanIncorporate">
            <summary>
            Gets or sets the maximum length (in bytes) of serialized data that is stored directly
            in the CacheDictionary serialization info. Serialized objects that are bigger than
            such length are saved in separate files, including only a reference to it in the 
            CacheDictionary serialization.
            </summary>
        </member>
    </members>
</doc>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Microsoft
United States United States
I started to program computers when I was 11 years old, as a hobbyist, programming in AMOS Basic and Blitz Basic for Amiga.
At 12 I had my first try with assembler, but it was too difficult at the time. Then, in the same year, I learned C and, after learning C, I was finally able to learn assembler (for Motorola 680x0).
Not sure, but probably between 12 and 13, I started to learn C++. I always programmed "in an object oriented way", but using function pointers instead of virtual methods.

At 15 I started to learn Pascal at school and to use Delphi. At 16 I started my first internship (using Delphi). At 18 I started to work professionally using C++ and since then I've developed my programming skills as a professional developer in C++ and C#, generally creating libraries that help other developers do their work easier, faster and with less errors.

Want more info or simply want to contact me?
Take a look at: http://paulozemek.azurewebsites.net/
Or e-mail me at: paulozemek@outlook.com

Codeproject MVP 2012, 2015 & 2016
Microsoft MVP 2013-2014 (in October 2014 I started working at Microsoft, so I can't be a Microsoft MVP anymore).

Comments and Discussions