StateItem.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 / StateItem.cs / 1 / StateItem.cs

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

namespace System.Web.UI { 
 
    using System;
    using System.Security.Permissions; 

    /*
     * The StateItem class * by the StateBag class.
     * The StateItem has an object value, a dirty flag. 
     */
 
    ///  
    /// Represents an item that is saved in the  class when view state
    ///    information is persisted between Web requests. 
    /// 
    [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)]
    public sealed class StateItem {
        private object      value; 
        private bool        isDirty;
 
        /* 
         * Constructs a StateItem with an initial value.
         */ 
        internal StateItem(object initialValue) {
            value = initialValue;
            isDirty = false;
        } 

        /* 
         * Property to indicate StateItem has been modified. 
         */
 
        /// 
        /// Indicates whether the  object has been modified.
        /// 
        public bool IsDirty { 
            get {
                return isDirty; 
            } 
            set {
                isDirty = value; 
            }
        }

        /* 
         * Property to access the StateItem value.
         */ 
 
        /// 
        /// Indicates the value of the item that is stored in the  
        /// object.
        /// 
        public object Value {
            get { 
                return value;
            } 
            set { 
                this.value = value;
            } 
        }
    }
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------ 
// 
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// 
//----------------------------------------------------------------------------- 

namespace System.Web.UI { 
 
    using System;
    using System.Security.Permissions; 

    /*
     * The StateItem class * by the StateBag class.
     * The StateItem has an object value, a dirty flag. 
     */
 
    ///  
    /// Represents an item that is saved in the  class when view state
    ///    information is persisted between Web requests. 
    /// 
    [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)]
    public sealed class StateItem {
        private object      value; 
        private bool        isDirty;
 
        /* 
         * Constructs a StateItem with an initial value.
         */ 
        internal StateItem(object initialValue) {
            value = initialValue;
            isDirty = false;
        } 

        /* 
         * Property to indicate StateItem has been modified. 
         */
 
        /// 
        /// Indicates whether the  object has been modified.
        /// 
        public bool IsDirty { 
            get {
                return isDirty; 
            } 
            set {
                isDirty = value; 
            }
        }

        /* 
         * Property to access the StateItem value.
         */ 
 
        /// 
        /// Indicates the value of the item that is stored in the  
        /// object.
        /// 
        public object Value {
            get { 
                return value;
            } 
            set { 
                this.value = value;
            } 
        }
    }
}

// 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