1
1
// Licensed to the .NET Foundation under one or more agreements.
2
2
// The .NET Foundation licenses this file to you under the MIT license.
3
3
4
- #nullable disable
5
-
6
4
using System . Reflection ;
7
5
8
6
namespace System . ComponentModel . Design ;
9
7
10
8
public class DesignerActionMethodItem : DesignerActionItem
11
9
{
12
- private readonly DesignerActionList _actionList ;
13
- private MethodInfo _methodInfo ;
14
-
15
- public DesignerActionMethodItem ( DesignerActionList actionList , string memberName , string displayName , string category , string description , bool includeAsDesignerVerb )
10
+ private readonly DesignerActionList ? _actionList ;
11
+ private MethodInfo ? _methodInfo ;
12
+
13
+ public DesignerActionMethodItem (
14
+ DesignerActionList ? actionList ,
15
+ string ? memberName ,
16
+ string ? displayName ,
17
+ string ? category ,
18
+ string ? description ,
19
+ bool includeAsDesignerVerb )
16
20
: base ( displayName , category , description )
17
21
{
18
22
_actionList = actionList ;
19
23
MemberName = memberName ;
20
24
IncludeAsDesignerVerb = includeAsDesignerVerb ;
21
25
}
22
26
23
- public DesignerActionMethodItem ( DesignerActionList actionList , string memberName , string displayName ) : this ( actionList , memberName , displayName , null , null , false )
27
+ public DesignerActionMethodItem (
28
+ DesignerActionList ? actionList ,
29
+ string ? memberName ,
30
+ string ? displayName )
31
+ : this (
32
+ actionList ,
33
+ memberName ,
34
+ displayName ,
35
+ category : null ,
36
+ description : null ,
37
+ includeAsDesignerVerb : false )
24
38
{
25
39
}
26
40
27
- public DesignerActionMethodItem ( DesignerActionList actionList , string memberName , string displayName , bool includeAsDesignerVerb ) : this ( actionList , memberName , displayName , null , null , includeAsDesignerVerb )
41
+ public DesignerActionMethodItem (
42
+ DesignerActionList ? actionList ,
43
+ string ? memberName ,
44
+ string ? displayName ,
45
+ bool includeAsDesignerVerb )
46
+ : this (
47
+ actionList ,
48
+ memberName ,
49
+ displayName ,
50
+ category : null ,
51
+ description : null ,
52
+ includeAsDesignerVerb )
28
53
{
29
54
}
30
55
31
- public DesignerActionMethodItem ( DesignerActionList actionList , string memberName , string displayName , string category ) : this ( actionList , memberName , displayName , category , null , false )
56
+ public DesignerActionMethodItem (
57
+ DesignerActionList ? actionList ,
58
+ string ? memberName ,
59
+ string ? displayName ,
60
+ string ? category )
61
+ : this (
62
+ actionList ,
63
+ memberName ,
64
+ displayName ,
65
+ category ,
66
+ description : null ,
67
+ includeAsDesignerVerb : false )
32
68
{
33
69
}
34
70
35
- public DesignerActionMethodItem ( DesignerActionList actionList , string memberName , string displayName , string category , bool includeAsDesignerVerb ) : this ( actionList , memberName , displayName , category , null , includeAsDesignerVerb )
71
+ public DesignerActionMethodItem (
72
+ DesignerActionList ? actionList ,
73
+ string ? memberName ,
74
+ string ? displayName ,
75
+ string ? category ,
76
+ bool includeAsDesignerVerb )
77
+ : this (
78
+ actionList ,
79
+ memberName ,
80
+ displayName ,
81
+ category ,
82
+ description : null ,
83
+ includeAsDesignerVerb )
36
84
{
37
85
}
38
86
39
- public DesignerActionMethodItem ( DesignerActionList actionList , string memberName , string displayName , string category , string description ) : this ( actionList , memberName , displayName , category , description , false )
87
+ public DesignerActionMethodItem (
88
+ DesignerActionList ? actionList ,
89
+ string ? memberName ,
90
+ string ? displayName ,
91
+ string ? category ,
92
+ string ? description )
93
+ : this (
94
+ actionList ,
95
+ memberName ,
96
+ displayName ,
97
+ category ,
98
+ description ,
99
+ includeAsDesignerVerb : false )
40
100
{
41
101
}
42
102
43
- public virtual string MemberName { get ; }
103
+ public virtual string ? MemberName { get ; }
44
104
45
- public IComponent RelatedComponent { get ; set ; }
105
+ public IComponent ? RelatedComponent { get ; set ; }
46
106
47
107
public virtual bool IncludeAsDesignerVerb { get ; }
48
108
@@ -61,7 +121,7 @@ public virtual void Invoke()
61
121
// this is only use for verbs so that a designer action method item can
62
122
// be converted to a verb. Verbs use an EventHandler to call their invoke
63
123
// so we need a way to translate the EventHandler Invoke into ou own Invoke
64
- internal void Invoke ( object sender , EventArgs args )
124
+ internal void Invoke ( object ? sender , EventArgs args )
65
125
{
66
126
Invoke ( ) ;
67
127
}
0 commit comments