csharp/Actipro/WPF-Controls/Samples/SampleBrowser/ProductSamples/SyntaxEditorSamples/QuickStart/DotNetAddonServerTags/ParentLexicalStateId.g.cs

ParentLexicalStateId.g.cs
namespace ActiproSoftware.ProductSamples.SyntaxEditorSamples.QuickStart.DotNetAddOnServerTags {
    using ActiproSoftware.Text.Lexing.Implementation;
    using System;
    using System.ComponentModel;
    using System.Linq;
    using System.Reflection;
    
    
    /// 
    /// Contains the lexical state IDs for the Parent to C# example language.
    /// 
    /// 
    /// This type was generated by the Actipro Language Designer tool v14.2.610.0 (http://www.actiprosoftware.com).
    /// 
    [System.CodeDom.Compiler.GeneratedCodeAttribute("LanguageDesigner", "14.2.610.0")]
    public partial clast ParentLexicalStateId : LexicalStateIdProviderBase {
        
        /// 
        /// Gets the Default lexical state ID.
        /// 
        [DescriptionAttribute("Default")]
        public const Int32 Default = 1;
        
        /// 
        /// Gets the ChildCodeBlock lexical state ID.
        /// 
        public const Int32 ChildCodeBlock = 2;
        
        /// 
        /// Gets the ChildOutputBlock lexical state ID.
        /// 
        public const Int32 ChildOutputBlock = 3;
        
        /// 
        /// Gets the minimum lexical state ID returned by this provider.
        /// 
        /// The minimum lexical state ID returned by this provider.
        public override Int32 MinId {
            get {
                return 1;
            }
        }
        
        /// 
        /// Gets the maximum lexical state ID returned by this provider.
        /// 
        /// The maximum lexical state ID returned by this provider.
        public override Int32 MaxId {
            get {
                return 3;
            }
        }
        
        /// 
        /// Returns whether the specified ID value is valid for this lexical state ID provider.
        /// 
        /// The lexical state ID to examine.
        /// true if the ID value is valid; otherwise, false
        public override Boolean ContainsId(Int32 id) {
            return ((id >= MinId) 
                        && (id  (f.IsPublic) && (f.IsStatic)).ToArray();
			#else
			return typeof(ParentLexicalStateId).GetFields((BindingFlags.Public | BindingFlags.Static));
			#endif
        }
        
        /// 
        /// Returns the actual string representation for the specified lexical state ID.
        /// 
        /// The lexical state ID to examine.
        /// The actual string representation for the specified lexical state ID.
        public override String GetDescription(Int32 id) {
            FieldInfo[] fields = GetFields();
            for (Int32 index = 0; (index < fields.Length); index = (index + 1)) {
                FieldInfo field = fields[index];
                if (id.Equals(field.GetValue(null))) {
                    Object descriptionAttr = field.GetCustomAttributes(typeof(DescriptionAttribute), false).FirstOrDefault();
                    if ((descriptionAttr != null)) {
                        return ((DescriptionAttribute)(descriptionAttr)).Description;
                    }
                    else {
                        return field.Name;
                    }
                }
            }
            return null;
        }
        
        /// 
        /// Returns the string-based key for the specified lexical state ID.
        /// 
        /// The lexical state ID to examine.
        /// The string-based key for the specified lexical state ID.
        public override String GetKey(Int32 id) {
            FieldInfo[] fields = GetFields();
            for (Int32 index = 0; (index < fields.Length); index = (index + 1)) {
                FieldInfo field = fields[index];
                if (id.Equals(field.GetValue(null))) {
                    return field.Name;
                }
            }
            return null;
        }
        
        /// 
        /// Specifies a description for a property or event.
        /// 
        private clast DescriptionAttribute : Attribute {
            
            private String descriptionValue;
            
            /// 
            /// Initializes a new instance of the DescriptionAttribute clast.
            /// 
            /// The description stored in this attribute.
            public DescriptionAttribute(String descriptionValue) {
                this.descriptionValue = descriptionValue;
            }
            
            /// 
            /// Gets the description stored in this attribute.
            /// 
            /// The description stored in this attribute.
            public String Description {
                get {
                    return this.descriptionValue;
                }
            }
        }
    }
}