PersonalizationState.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / xsp / System / Web / UI / WebParts / PersonalizationState.cs / 1 / PersonalizationState.cs

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

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

    ///  
    /// 
    [AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] 
    [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)] 
    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.
//------------------------------------------------------------------------------ 
// 
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// 
//----------------------------------------------------------------------------- 

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

    ///  
    /// 
    [AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] 
    [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)] 
    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