TemplateInstanceAttribute.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / TemplateInstanceAttribute.cs / 1305376 / TemplateInstanceAttribute.cs

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

namespace System.Web.UI { 
 
    using System;
    using System.Collections; 
    using System.ComponentModel;

    /// 
    /// Whether a template is instantiated single or multiple times. 
    /// The code generator generates fields corresponding to controls in the template
    /// for single instance templates. 
    ///  
    [AttributeUsage(AttributeTargets.Property)]
    public sealed class TemplateInstanceAttribute : Attribute { 


        public static readonly TemplateInstanceAttribute Multiple = new TemplateInstanceAttribute(TemplateInstance.Multiple);
 

        public static readonly TemplateInstanceAttribute Single = new TemplateInstanceAttribute(TemplateInstance.Single); 
 

        public static readonly TemplateInstanceAttribute Default = Multiple; 

        private TemplateInstance _instances;

 
        /// 
        ///  
        public TemplateInstanceAttribute(TemplateInstance instances) { 
            _instances = instances;
        } 


        /// 
        /// [To be supplied.] 
        /// 
        public TemplateInstance Instances { 
            get { 
                return _instances;
            } 
        }


        ///  
        public override bool Equals(object obj) {
            if (obj == this) { 
                return true; 
            }
 
            TemplateInstanceAttribute other = obj as TemplateInstanceAttribute;
            if (other != null) {
                return (other.Instances == Instances);
            } 
            return false;
        } 
 

        ///  
        public override int GetHashCode() {
            return _instances.GetHashCode();
        }
 

        ///  
        public override bool IsDefaultAttribute() { 
            return this.Equals(Default);
        } 
    }
}

// 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.ComponentModel;

    /// 
    /// Whether a template is instantiated single or multiple times. 
    /// The code generator generates fields corresponding to controls in the template
    /// for single instance templates. 
    ///  
    [AttributeUsage(AttributeTargets.Property)]
    public sealed class TemplateInstanceAttribute : Attribute { 


        public static readonly TemplateInstanceAttribute Multiple = new TemplateInstanceAttribute(TemplateInstance.Multiple);
 

        public static readonly TemplateInstanceAttribute Single = new TemplateInstanceAttribute(TemplateInstance.Single); 
 

        public static readonly TemplateInstanceAttribute Default = Multiple; 

        private TemplateInstance _instances;

 
        /// 
        ///  
        public TemplateInstanceAttribute(TemplateInstance instances) { 
            _instances = instances;
        } 


        /// 
        /// [To be supplied.] 
        /// 
        public TemplateInstance Instances { 
            get { 
                return _instances;
            } 
        }


        ///  
        public override bool Equals(object obj) {
            if (obj == this) { 
                return true; 
            }
 
            TemplateInstanceAttribute other = obj as TemplateInstanceAttribute;
            if (other != null) {
                return (other.Instances == Instances);
            } 
            return false;
        } 
 

        ///  
        public override int GetHashCode() {
            return _instances.GetHashCode();
        }
 

        ///  
        public override bool IsDefaultAttribute() { 
            return this.Equals(Default);
        } 
    }
}

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