//------------------------------------------------------------------------------ // // Copyright (c) Microsoft Corporation. All rights reserved. // //------------------------------------------------------------------------------ /* */ namespace System.ComponentModel { using System; using System.Diagnostics; using System.Security.Permissions; /// /// Specifies that the property can be /// used as an application setting. /// [AttributeUsage(AttributeTargets.Property)] [Obsolete("Use System.ComponentModel.SettingsBindableAttribute instead to work with the new settings model.")] public class RecommendedAsConfigurableAttribute : Attribute { private bool recommendedAsConfigurable = false; /// /// /// Initializes a new instance of /// the class. /// /// public RecommendedAsConfigurableAttribute(bool recommendedAsConfigurable) { this.recommendedAsConfigurable = recommendedAsConfigurable; } /// /// Gets a value indicating whether the property this /// attribute is bound to can be used as an application setting. /// public bool RecommendedAsConfigurable { get { return recommendedAsConfigurable; } } /// /// /// Specifies that a property cannot be used as an application setting. This /// field is read-only. /// /// public static readonly RecommendedAsConfigurableAttribute No = new RecommendedAsConfigurableAttribute(false); /// /// /// Specifies /// that a property can be used as an application setting. This field is read-only. /// /// public static readonly RecommendedAsConfigurableAttribute Yes = new RecommendedAsConfigurableAttribute(true); /// /// /// Specifies the default value for the , which is . This field is /// read-only. /// /// public static readonly RecommendedAsConfigurableAttribute Default = No; /// /// /// public override bool Equals(object obj) { if (obj == this) { return true; } RecommendedAsConfigurableAttribute other = obj as RecommendedAsConfigurableAttribute; return other != null && other.RecommendedAsConfigurable == recommendedAsConfigurable; } /// /// /// Returns the hashcode for this object. /// /// public override int GetHashCode() { return base.GetHashCode(); } /// /// /// public override bool IsDefaultAttribute() { return !recommendedAsConfigurable; } } }