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

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

namespace System.Web.UI.Design { 
 
    using System;
    using System.Diagnostics; 
    using System.ComponentModel;
    using System.ComponentModel.Design;

    ///  
    [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand, Flags=System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode)]
    [Obsolete("Use of this type is not recommended because template editing is handled in ControlDesigner. To support template editing expose template data in the TemplateGroups property and call SetViewFlags(ViewFlags.TemplateEditing, true). http://go.microsoft.com/fwlink/?linkid=14202")] 
    public class TemplateEditingVerb : DesignerVerb, IDisposable { 

        private static readonly EventHandler dummyEventHandler = new EventHandler(OnDummyEventHandler); 

        private ITemplateEditingFrame editingFrame;
        private int index;
 
        /// 
        public TemplateEditingVerb(string text, int index, TemplatedControlDesigner designer) : this(text, index, designer.TemplateEditingVerbHandler) { 
        } 

        public TemplateEditingVerb(string text, int index) : this(text, index, dummyEventHandler) { 
        }

        private TemplateEditingVerb(string text, int index, EventHandler handler) : base(text, handler) {
            this.index = index; 
        }
 
        internal ITemplateEditingFrame EditingFrame { 
            get {
                return editingFrame; 
            }
            set {
                editingFrame = value;
            } 
        }
 
        ///  
        public int Index {
            get { 
                return index;
            }
        }
 
        /// 
        public void Dispose() { 
            Dispose(true); 
            GC.SuppressFinalize(this);
        } 

        /// 
        ~TemplateEditingVerb() {
            Dispose(false); 
        }
 
        ///  
        protected virtual void Dispose(bool disposing) {
            if (disposing) { 
                if (editingFrame != null) {
                    editingFrame.Dispose();
                    editingFrame = null;
                } 
            }
        } 
 
        private static void OnDummyEventHandler(object sender, EventArgs e) {
        } 
    }
}

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