PersonalizationState.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / WebParts / PersonalizationState.cs / 1305376 / PersonalizationState.cs

                            //------------------------------------------------------------------------------ 
// 
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// 
//----------------------------------------------------------------------------- 

namespace System.Web.UI.WebControls.WebParts { 
 
    using System;
    using System.Web; 
    using System.Web.Util;

    /// 
    ///  
    public abstract class PersonalizationState {
 
        private WebPartManager _webPartManager; 
        private bool _dirty;
 
        /// 
        /// 
        protected PersonalizationState(WebPartManager webPartManager) {
            if (webPartManager == null) { 
                throw new ArgumentNullException("webPartManager");
            } 
 
            _webPartManager = webPartManager;
        } 

        /// 
        /// 
        public bool IsDirty { 
            get {
                return _dirty; 
            } 
        }
 
        /// 
        /// 
        public abstract bool IsEmpty {
            get; 
        }
 
        ///  
        /// 
        public WebPartManager WebPartManager { 
            get {
                return _webPartManager;
            }
        } 

        ///  
        ///  
        public abstract void ApplyWebPartPersonalization(WebPart webPart);
 
        /// 
        /// 
        public abstract void ApplyWebPartManagerPersonalization();
 
        /// 
        ///  
        public abstract void ExtractWebPartPersonalization(WebPart webPart); 

        ///  
        /// 
        public abstract void ExtractWebPartManagerPersonalization();

        // Returns the AuthorizationFilter string for a WebPart before it is instantiated 
        // Returns null if there is no personalized value for AuthorizationFilter
        public abstract string GetAuthorizationFilter(string webPartID); 
 
        /// 
        ///  
        protected void SetDirty() {
            _dirty = true;
        }
 
        /// 
        ///  
        public abstract void SetWebPartDirty(WebPart webPart); 

        ///  
        /// 
        public abstract void SetWebPartManagerDirty();

        ///  
        /// 
        protected void ValidateWebPart(WebPart webPart) { 
            if (webPart == null) { 
                throw new ArgumentNullException("webPart");
            } 

            if (_webPartManager.WebParts.Contains(webPart) == false) {
                throw new ArgumentException(SR.GetString(SR.UnknownWebPart), "webPart");
            } 
        }
    } 
} 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK