Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
runtime
提交
4a23f535
R
runtime
项目概览
dotNET Platform
/
runtime
大约 1 年 前同步成功
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
runtime
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
4a23f535
编写于
5月 25, 2021
作者:
H
hrrrrustic
提交者:
GitHub
5月 24, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
System.ComponentModel.* missed Equals nullable annotations (#52163)
* add NotNullWhen attribute * add usings
上级
e7a500a8
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
64 addition
and
34 deletion
+64
-34
src/libraries/System.ComponentModel.Annotations/ref/System.ComponentModel.Annotations.cs
...odel.Annotations/ref/System.ComponentModel.Annotations.cs
+2
-2
src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/FilterUIHintAttribute.cs
...m/ComponentModel/DataAnnotations/FilterUIHintAttribute.cs
+2
-1
src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/UIHintAttribute.cs
.../System/ComponentModel/DataAnnotations/UIHintAttribute.cs
+3
-2
src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/GenericSpecializationPartCreationInfo.cs
.../ReflectionModel/GenericSpecializationPartCreationInfo.cs
+1
-1
src/libraries/System.ComponentModel.Primitives/ref/System.ComponentModel.Primitives.cs
...tModel.Primitives/ref/System.ComponentModel.Primitives.cs
+14
-14
src/libraries/System.ComponentModel.Primitives/src/System/ComponentModel/BrowsableAttribute.cs
...rimitives/src/System/ComponentModel/BrowsableAttribute.cs
+3
-1
src/libraries/System.ComponentModel.Primitives/src/System/ComponentModel/CategoryAttribute.cs
...Primitives/src/System/ComponentModel/CategoryAttribute.cs
+3
-1
src/libraries/System.ComponentModel.Primitives/src/System/ComponentModel/DescriptionAttribute.cs
...mitives/src/System/ComponentModel/DescriptionAttribute.cs
+3
-1
src/libraries/System.ComponentModel.Primitives/src/System/ComponentModel/DesignOnlyAttribute.cs
...imitives/src/System/ComponentModel/DesignOnlyAttribute.cs
+3
-1
src/libraries/System.ComponentModel.Primitives/src/System/ComponentModel/DesignerCategoryAttribute.cs
...es/src/System/ComponentModel/DesignerCategoryAttribute.cs
+3
-1
src/libraries/System.ComponentModel.Primitives/src/System/ComponentModel/DesignerSerializationVisibilityAttribute.cs
...omponentModel/DesignerSerializationVisibilityAttribute.cs
+3
-1
src/libraries/System.ComponentModel.Primitives/src/System/ComponentModel/DisplayNameAttribute.cs
...mitives/src/System/ComponentModel/DisplayNameAttribute.cs
+3
-1
src/libraries/System.ComponentModel.Primitives/src/System/ComponentModel/ImmutableObjectAttribute.cs
...ves/src/System/ComponentModel/ImmutableObjectAttribute.cs
+3
-1
src/libraries/System.ComponentModel.Primitives/src/System/ComponentModel/LocalizableAttribute.cs
...mitives/src/System/ComponentModel/LocalizableAttribute.cs
+3
-1
src/libraries/System.ComponentModel.Primitives/src/System/ComponentModel/MergablePropertyAttribute.cs
...es/src/System/ComponentModel/MergablePropertyAttribute.cs
+3
-1
src/libraries/System.ComponentModel.Primitives/src/System/ComponentModel/NotifyParentPropertyAttribute.cs
...rc/System/ComponentModel/NotifyParentPropertyAttribute.cs
+3
-1
src/libraries/System.ComponentModel.Primitives/src/System/ComponentModel/ParenthesizePropertyNameAttribute.cs
...ystem/ComponentModel/ParenthesizePropertyNameAttribute.cs
+3
-1
src/libraries/System.ComponentModel.Primitives/src/System/ComponentModel/ReadOnlyAttribute.cs
...Primitives/src/System/ComponentModel/ReadOnlyAttribute.cs
+3
-1
src/libraries/System.ComponentModel.Primitives/src/System/ComponentModel/RefreshPropertiesAttribute.cs
...s/src/System/ComponentModel/RefreshPropertiesAttribute.cs
+3
-1
未找到文件。
src/libraries/System.ComponentModel.Annotations/ref/System.ComponentModel.Annotations.cs
浏览文件 @
4a23f535
...
...
@@ -174,7 +174,7 @@ public sealed partial class FilterUIHintAttribute : System.Attribute
public
System
.
Collections
.
Generic
.
IDictionary
<
string
,
object
?>
ControlParameters
{
get
{
throw
null
;
}
}
public
string
FilterUIHint
{
get
{
throw
null
;
}
}
public
string
?
PresentationLayer
{
get
{
throw
null
;
}
}
public
override
bool
Equals
(
object
?
obj
)
{
throw
null
;
}
public
override
bool
Equals
(
[
System
.
Diagnostics
.
CodeAnalysis
.
NotNullWhenAttribute
(
true
)]
object
?
obj
)
{
throw
null
;
}
public
override
int
GetHashCode
()
{
throw
null
;
}
}
public
partial
interface
IValidatableObject
...
...
@@ -280,7 +280,7 @@ public partial class UIHintAttribute : System.Attribute
public
System
.
Collections
.
Generic
.
IDictionary
<
string
,
object
?>
ControlParameters
{
get
{
throw
null
;
}
}
public
string
?
PresentationLayer
{
get
{
throw
null
;
}
}
public
string
UIHint
{
get
{
throw
null
;
}
}
public
override
bool
Equals
(
object
?
obj
)
{
throw
null
;
}
public
override
bool
Equals
(
[
System
.
Diagnostics
.
CodeAnalysis
.
NotNullWhenAttribute
(
true
)]
object
?
obj
)
{
throw
null
;
}
public
override
int
GetHashCode
()
{
throw
null
;
}
}
[
System
.
AttributeUsageAttribute
(
System
.
AttributeTargets
.
Field
|
System
.
AttributeTargets
.
Parameter
|
System
.
AttributeTargets
.
Property
,
AllowMultiple
=
false
)]
...
...
src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/FilterUIHintAttribute.cs
浏览文件 @
4a23f535
...
...
@@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
using
System.Collections.Generic
;
using
System.Diagnostics.CodeAnalysis
;
namespace
System.ComponentModel.DataAnnotations
{
...
...
@@ -82,7 +83,7 @@ public FilterUIHintAttribute(string filterUIHint, string? presentationLayer)
/// <param name="obj">An System.Object.</param>
/// <returns>true if obj is a FilterUIHintAttribute and its value is the same
/// as this instance; otherwise, false.</returns>
public
override
bool
Equals
(
object
?
obj
)
=>
public
override
bool
Equals
(
[
NotNullWhen
(
true
)]
object
?
obj
)
=>
obj
is
FilterUIHintAttribute
otherAttribute
&&
_implementation
.
Equals
(
otherAttribute
.
_implementation
);
}
}
src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/UIHintAttribute.cs
浏览文件 @
4a23f535
...
...
@@ -5,6 +5,7 @@
using
System.Diagnostics
;
using
System.Globalization
;
using
System.Linq
;
using
System.Diagnostics.CodeAnalysis
;
namespace
System.ComponentModel.DataAnnotations
{
...
...
@@ -65,7 +66,7 @@ public UIHintAttribute(string uiHint, string? presentationLayer, params object?[
public
override
int
GetHashCode
()
=>
_implementation
.
GetHashCode
();
public
override
bool
Equals
(
object
?
obj
)
=>
public
override
bool
Equals
(
[
NotNullWhen
(
true
)]
object
?
obj
)
=>
obj
is
UIHintAttribute
otherAttribute
&&
_implementation
.
Equals
(
otherAttribute
.
_implementation
);
internal
sealed
class
UIHintImplementation
...
...
@@ -118,7 +119,7 @@ public override int GetHashCode()
/// </summary>
/// <param name="obj">An System.Object.</param>
/// <returns>true if obj is a UIHintAttribute and its value is the same as this instance; otherwise, false.</returns>
public
override
bool
Equals
(
object
?
obj
)
public
override
bool
Equals
(
[
NotNullWhen
(
true
)]
object
?
obj
)
{
var
otherImplementation
=
obj
as
UIHintImplementation
;
...
...
src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/GenericSpecializationPartCreationInfo.cs
浏览文件 @
4a23f535
...
...
@@ -550,7 +550,7 @@ public string DisplayName
get
{
return
_originalPartCreationInfo
.
Origin
;
}
}
public
override
bool
Equals
(
object
?
obj
)
public
override
bool
Equals
(
[
NotNullWhen
(
true
)]
object
?
obj
)
{
return
obj
is
GenericSpecializationPartCreationInfo
that
&&
(
_originalPartCreationInfo
.
Equals
(
that
.
_originalPartCreationInfo
))
&&
(
_specialization
.
IsArrayEqual
(
that
.
_specialization
));
...
...
src/libraries/System.ComponentModel.Primitives/ref/System.ComponentModel.Primitives.cs
浏览文件 @
4a23f535
...
...
@@ -14,7 +14,7 @@ public sealed partial class BrowsableAttribute : System.Attribute
public
static
readonly
System
.
ComponentModel
.
BrowsableAttribute
Yes
;
public
BrowsableAttribute
(
bool
browsable
)
{
}
public
bool
Browsable
{
get
{
throw
null
;
}
}
public
override
bool
Equals
(
object
?
obj
)
{
throw
null
;
}
public
override
bool
Equals
(
[
System
.
Diagnostics
.
CodeAnalysis
.
NotNullWhenAttribute
(
true
)]
object
?
obj
)
{
throw
null
;
}
public
override
int
GetHashCode
()
{
throw
null
;
}
public
override
bool
IsDefaultAttribute
()
{
throw
null
;
}
}
...
...
@@ -38,7 +38,7 @@ public partial class CategoryAttribute : System.Attribute
public
static
System
.
ComponentModel
.
CategoryAttribute
Layout
{
get
{
throw
null
;
}
}
public
static
System
.
ComponentModel
.
CategoryAttribute
Mouse
{
get
{
throw
null
;
}
}
public
static
System
.
ComponentModel
.
CategoryAttribute
WindowStyle
{
get
{
throw
null
;
}
}
public
override
bool
Equals
(
object
?
obj
)
{
throw
null
;
}
public
override
bool
Equals
(
[
System
.
Diagnostics
.
CodeAnalysis
.
NotNullWhenAttribute
(
true
)]
object
?
obj
)
{
throw
null
;
}
public
override
int
GetHashCode
()
{
throw
null
;
}
protected
virtual
string
?
GetLocalizedString
(
string
value
)
{
throw
null
;
}
public
override
bool
IsDefaultAttribute
()
{
throw
null
;
}
...
...
@@ -82,7 +82,7 @@ public partial class DescriptionAttribute : System.Attribute
public
DescriptionAttribute
(
string
description
)
{
}
public
virtual
string
Description
{
get
{
throw
null
;
}
}
protected
string
DescriptionValue
{
get
{
throw
null
;
}
set
{
}
}
public
override
bool
Equals
(
object
?
obj
)
{
throw
null
;
}
public
override
bool
Equals
(
[
System
.
Diagnostics
.
CodeAnalysis
.
NotNullWhenAttribute
(
true
)]
object
?
obj
)
{
throw
null
;
}
public
override
int
GetHashCode
()
{
throw
null
;
}
public
override
bool
IsDefaultAttribute
()
{
throw
null
;
}
}
...
...
@@ -113,7 +113,7 @@ public sealed partial class DesignerCategoryAttribute : System.Attribute
public
DesignerCategoryAttribute
(
string
category
)
{
}
public
string
Category
{
get
{
throw
null
;
}
}
public
override
object
TypeId
{
get
{
throw
null
;
}
}
public
override
bool
Equals
(
object
?
obj
)
{
throw
null
;
}
public
override
bool
Equals
(
[
System
.
Diagnostics
.
CodeAnalysis
.
NotNullWhenAttribute
(
true
)]
object
?
obj
)
{
throw
null
;
}
public
override
int
GetHashCode
()
{
throw
null
;
}
public
override
bool
IsDefaultAttribute
()
{
throw
null
;
}
}
...
...
@@ -132,7 +132,7 @@ public sealed partial class DesignerSerializationVisibilityAttribute : System.At
public
static
readonly
System
.
ComponentModel
.
DesignerSerializationVisibilityAttribute
Visible
;
public
DesignerSerializationVisibilityAttribute
(
System
.
ComponentModel
.
DesignerSerializationVisibility
visibility
)
{
}
public
System
.
ComponentModel
.
DesignerSerializationVisibility
Visibility
{
get
{
throw
null
;
}
}
public
override
bool
Equals
(
object
?
obj
)
{
throw
null
;
}
public
override
bool
Equals
(
[
System
.
Diagnostics
.
CodeAnalysis
.
NotNullWhenAttribute
(
true
)]
object
?
obj
)
{
throw
null
;
}
public
override
int
GetHashCode
()
{
throw
null
;
}
public
override
bool
IsDefaultAttribute
()
{
throw
null
;
}
}
...
...
@@ -144,7 +144,7 @@ public sealed partial class DesignOnlyAttribute : System.Attribute
public
static
readonly
System
.
ComponentModel
.
DesignOnlyAttribute
Yes
;
public
DesignOnlyAttribute
(
bool
isDesignOnly
)
{
}
public
bool
IsDesignOnly
{
get
{
throw
null
;
}
}
public
override
bool
Equals
(
object
?
obj
)
{
throw
null
;
}
public
override
bool
Equals
(
[
System
.
Diagnostics
.
CodeAnalysis
.
NotNullWhenAttribute
(
true
)]
object
?
obj
)
{
throw
null
;
}
public
override
int
GetHashCode
()
{
throw
null
;
}
public
override
bool
IsDefaultAttribute
()
{
throw
null
;
}
}
...
...
@@ -156,7 +156,7 @@ public partial class DisplayNameAttribute : System.Attribute
public
DisplayNameAttribute
(
string
displayName
)
{
}
public
virtual
string
DisplayName
{
get
{
throw
null
;
}
}
protected
string
DisplayNameValue
{
get
{
throw
null
;
}
set
{
}
}
public
override
bool
Equals
(
object
?
obj
)
{
throw
null
;
}
public
override
bool
Equals
(
[
System
.
Diagnostics
.
CodeAnalysis
.
NotNullWhenAttribute
(
true
)]
object
?
obj
)
{
throw
null
;
}
public
override
int
GetHashCode
()
{
throw
null
;
}
public
override
bool
IsDefaultAttribute
()
{
throw
null
;
}
}
...
...
@@ -208,7 +208,7 @@ public sealed partial class ImmutableObjectAttribute : System.Attribute
public
static
readonly
System
.
ComponentModel
.
ImmutableObjectAttribute
Yes
;
public
ImmutableObjectAttribute
(
bool
immutable
)
{
}
public
bool
Immutable
{
get
{
throw
null
;
}
}
public
override
bool
Equals
(
object
?
obj
)
{
throw
null
;
}
public
override
bool
Equals
(
[
System
.
Diagnostics
.
CodeAnalysis
.
NotNullWhenAttribute
(
true
)]
object
?
obj
)
{
throw
null
;
}
public
override
int
GetHashCode
()
{
throw
null
;
}
public
override
bool
IsDefaultAttribute
()
{
throw
null
;
}
}
...
...
@@ -260,7 +260,7 @@ public sealed partial class LocalizableAttribute : System.Attribute
public
static
readonly
System
.
ComponentModel
.
LocalizableAttribute
Yes
;
public
LocalizableAttribute
(
bool
isLocalizable
)
{
}
public
bool
IsLocalizable
{
get
{
throw
null
;
}
}
public
override
bool
Equals
(
object
?
obj
)
{
throw
null
;
}
public
override
bool
Equals
(
[
System
.
Diagnostics
.
CodeAnalysis
.
NotNullWhenAttribute
(
true
)]
object
?
obj
)
{
throw
null
;
}
public
override
int
GetHashCode
()
{
throw
null
;
}
public
override
bool
IsDefaultAttribute
()
{
throw
null
;
}
}
...
...
@@ -272,7 +272,7 @@ public sealed partial class MergablePropertyAttribute : System.Attribute
public
static
readonly
System
.
ComponentModel
.
MergablePropertyAttribute
Yes
;
public
MergablePropertyAttribute
(
bool
allowMerge
)
{
}
public
bool
AllowMerge
{
get
{
throw
null
;
}
}
public
override
bool
Equals
(
object
?
obj
)
{
throw
null
;
}
public
override
bool
Equals
(
[
System
.
Diagnostics
.
CodeAnalysis
.
NotNullWhenAttribute
(
true
)]
object
?
obj
)
{
throw
null
;
}
public
override
int
GetHashCode
()
{
throw
null
;
}
public
override
bool
IsDefaultAttribute
()
{
throw
null
;
}
}
...
...
@@ -284,7 +284,7 @@ public sealed partial class NotifyParentPropertyAttribute : System.Attribute
public
static
readonly
System
.
ComponentModel
.
NotifyParentPropertyAttribute
Yes
;
public
NotifyParentPropertyAttribute
(
bool
notifyParent
)
{
}
public
bool
NotifyParent
{
get
{
throw
null
;
}
}
public
override
bool
Equals
(
object
?
obj
)
{
throw
null
;
}
public
override
bool
Equals
(
[
System
.
Diagnostics
.
CodeAnalysis
.
NotNullWhenAttribute
(
true
)]
object
?
obj
)
{
throw
null
;
}
public
override
int
GetHashCode
()
{
throw
null
;
}
public
override
bool
IsDefaultAttribute
()
{
throw
null
;
}
}
...
...
@@ -295,7 +295,7 @@ public sealed partial class ParenthesizePropertyNameAttribute : System.Attribute
public
ParenthesizePropertyNameAttribute
()
{
}
public
ParenthesizePropertyNameAttribute
(
bool
needParenthesis
)
{
}
public
bool
NeedParenthesis
{
get
{
throw
null
;
}
}
public
override
bool
Equals
(
object
?
obj
)
{
throw
null
;
}
public
override
bool
Equals
(
[
System
.
Diagnostics
.
CodeAnalysis
.
NotNullWhenAttribute
(
true
)]
object
?
obj
)
{
throw
null
;
}
public
override
int
GetHashCode
()
{
throw
null
;
}
public
override
bool
IsDefaultAttribute
()
{
throw
null
;
}
}
...
...
@@ -307,7 +307,7 @@ public sealed partial class ReadOnlyAttribute : System.Attribute
public
static
readonly
System
.
ComponentModel
.
ReadOnlyAttribute
Yes
;
public
ReadOnlyAttribute
(
bool
isReadOnly
)
{
}
public
bool
IsReadOnly
{
get
{
throw
null
;
}
}
public
override
bool
Equals
(
object
?
value
)
{
throw
null
;
}
public
override
bool
Equals
(
[
System
.
Diagnostics
.
CodeAnalysis
.
NotNullWhenAttribute
(
true
)]
object
?
value
)
{
throw
null
;
}
public
override
int
GetHashCode
()
{
throw
null
;
}
public
override
bool
IsDefaultAttribute
()
{
throw
null
;
}
}
...
...
@@ -325,7 +325,7 @@ public sealed partial class RefreshPropertiesAttribute : System.Attribute
public
static
readonly
System
.
ComponentModel
.
RefreshPropertiesAttribute
Repaint
;
public
RefreshPropertiesAttribute
(
System
.
ComponentModel
.
RefreshProperties
refresh
)
{
}
public
System
.
ComponentModel
.
RefreshProperties
RefreshProperties
{
get
{
throw
null
;
}
}
public
override
bool
Equals
(
object
?
obj
)
{
throw
null
;
}
public
override
bool
Equals
(
[
System
.
Diagnostics
.
CodeAnalysis
.
NotNullWhenAttribute
(
true
)]
object
?
obj
)
{
throw
null
;
}
public
override
int
GetHashCode
()
{
throw
null
;
}
public
override
bool
IsDefaultAttribute
()
{
throw
null
;
}
}
...
...
src/libraries/System.ComponentModel.Primitives/src/System/ComponentModel/BrowsableAttribute.cs
浏览文件 @
4a23f535
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using
System.Diagnostics.CodeAnalysis
;
namespace
System.ComponentModel
{
/// <summary>
...
...
@@ -42,7 +44,7 @@ public BrowsableAttribute(bool browsable)
/// </summary>
public
bool
Browsable
{
get
;
}
public
override
bool
Equals
(
object
?
obj
)
=>
public
override
bool
Equals
(
[
NotNullWhen
(
true
)]
object
?
obj
)
=>
obj
is
BrowsableAttribute
other
&&
other
.
Browsable
==
Browsable
;
public
override
int
GetHashCode
()
=>
Browsable
.
GetHashCode
();
...
...
src/libraries/System.ComponentModel.Primitives/src/System/ComponentModel/CategoryAttribute.cs
浏览文件 @
4a23f535
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using
System.Diagnostics.CodeAnalysis
;
namespace
System.ComponentModel
{
/// <summary>
...
...
@@ -189,7 +191,7 @@ public string Category
}
}
public
override
bool
Equals
(
object
?
obj
)
=>
public
override
bool
Equals
(
[
NotNullWhen
(
true
)]
object
?
obj
)
=>
obj
is
CategoryAttribute
other
&&
other
.
Category
==
Category
;
public
override
int
GetHashCode
()
=>
Category
?.
GetHashCode
()
??
0
;
...
...
src/libraries/System.ComponentModel.Primitives/src/System/ComponentModel/DescriptionAttribute.cs
浏览文件 @
4a23f535
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using
System.Diagnostics.CodeAnalysis
;
namespace
System.ComponentModel
{
/// <summary>
...
...
@@ -39,7 +41,7 @@ public DescriptionAttribute(string description)
/// </summary>
protected
string
DescriptionValue
{
get
;
set
;
}
public
override
bool
Equals
(
object
?
obj
)
=>
public
override
bool
Equals
(
[
NotNullWhen
(
true
)]
object
?
obj
)
=>
obj
is
DescriptionAttribute
other
&&
other
.
Description
==
Description
;
public
override
int
GetHashCode
()
=>
Description
?.
GetHashCode
()
??
0
;
...
...
src/libraries/System.ComponentModel.Primitives/src/System/ComponentModel/DesignOnlyAttribute.cs
浏览文件 @
4a23f535
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using
System.Diagnostics.CodeAnalysis
;
namespace
System.ComponentModel
{
/// <summary>
...
...
@@ -41,7 +43,7 @@ public DesignOnlyAttribute(bool isDesignOnly)
/// </summary>
public
bool
IsDesignOnly
{
get
;
}
public
override
bool
Equals
(
object
?
obj
)
=>
public
override
bool
Equals
(
[
NotNullWhen
(
true
)]
object
?
obj
)
=>
obj
is
DesignOnlyAttribute
other
&&
other
.
IsDesignOnly
==
IsDesignOnly
;
public
override
int
GetHashCode
()
=>
IsDesignOnly
.
GetHashCode
();
...
...
src/libraries/System.ComponentModel.Primitives/src/System/ComponentModel/DesignerCategoryAttribute.cs
浏览文件 @
4a23f535
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using
System.Diagnostics.CodeAnalysis
;
namespace
System.ComponentModel
{
/// <summary>
...
...
@@ -55,7 +57,7 @@ public DesignerCategoryAttribute(string category)
/// </summary>
public
string
Category
{
get
;
}
public
override
bool
Equals
(
object
?
obj
)
=>
public
override
bool
Equals
(
[
NotNullWhen
(
true
)]
object
?
obj
)
=>
obj
is
DesignerCategoryAttribute
other
&&
other
.
Category
==
Category
;
public
override
int
GetHashCode
()
=>
Category
?.
GetHashCode
()
??
0
;
...
...
src/libraries/System.ComponentModel.Primitives/src/System/ComponentModel/DesignerSerializationVisibilityAttribute.cs
浏览文件 @
4a23f535
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using
System.Diagnostics.CodeAnalysis
;
namespace
System.ComponentModel
{
/// <summary>
...
...
@@ -51,7 +53,7 @@ public DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility
/// </summary>
public
DesignerSerializationVisibility
Visibility
{
get
;
}
public
override
bool
Equals
(
object
?
obj
)
=>
public
override
bool
Equals
(
[
NotNullWhen
(
true
)]
object
?
obj
)
=>
obj
is
DesignerSerializationVisibilityAttribute
other
&&
other
.
Visibility
==
Visibility
;
public
override
int
GetHashCode
()
=>
base
.
GetHashCode
();
...
...
src/libraries/System.ComponentModel.Primitives/src/System/ComponentModel/DisplayNameAttribute.cs
浏览文件 @
4a23f535
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using
System.Diagnostics.CodeAnalysis
;
namespace
System.ComponentModel
{
/// <summary>
...
...
@@ -38,7 +40,7 @@ public DisplayNameAttribute(string displayName)
/// </summary>
protected
string
DisplayNameValue
{
get
;
set
;
}
public
override
bool
Equals
(
object
?
obj
)
=>
public
override
bool
Equals
(
[
NotNullWhen
(
true
)]
object
?
obj
)
=>
obj
is
DisplayNameAttribute
other
&&
other
.
DisplayName
==
DisplayName
;
public
override
int
GetHashCode
()
=>
DisplayName
?.
GetHashCode
()
??
0
;
...
...
src/libraries/System.ComponentModel.Primitives/src/System/ComponentModel/ImmutableObjectAttribute.cs
浏览文件 @
4a23f535
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using
System.Diagnostics.CodeAnalysis
;
namespace
System.ComponentModel
{
/// <summary>
...
...
@@ -41,7 +43,7 @@ public ImmutableObjectAttribute(bool immutable)
public
bool
Immutable
{
get
;
}
public
override
bool
Equals
(
object
?
obj
)
=>
public
override
bool
Equals
(
[
NotNullWhen
(
true
)]
object
?
obj
)
=>
obj
is
ImmutableObjectAttribute
other
&&
other
.
Immutable
==
Immutable
;
public
override
int
GetHashCode
()
=>
base
.
GetHashCode
();
...
...
src/libraries/System.ComponentModel.Primitives/src/System/ComponentModel/LocalizableAttribute.cs
浏览文件 @
4a23f535
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using
System.Diagnostics.CodeAnalysis
;
namespace
System.ComponentModel
{
/// <summary>
...
...
@@ -41,7 +43,7 @@ public LocalizableAttribute(bool isLocalizable)
/// </summary>
public
static
readonly
LocalizableAttribute
Default
=
No
;
public
override
bool
Equals
(
object
?
obj
)
=>
public
override
bool
Equals
(
[
NotNullWhen
(
true
)]
object
?
obj
)
=>
obj
is
LocalizableAttribute
other
&&
other
.
IsLocalizable
==
IsLocalizable
;
public
override
int
GetHashCode
()
=>
base
.
GetHashCode
();
...
...
src/libraries/System.ComponentModel.Primitives/src/System/ComponentModel/MergablePropertyAttribute.cs
浏览文件 @
4a23f535
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using
System.Diagnostics.CodeAnalysis
;
namespace
System.ComponentModel
{
/// <summary>
...
...
@@ -47,7 +49,7 @@ public MergablePropertyAttribute(bool allowMerge)
/// </summary>
public
bool
AllowMerge
{
get
;
}
public
override
bool
Equals
(
object
?
obj
)
=>
public
override
bool
Equals
(
[
NotNullWhen
(
true
)]
object
?
obj
)
=>
obj
is
MergablePropertyAttribute
other
&&
other
.
AllowMerge
==
AllowMerge
;
public
override
int
GetHashCode
()
=>
base
.
GetHashCode
();
...
...
src/libraries/System.ComponentModel.Primitives/src/System/ComponentModel/NotifyParentPropertyAttribute.cs
浏览文件 @
4a23f535
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using
System.Diagnostics.CodeAnalysis
;
namespace
System.ComponentModel
{
/// <summary>
...
...
@@ -49,7 +51,7 @@ public NotifyParentPropertyAttribute(bool notifyParent)
/// <summary>
/// Tests whether the specified object is the same as the current object.
/// </summary>
public
override
bool
Equals
(
object
?
obj
)
=>
public
override
bool
Equals
(
[
NotNullWhen
(
true
)]
object
?
obj
)
=>
obj
is
NotifyParentPropertyAttribute
other
&&
other
.
NotifyParent
==
NotifyParent
;
public
override
int
GetHashCode
()
=>
base
.
GetHashCode
();
...
...
src/libraries/System.ComponentModel.Primitives/src/System/ComponentModel/ParenthesizePropertyNameAttribute.cs
浏览文件 @
4a23f535
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using
System.Diagnostics.CodeAnalysis
;
namespace
System.ComponentModel
{
/// <summary>
...
...
@@ -39,7 +41,7 @@ public ParenthesizePropertyNameAttribute(bool needParenthesis)
/// <summary>
/// Compares the specified object to this object and tests for equality.
/// </summary>
public
override
bool
Equals
(
object
?
obj
)
=>
public
override
bool
Equals
(
[
NotNullWhen
(
true
)]
object
?
obj
)
=>
obj
is
ParenthesizePropertyNameAttribute
other
&&
other
.
NeedParenthesis
==
NeedParenthesis
;
public
override
int
GetHashCode
()
=>
base
.
GetHashCode
();
...
...
src/libraries/System.ComponentModel.Primitives/src/System/ComponentModel/ReadOnlyAttribute.cs
浏览文件 @
4a23f535
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using
System.Diagnostics.CodeAnalysis
;
namespace
System.ComponentModel
{
/// <summary>
...
...
@@ -42,7 +44,7 @@ public sealed class ReadOnlyAttribute : Attribute
/// </summary>
public
bool
IsReadOnly
{
get
;
}
public
override
bool
Equals
(
object
?
value
)
=>
public
override
bool
Equals
(
[
NotNullWhen
(
true
)]
object
?
value
)
=>
value
is
ReadOnlyAttribute
other
&&
other
.
IsReadOnly
==
IsReadOnly
;
public
override
int
GetHashCode
()
=>
base
.
GetHashCode
();
...
...
src/libraries/System.ComponentModel.Primitives/src/System/ComponentModel/RefreshPropertiesAttribute.cs
浏览文件 @
4a23f535
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using
System.Diagnostics.CodeAnalysis
;
namespace
System.ComponentModel
{
/// <summary>
...
...
@@ -37,7 +39,7 @@ public RefreshPropertiesAttribute(RefreshProperties refresh)
/// </summary>
public
RefreshProperties
RefreshProperties
{
get
;
}
public
override
bool
Equals
(
object
?
obj
)
=>
public
override
bool
Equals
(
[
NotNullWhen
(
true
)]
object
?
obj
)
=>
obj
is
RefreshPropertiesAttribute
other
&&
other
.
RefreshProperties
==
RefreshProperties
;
public
override
int
GetHashCode
()
=>
base
.
GetHashCode
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录