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

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

namespace System.Web.UI { 
 
    using System;
 
    /*
     * 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.
    ///  
    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