PageWrapper.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 / Orcas / QFE / ndp / fx / src / xsp / System / Web / Extensions / ui / PageWrapper.cs / 2 / PageWrapper.cs

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

namespace System.Web.UI { 
    using System; 
    using System.Collections;
    using System.Diagnostics; 
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web;
 
    internal sealed class PageWrapper : IPage {
        private readonly Page _page; 
 
        public PageWrapper(Page page) {
            Debug.Assert(page != null); 
            _page = page;
        }

        #region IPage Members 
        string IPage.AppRelativeVirtualPath {
            get { 
                return _page.AppRelativeVirtualPath; 
            }
        } 

        IClientScriptManager IPage.ClientScript {
            get {
                return new ClientScriptManagerWrapper(_page.ClientScript); 
            }
        } 
 
        bool IPage.EnableEventValidation {
            get { 
                return _page.EnableEventValidation;
            }
        }
 
        IHtmlForm IPage.Form {
            get { 
                if (_page.Form != null) { 
                    return new HtmlFormWrapper(_page.Form);
                } 
                return null;
            }
        }
 
        HtmlHead IPage.Header {
            get { 
                return _page.Header; 
            }
        } 

        bool IPage.IsPostBack {
            get {
                return _page.IsPostBack; 
            }
        } 
 
        bool IPage.IsValid {
            get { 
                return _page.IsValid;
            }
        }
 
        IDictionary IPage.Items {
            get { 
                return _page.Items; 
            }
        } 

        HttpRequestBase IPage.Request {
            get {
                return new HttpRequestWrapper(_page.Request); 
            }
        } 
 
        HttpResponseInternalBase IPage.Response {
            get { 
                return new HttpResponseInternalWrapper(_page.Response);
            }
        }
 
        HttpServerUtilityBase IPage.Server {
            get { 
                return new HttpServerUtilityWrapper(_page.Server); 
            }
        } 

        string IPage.Title {
            get {
                return _page.Title; 
            }
        } 
 
        event EventHandler IPage.Error {
            add { 
                _page.Error += value;
            }
            remove {
                _page.Error -= value; 
            }
        } 
 
        event EventHandler IPage.InitComplete {
            add { 
                _page.InitComplete += value;
            }
            remove {
                _page.InitComplete -= value; 
            }
        } 
 
        event EventHandler IPage.LoadComplete {
            add { 
                _page.LoadComplete += value;
            }
            remove {
                _page.LoadComplete -= value; 
            }
        } 
 
        void IPage.RegisterRequiresViewStateEncryption() {
            _page.RegisterRequiresViewStateEncryption(); 
        }

        void IPage.SetFocus(Control control) {
            _page.SetFocus(control); 
        }
 
        void IPage.SetFocus(string clientID) { 
            _page.SetFocus(clientID);
        } 

        event EventHandler IPage.PreRender {
            add {
                _page.PreRender += value; 
            }
            remove { 
                _page.PreRender -= value; 
            }
        } 

        event EventHandler IPage.PreRenderComplete {
            add {
                _page.PreRenderComplete += value; 
            }
            remove { 
                _page.PreRenderComplete -= value; 
            }
        } 

        void IPage.SetRenderMethodDelegate(RenderMethod renderMethod) {
            _page.SetRenderMethodDelegate(renderMethod);
        } 

        void IPage.Validate(string validationGroup) { 
            _page.Validate(validationGroup); 
        }
 
        void IPage.VerifyRenderingInServerForm(Control control) {
            _page.VerifyRenderingInServerForm(control);
        }
        #endregion 
    }
} 

// 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.Collections;
    using System.Diagnostics; 
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web;
 
    internal sealed class PageWrapper : IPage {
        private readonly Page _page; 
 
        public PageWrapper(Page page) {
            Debug.Assert(page != null); 
            _page = page;
        }

        #region IPage Members 
        string IPage.AppRelativeVirtualPath {
            get { 
                return _page.AppRelativeVirtualPath; 
            }
        } 

        IClientScriptManager IPage.ClientScript {
            get {
                return new ClientScriptManagerWrapper(_page.ClientScript); 
            }
        } 
 
        bool IPage.EnableEventValidation {
            get { 
                return _page.EnableEventValidation;
            }
        }
 
        IHtmlForm IPage.Form {
            get { 
                if (_page.Form != null) { 
                    return new HtmlFormWrapper(_page.Form);
                } 
                return null;
            }
        }
 
        HtmlHead IPage.Header {
            get { 
                return _page.Header; 
            }
        } 

        bool IPage.IsPostBack {
            get {
                return _page.IsPostBack; 
            }
        } 
 
        bool IPage.IsValid {
            get { 
                return _page.IsValid;
            }
        }
 
        IDictionary IPage.Items {
            get { 
                return _page.Items; 
            }
        } 

        HttpRequestBase IPage.Request {
            get {
                return new HttpRequestWrapper(_page.Request); 
            }
        } 
 
        HttpResponseInternalBase IPage.Response {
            get { 
                return new HttpResponseInternalWrapper(_page.Response);
            }
        }
 
        HttpServerUtilityBase IPage.Server {
            get { 
                return new HttpServerUtilityWrapper(_page.Server); 
            }
        } 

        string IPage.Title {
            get {
                return _page.Title; 
            }
        } 
 
        event EventHandler IPage.Error {
            add { 
                _page.Error += value;
            }
            remove {
                _page.Error -= value; 
            }
        } 
 
        event EventHandler IPage.InitComplete {
            add { 
                _page.InitComplete += value;
            }
            remove {
                _page.InitComplete -= value; 
            }
        } 
 
        event EventHandler IPage.LoadComplete {
            add { 
                _page.LoadComplete += value;
            }
            remove {
                _page.LoadComplete -= value; 
            }
        } 
 
        void IPage.RegisterRequiresViewStateEncryption() {
            _page.RegisterRequiresViewStateEncryption(); 
        }

        void IPage.SetFocus(Control control) {
            _page.SetFocus(control); 
        }
 
        void IPage.SetFocus(string clientID) { 
            _page.SetFocus(clientID);
        } 

        event EventHandler IPage.PreRender {
            add {
                _page.PreRender += value; 
            }
            remove { 
                _page.PreRender -= value; 
            }
        } 

        event EventHandler IPage.PreRenderComplete {
            add {
                _page.PreRenderComplete += value; 
            }
            remove { 
                _page.PreRenderComplete -= value; 
            }
        } 

        void IPage.SetRenderMethodDelegate(RenderMethod renderMethod) {
            _page.SetRenderMethodDelegate(renderMethod);
        } 

        void IPage.Validate(string validationGroup) { 
            _page.Validate(validationGroup); 
        }
 
        void IPage.VerifyRenderingInServerForm(Control control) {
            _page.VerifyRenderingInServerForm(control);
        }
        #endregion 
    }
} 

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