1 //------------------------------------------------------------------------------
2 // <copyright file="RefreshPropertiesAttribute.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
5 //------------------------------------------------------------------------------
9 namespace System.ComponentModel {
10 using System.Security.Permissions;
13 /// <para> Specifies how a designer refreshes when the property value is changed.</para>
15 [AttributeUsage(AttributeTargets.All)]
16 public sealed class RefreshPropertiesAttribute : Attribute {
20 /// Indicates all properties should
21 /// be refreshed if the property value is changed. This field is
25 public static readonly RefreshPropertiesAttribute All = new RefreshPropertiesAttribute(RefreshProperties.All);
29 /// Indicates all properties should
30 /// be invalidated and repainted if the
31 /// property value is changed. This field is read-only.
34 public static readonly RefreshPropertiesAttribute Repaint = new RefreshPropertiesAttribute(RefreshProperties.Repaint);
38 /// Indicates that by default
40 /// properties should be refreshed if the property value
41 /// is changed. This field is read-only.
44 public static readonly RefreshPropertiesAttribute Default = new RefreshPropertiesAttribute(RefreshProperties.None);
46 private RefreshProperties refresh;
51 public RefreshPropertiesAttribute(RefreshProperties refresh) {
52 this.refresh = refresh;
58 /// the refresh properties for the member.
61 public RefreshProperties RefreshProperties {
69 /// Overrides object's Equals method.
72 public override bool Equals(object value) {
73 if (value is RefreshPropertiesAttribute) {
74 return(((RefreshPropertiesAttribute)value).RefreshProperties == refresh);
81 /// Returns the hashcode for this object.
84 public override int GetHashCode() {
85 return base.GetHashCode();
89 /// <para>Gets a value indicating whether the current attribute is the default.</para>
91 public override bool IsDefaultAttribute() {
92 return this.Equals(Default);