templategroup.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WebForms / System / Web / UI / Design / templategroup.cs / 1 / templategroup.cs

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

namespace System.Web.UI.Design { 
    using System; 
    using System.Collections;
    using System.Web.UI.WebControls; 

    /// 
    public class TemplateGroup {
        private static TemplateDefinition[] emptyTemplateDefinitionArray = new TemplateDefinition[0]; 

        private string _groupName; 
        private Style _groupStyle; 
        private ArrayList _templates;
 
        /// 
        public TemplateGroup(string groupName) : this(groupName, null) {
        }
 
        /// 
        public TemplateGroup(string groupName, Style groupStyle) { 
            _groupName = groupName; 
            _groupStyle = groupStyle;
        } 

        /// 
        public bool IsEmpty {
            get { 
                return (_templates == null) || (_templates.Count == 0);
            } 
        } 

        ///  
        public string GroupName {
            get {
                return _groupName;
            } 
        }
 
        ///  
        public Style GroupStyle {
            get { 
                return _groupStyle;
            }
        }
 
        /// 
        public TemplateDefinition[] Templates { 
            get { 
                if (_templates == null) {
                    return emptyTemplateDefinitionArray; 
                }

                return (TemplateDefinition[])_templates.ToArray(typeof(TemplateDefinition));
            } 
        }
 
        ///  
        public void AddTemplateDefinition(TemplateDefinition templateDefinition) {
            if (_templates == null) { 
                _templates = new ArrayList();
            }

            _templates.Add(templateDefinition); 
        }
 
    } 
}

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