forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRefreshPropertiesAttribute.cs
More file actions
48 lines (40 loc) · 1.93 KB
/
RefreshPropertiesAttribute.cs
File metadata and controls
48 lines (40 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace System.ComponentModel
{
/// <summary>
/// Specifies how a designer refreshes when the property value is changed.
/// </summary>
[AttributeUsage(AttributeTargets.All)]
public sealed class RefreshPropertiesAttribute : Attribute
{
/// <summary>
/// Indicates all properties should be refreshed if the property value is changed.
/// This field is read-only.
/// </summary>
public static readonly RefreshPropertiesAttribute All = new RefreshPropertiesAttribute(RefreshProperties.All);
/// <summary>
/// Indicates all properties should be invalidated and repainted if the property
/// value is changed. This field is read-only.
/// </summary>
public static readonly RefreshPropertiesAttribute Repaint = new RefreshPropertiesAttribute(RefreshProperties.Repaint);
/// <summary>
/// Indicates that by default no properties should be refreshed if the property
/// value is changed. This field is read-only.
/// </summary>
public static readonly RefreshPropertiesAttribute Default = new RefreshPropertiesAttribute(RefreshProperties.None);
public RefreshPropertiesAttribute(RefreshProperties refresh)
{
RefreshProperties = refresh;
}
/// <summary>
/// Gets the refresh properties for the member.
/// </summary>
public RefreshProperties RefreshProperties { get; }
public override bool Equals(object? obj) =>
obj is RefreshPropertiesAttribute other && other.RefreshProperties == RefreshProperties;
public override int GetHashCode() => base.GetHashCode();
public override bool IsDefaultAttribute() => Equals(Default);
}
}