ControlPersister.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WebForms / System / Web / UI / Design / ControlPersister.cs / 1 / ControlPersister.cs

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

namespace System.Web.UI.Design { 
 
    using System;
    using System.Web; 
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using System.Collections; 
    using System.ComponentModel;
    using System.ComponentModel.Design; 
    using System.Diagnostics; 
    using System.IO;
    using System.Reflection; 
    using System.Text;
    using AttributeCollection = System.Web.UI.AttributeCollection;

    ///  
    /// 
    ///     
    ///       Provides helper functions used in persisting Controls. 
    ///    
    ///  
    [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand, Flags=System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode)]
    public sealed class ControlPersister {

        ///  
        /// 
        ///    We don't want instances of this class to be created, so mark 
        ///    the constructor as private. 
        /// 
        private ControlPersister() { 
        }

        /// 
        ///  
        ///    
        ///       Gets a string that can persist the inner properties of a control. 
        ///     
        /// 
        public static string PersistInnerProperties(object component, IDesignerHost host) { 
            return ControlSerializer.SerializeInnerProperties(component, host);
        }

        ///  
        /// 
        ///     
        ///       Persists the inner properties of the control. 
        ///    
        ///  
        public static void PersistInnerProperties(TextWriter sw, object component, IDesignerHost host) {
            ControlSerializer.SerializeInnerProperties(component, host, sw);
        }
 
        /// 
        ///  
        ///     
        ///       Gets a string that can
        ///       persist a control. 
        ///    
        /// 
        public static string PersistControl(Control control) {
            return ControlSerializer.SerializeControl(control); 
        }
 
        ///  
        /// 
        ///     
        ///       Returns a string that can
        ///       persist a control.
        ///    
        ///  
        public static string PersistControl(Control control, IDesignerHost host) {
            return ControlSerializer.SerializeControl(control, host); 
        } 

        ///  
        /// 
        ///    
        ///       Persists a control using the
        ///       specified string writer. 
        ///    
        ///  
        public static void PersistControl(TextWriter sw, Control control) { 
            ControlSerializer.SerializeControl(control, sw);
        } 

        /// 
        /// 
        ///     
        ///       Persists a control using the
        ///       specified string writer. 
        ///     
        /// 
        public static void PersistControl(TextWriter sw, Control control, IDesignerHost host) { 
            ControlSerializer.SerializeControl(control, host, sw);
        }

        public static string PersistTemplate(ITemplate template, IDesignerHost host) { 
            return ControlSerializer.SerializeTemplate(template, host);
        } 
 
        public static void PersistTemplate(TextWriter writer, ITemplate template, IDesignerHost host) {
            ControlSerializer.SerializeTemplate(template, writer, host); 
        }
    }
}
 

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

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