//------------------------------------------------------------------------------ // // Copyright (c) Microsoft Corporation. All rights reserved. // //------------------------------------------------------------------------------ /* */ namespace System.Web.UI { using System; using System.Diagnostics.CodeAnalysis; /// /// Allows a TemplateControl (e.g. Page or UserControl) derived class to specify // the control builder used at the top level ofthe builder tree when parsing the file. /// for building that control within the ASP.NET parser. /// [AttributeUsage(AttributeTargets.Class)] public sealed class FileLevelControlBuilderAttribute : Attribute { /// /// /// The default object is a /// builder. This field is read-only. /// public static readonly FileLevelControlBuilderAttribute Default = new FileLevelControlBuilderAttribute(null); private Type builderType = null; /// /// public FileLevelControlBuilderAttribute(Type builderType) { this.builderType = builderType; } /// /// Indicates XXX. This property is read-only. /// public Type BuilderType { get { return builderType; } } /// /// /// [To be supplied.] /// [SuppressMessage("Microsoft.Usage", "CA2303:FlagTypeGetHashCode", Justification = "The type is a ControlBuilder which is never going to be an interop class.")] public override int GetHashCode() { return builderType.GetHashCode(); } /// /// /// public override bool Equals(object obj) { if (obj == this) { return true; } if ((obj != null) && (obj is FileLevelControlBuilderAttribute)) { return ((FileLevelControlBuilderAttribute)obj).BuilderType == builderType; } return false; } /// /// /// public override bool IsDefaultAttribute() { return this.Equals(Default); } } }