1 type derived from EventDescriptor
System.ComponentModel.TypeConverter (1)
System\ComponentModel\ReflectEventDescriptor.cs (1)
60
internal sealed class ReflectEventDescriptor :
EventDescriptor
215 references to EventDescriptor
netstandard (1)
netstandard.cs (1)
315
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.ComponentModel.
EventDescriptor
))]
System (1)
src\libraries\shims\System\ref\System.cs (1)
301
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.ComponentModel.
EventDescriptor
))]
System.ComponentModel.TypeConverter (95)
System\ComponentModel\CustomTypeDescriptor.cs (2)
117
[RequiresUnreferencedCode(
EventDescriptor
.RequiresUnreferencedCodeMessage)]
118
public virtual
EventDescriptor
? GetDefaultEvent() => _parent?.GetDefaultEvent();
System\ComponentModel\Design\IEventPropertyService.cs (6)
9
/// Provides a set of useful methods for binding <see cref='System.ComponentModel.
EventDescriptor
'/> objects to user code.
18
string CreateUniqueMethodName(IComponent component,
EventDescriptor
e);
24
ICollection GetCompatibleMethods(
EventDescriptor
e);
30
EventDescriptor
? GetEvent(PropertyDescriptor property);
40
PropertyDescriptor GetEventProperty(
EventDescriptor
e);
58
bool ShowCode(IComponent component,
EventDescriptor
e);
System\ComponentModel\EventDescriptor.cs (3)
14
/// Initializes a new instance of the <see cref='System.ComponentModel.
EventDescriptor
'/> class with the
22
/// Initializes a new instance of the <see cref='System.ComponentModel.
EventDescriptor
'/> class with the name and attributes in
30
/// Initializes a new instance of the <see cref='System.ComponentModel.
EventDescriptor
'/> class with
System\ComponentModel\EventDescriptorCollection.cs (28)
16
private
EventDescriptor
?[] _events;
31
public EventDescriptorCollection(
EventDescriptor
[]? events)
35
_events = Array.Empty<
EventDescriptor
>();
49
public EventDescriptorCollection(
EventDescriptor
[]? events, bool readOnly) : this(events)
54
private EventDescriptorCollection(
EventDescriptor
?[] events, int eventCount, string[]? namedSort, IComparer? comparer)
75
public virtual
EventDescriptor
? this[int index]
91
public virtual
EventDescriptor
? this[string name] => Find(name, false);
93
public int Add(
EventDescriptor
? value)
115
public bool Contains(
EventDescriptor
? value) => IndexOf(value) >= 0;
130
EventDescriptor
[] newEvents = new
EventDescriptor
[Count];
153
_events = new
EventDescriptor
[sizeNeeded];
160
EventDescriptor
[] newEvents = new
EventDescriptor
[newSize];
169
public virtual
EventDescriptor
? Find(string name, bool ignoreCase)
171
EventDescriptor
? p = null;
199
public int IndexOf(
EventDescriptor
? value) => Array.IndexOf(_events, value, 0, Count);
201
public void Insert(int index,
EventDescriptor
? value)
217
public void Remove(
EventDescriptor
? value)
314
List<
EventDescriptor
?> eventList = new List<
EventDescriptor
?>(_events);
322
EventDescriptor
? currentEvent = eventList[j];
391
_events[index] = (
EventDescriptor
?)value;
395
int IList.Add(object? value) => Add((
EventDescriptor
?)value);
397
bool IList.Contains(object? value) => Contains((
EventDescriptor
?)value);
401
int IList.IndexOf(object? value) => IndexOf((
EventDescriptor
?)value);
403
void IList.Insert(int index, object? value) => Insert(index, (
EventDescriptor
?)value);
405
void IList.Remove(object? value) => Remove((
EventDescriptor
?)value);
System\ComponentModel\IComNativeDescriptorHandler.cs (1)
18
EventDescriptor
GetDefaultEvent(object component);
System\ComponentModel\ICustomTypeDescriptor.cs (2)
38
[RequiresUnreferencedCode(
EventDescriptor
.RequiresUnreferencedCodeMessage)]
39
EventDescriptor
? GetDefaultEvent();
System\ComponentModel\ReflectEventDescriptor.cs (1)
115
EventDescriptor
oldReflectEventDescriptor,
System\ComponentModel\ReflectPropertyDescriptor.cs (8)
74
private
EventDescriptor
? _realChangedEvent; // <propertyname>Changed event handler on object
75
private
EventDescriptor
? _realIPropChangedEvent; // INotifyPropertyChanged.PropertyChanged event handler on object
248
private
EventDescriptor
ChangedEventValue
265
private
EventDescriptor
IPropChangedEventValue
505
EventDescriptor
changedEvent = ChangedEventValue;
518
EventDescriptor
iPropChangedEvent = IPropChangedEventValue;
982
EventDescriptor
changedEvent = ChangedEventValue;
998
EventDescriptor
iPropChangedEvent = IPropChangedEventValue;
System\ComponentModel\ReflectTypeDescriptionProvider.cs (10)
388
internal
EventDescriptor
? GetDefaultEvent([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, object? instance)
517
internal static
EventDescriptor
? GetExtendedDefaultEvent()
1153
private static
EventDescriptor
[] ReflectGetEvents(Type type)
1156
EventDescriptor
[]? events = (
EventDescriptor
[]?)eventCache[type];
1164
events = (
EventDescriptor
[]?)eventCache[type];
1177
events = new
EventDescriptor
[eventInfos.Length];
1201
EventDescriptor
[] newEvents = new
EventDescriptor
[eventCount];
1207
foreach (
EventDescriptor
dbgEvent in events)
System\ComponentModel\ReflectTypeDescriptionProvider.ReflectedTypeData.cs (6)
249
internal
EventDescriptor
? GetDefaultEvent(object? instance)
443
EventDescriptor
[] eventArray;
444
Dictionary<string,
EventDescriptor
> eventList = new Dictionary<string,
EventDescriptor
>(16);
451
foreach (
EventDescriptor
ed in eventArray)
459
eventArray = new
EventDescriptor
[eventList.Count];
System\ComponentModel\TypeDescriptor.cs (28)
451
public static
EventDescriptor
CreateEvent(
464
public static
EventDescriptor
CreateEvent(
466
EventDescriptor
oldEventDescriptor,
892
[RequiresUnreferencedCode(
EventDescriptor
.RequiresUnreferencedCodeMessage)]
893
public static
EventDescriptor
? GetDefaultEvent(
908
[RequiresUnreferencedCode(
EventDescriptor
.RequiresUnreferencedCodeMessage + " The Type of component cannot be statically discovered.")]
909
public static
EventDescriptor
? GetDefaultEvent(object component) => GetDefaultEvent(component, false);
915
[RequiresUnreferencedCode(
EventDescriptor
.RequiresUnreferencedCodeMessage + " The Type of component cannot be statically discovered.")]
916
public static
EventDescriptor
? GetDefaultEvent(object component, bool noCustomTypeDesc)
1134
var descriptors = new
EventDescriptor
[filteredEvents.Count];
1253
EventDescriptor
[] eventArray = new
EventDescriptor
[results.Count];
1923
EventDescriptor
[] eventArray = new
EventDescriptor
[list.Count];
2114
EventDescriptor
[] eventArray = new
EventDescriptor
[list.Count];
2121
throw new ArgumentException(SR.Format(SR.TypeDescriptorExpectedElementType, typeof(
EventDescriptor
).FullName));
2262
EventDescriptor
[] eventArray = new
EventDescriptor
[list.Count];
2824
[RequiresUnreferencedCode(
EventDescriptor
.RequiresUnreferencedCodeMessage)]
2825
EventDescriptor
ICustomTypeDescriptor.GetDefaultEvent()
3132
[RequiresUnreferencedCode(
EventDescriptor
.RequiresUnreferencedCodeMessage)]
3133
EventDescriptor
? ICustomTypeDescriptor.GetDefaultEvent()
3543
[RequiresUnreferencedCode(
EventDescriptor
.RequiresUnreferencedCodeMessage)]
3544
EventDescriptor
? ICustomTypeDescriptor.GetDefaultEvent()
3926
[RequiresUnreferencedCode(
EventDescriptor
.RequiresUnreferencedCodeMessage)]
3927
public
EventDescriptor
? GetDefaultEvent()
3933
EventDescriptor
? defaultEvent;
System.Data.Common (5)
System\Data\Common\DataRecordInternal.cs (1)
327
EventDescriptor
? ICustomTypeDescriptor.GetDefaultEvent()
System\Data\Common\DbConnectionStringBuilder.cs (1)
637
EventDescriptor
? ICustomTypeDescriptor.GetDefaultEvent()
System\Data\Common\DbDataRecord.cs (1)
83
EventDescriptor
? ICustomTypeDescriptor.GetDefaultEvent() => null;
System\Data\DataRowView.cs (1)
240
EventDescriptor
? ICustomTypeDescriptor.GetDefaultEvent() => null;
System\Data\DataViewManagerListItemTypeDescriptor.cs (1)
58
EventDescriptor
? ICustomTypeDescriptor.GetDefaultEvent() => null;
System.Windows.Forms (10)
System\Windows\Forms\ActiveX\AxHost.cs (1)
2472
EventDescriptor
? ICustomTypeDescriptor.GetDefaultEvent()
System\Windows\Forms\ComponentModel\COM2Interop\ComNativeDescriptor.ComTypeDescriptor.cs (1)
41
EventDescriptor
? ICustomTypeDescriptor.GetDefaultEvent() => null;
System\Windows\Forms\ComponentModel\COM2Interop\ComNativeDescriptor.NullTypeDescriptor.cs (1)
24
EventDescriptor
? ICustomTypeDescriptor.GetDefaultEvent() => null;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\MultiPropertyDescriptorGridEntry.cs (1)
317
EventDescriptor
? eventDescriptor = _eventBindings.GetEvent(mergeDescriptor[0]);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyDescriptorGridEntry.cs (3)
34
private static
EventDescriptor
? s_targetEventdesc;
618
EventDescriptor
? eventDescriptor = null;
779
EventDescriptor
? eventDescriptor,
System\Windows\Forms\DataBinding\Binding.cs (2)
30
private
EventDescriptor
? _validateInfo;
545
EventDescriptor
? tempValidateInfo = null;
System\Windows\Forms\Design\EventsTab.cs (1)
42
return TypeDescriptor.GetDefaultEvent(obj) is
EventDescriptor
defaultEvent
System.Windows.Forms.Design (35)
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (1)
1253
EventDescriptor
? ICustomTypeDescriptor.GetDefaultEvent() => null;
System\ComponentModel\Design\ComponentDesigner.cs (5)
257
EventDescriptor
? thisDefaultEvent = null;
271
EventDescriptor
? defaultEvent = TypeDescriptor.GetDefaultEvent(comp);
633
EventDescriptor
?[] values = new
EventDescriptor
[events.Values.Count];
636
foreach (
EventDescriptor
? evt in values)
System\ComponentModel\Design\EventBindingService.cs (12)
18
private
EventDescriptor
? _showCodeEventDescriptor;
36
protected abstract string CreateUniqueMethodName(IComponent component,
EventDescriptor
e);
45
protected virtual void FreeMethod(IComponent component,
EventDescriptor
e, string methodName)
55
protected abstract ICollection GetCompatibleMethods(
EventDescriptor
e);
82
protected abstract bool ShowCode(IComponent component,
EventDescriptor
e, string methodName);
91
protected virtual void UseMethod(IComponent component,
EventDescriptor
e, string methodName)
108
string IEventBindingService.CreateUniqueMethodName(IComponent component,
EventDescriptor
e)
120
ICollection IEventBindingService.GetCompatibleMethods(
EventDescriptor
e)
131
EventDescriptor
? IEventBindingService.GetEvent(PropertyDescriptor property)
139
private static bool HasGenericArgument([NotNullWhen(true)]
EventDescriptor
? ed)
197
PropertyDescriptor IEventBindingService.GetEventProperty(
EventDescriptor
e)
228
bool IEventBindingService.ShowCode(IComponent component,
EventDescriptor
e)
System\ComponentModel\Design\EventBindingService.EventPropertyDescriptor.cs (4)
27
internal EventPropertyDescriptor(
EventDescriptor
eventDesc, EventBindingService eventSvc) : base(eventDesc, null)
60
internal
EventDescriptor
Event { get; }
284
private readonly
EventDescriptor
_evt;
289
internal EventConverter(
EventDescriptor
evt)
System\ComponentModel\Design\Serialization\CodeDomSerializationProvider.cs (1)
111
if (typeof(
EventDescriptor
).IsAssignableFrom(objectType))
System\ComponentModel\Design\Serialization\CodeDomSerializer.cs (1)
248
else if (member is
EventDescriptor
evt)
System\ComponentModel\Design\Serialization\CodeDomSerializerBase.cs (4)
495
EventDescriptor
? evt = GetEventsHelper(manager, targetObject, null)[statement.Event.EventName];
1228
EventDescriptor
? evt = GetEventsHelper(manager, targetObject, null)[eventName];
2100
protected void SerializeEvent(IDesignerSerializationManager manager, CodeStatementCollection statements, object value,
EventDescriptor
descriptor)
2133
foreach (
EventDescriptor
evt in events)
System\ComponentModel\Design\Serialization\EventMemberCodeDomSerializer.cs (1)
28
if (descriptor is not
EventDescriptor
eventToSerialize)
System\Windows\Forms\Design\ComponentTray.cs (1)
2470
EventDescriptor
defaultEvent = TypeDescriptor.GetDefaultEvent(component);
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (1)
1251
EventDescriptor
? ICustomTypeDescriptor.GetDefaultEvent() => TypeDescriptor.GetDefaultEvent(DataGridViewColumn);
System\Windows\Forms\Design\ToolStripContentPanelDesigner.cs (2)
72
EventDescriptor
? eventDescriptor;
92
eventDescriptor = (
EventDescriptor
?)events[noBrowseEvents[i]];
System\Windows\Forms\Design\ToolStripPanelDesigner.cs (2)
519
EventDescriptor
? eventDescriptor = (
EventDescriptor
?)events[noBrowseEvents[i]];
System.Windows.Forms.Design.Tests (62)
System\ComponentModel\Design\ComponentDesignerTests.cs (62)
778
.Setup(s => s.GetEventProperty(It.IsAny<
EventDescriptor
>()))
782
.Setup(s => s.CreateUniqueMethodName(component3, It.IsAny<
EventDescriptor
>()))
786
.Setup(s => s.GetCompatibleMethods(It.IsAny<
EventDescriptor
>()))
843
mockEventBindingService.Verify(s => s.GetEventProperty(It.IsAny<
EventDescriptor
>()), Times.Exactly(3));
845
mockEventBindingService.Verify(s => s.CreateUniqueMethodName(component3, It.IsAny<
EventDescriptor
>()), Times.Once());
846
mockEventBindingService.Verify(s => s.GetCompatibleMethods(It.IsAny<
EventDescriptor
>()), Times.Exactly(2));
864
mockEventBindingService.Verify(s => s.GetEventProperty(It.IsAny<
EventDescriptor
>()), Times.Exactly(6));
866
mockEventBindingService.Verify(s => s.CreateUniqueMethodName(component3, It.IsAny<
EventDescriptor
>()), Times.Exactly(2));
867
mockEventBindingService.Verify(s => s.GetCompatibleMethods(It.IsAny<
EventDescriptor
>()), Times.Exactly(4));
891
.Setup(s => s.GetEventProperty(It.IsAny<
EventDescriptor
>()))
895
.Setup(s => s.GetCompatibleMethods(It.IsAny<
EventDescriptor
>()))
898
.Setup(s => s.CreateUniqueMethodName(component, It.IsAny<
EventDescriptor
>()))
901
.Setup(s => s.ShowCode(component, It.IsAny<
EventDescriptor
>()))
958
mockEventBindingService.Verify(s => s.GetEventProperty(It.IsAny<
EventDescriptor
>()), Times.Once());
960
mockEventBindingService.Verify(s => s.ShowCode(component, It.IsAny<
EventDescriptor
>()), Times.Exactly(expectedCallCount));
971
mockEventBindingService.Verify(s => s.GetEventProperty(It.IsAny<
EventDescriptor
>()), Times.Exactly(2));
973
mockEventBindingService.Verify(s => s.ShowCode(component, It.IsAny<
EventDescriptor
>()), Times.Exactly(expectedCallCount * 2));
1002
.Setup(s => s.GetEventProperty(It.IsAny<
EventDescriptor
>()))
1006
.Setup(s => s.CreateUniqueMethodName(component3, It.IsAny<
EventDescriptor
>()))
1010
.Setup(s => s.GetCompatibleMethods(It.IsAny<
EventDescriptor
>()))
1071
mockEventBindingService.Verify(s => s.GetEventProperty(It.IsAny<
EventDescriptor
>()), Times.Exactly(3));
1073
mockEventBindingService.Verify(s => s.CreateUniqueMethodName(component3, It.IsAny<
EventDescriptor
>()), Times.Once());
1074
mockEventBindingService.Verify(s => s.GetCompatibleMethods(It.IsAny<
EventDescriptor
>()), Times.Exactly(2));
1095
mockEventBindingService.Verify(s => s.GetEventProperty(It.IsAny<
EventDescriptor
>()), Times.Exactly(6));
1097
mockEventBindingService.Verify(s => s.CreateUniqueMethodName(component3, It.IsAny<
EventDescriptor
>()), Times.Exactly(2));
1098
mockEventBindingService.Verify(s => s.GetCompatibleMethods(It.IsAny<
EventDescriptor
>()), Times.Exactly(4));
1118
.Setup(s => s.GetEventProperty(It.IsAny<
EventDescriptor
>()))
1177
mockEventBindingService.Verify(s => s.GetEventProperty(It.IsAny<
EventDescriptor
>()), Times.Once());
1188
mockEventBindingService.Verify(s => s.GetEventProperty(It.IsAny<
EventDescriptor
>()), Times.Exactly(2));
1211
.Setup(s => s.GetEventProperty(It.IsAny<
EventDescriptor
>()))
1270
mockEventBindingService.Verify(s => s.GetEventProperty(It.IsAny<
EventDescriptor
>()), Times.Once());
1281
mockEventBindingService.Verify(s => s.GetEventProperty(It.IsAny<
EventDescriptor
>()), Times.Exactly(2));
1302
.Setup(s => s.GetEventProperty(It.IsAny<
EventDescriptor
>()))
1360
mockEventBindingService.Verify(s => s.GetEventProperty(It.IsAny<
EventDescriptor
>()), Times.Once());
1371
mockEventBindingService.Verify(s => s.GetEventProperty(It.IsAny<
EventDescriptor
>()), Times.Exactly(2));
1392
.Setup(s => s.GetEventProperty(It.IsAny<
EventDescriptor
>()))
1396
.Setup(s => s.GetCompatibleMethods(It.IsAny<
EventDescriptor
>()))
1455
mockEventBindingService.Verify(s => s.GetEventProperty(It.IsAny<
EventDescriptor
>()), Times.Once());
1456
mockEventBindingService.Verify(s => s.GetCompatibleMethods(It.IsAny<
EventDescriptor
>()), Times.Once());
1468
mockEventBindingService.Verify(s => s.GetEventProperty(It.IsAny<
EventDescriptor
>()), Times.Exactly(2));
1469
mockEventBindingService.Verify(s => s.GetCompatibleMethods(It.IsAny<
EventDescriptor
>()), Times.Exactly(2));
1499
.Setup(s => s.GetEventProperty(It.IsAny<
EventDescriptor
>()))
1503
.Setup(s => s.GetCompatibleMethods(It.IsAny<
EventDescriptor
>()))
1562
mockEventBindingService.Verify(s => s.GetEventProperty(It.IsAny<
EventDescriptor
>()), Times.Once());
1563
mockEventBindingService.Verify(s => s.GetCompatibleMethods(It.IsAny<
EventDescriptor
>()), Times.Once());
1575
mockEventBindingService.Verify(s => s.GetEventProperty(It.IsAny<
EventDescriptor
>()), Times.Exactly(2));
1576
mockEventBindingService.Verify(s => s.GetCompatibleMethods(It.IsAny<
EventDescriptor
>()), Times.Exactly(2));
1601
.Setup(s => s.GetEventProperty(It.IsAny<
EventDescriptor
>()))
1659
mockEventBindingService.Verify(s => s.GetEventProperty(It.IsAny<
EventDescriptor
>()), Times.Once());
1669
mockEventBindingService.Verify(s => s.GetEventProperty(It.IsAny<
EventDescriptor
>()), Times.Exactly(2));
1882
.Setup(s => s.GetEventProperty(It.IsAny<
EventDescriptor
>()))
1886
.Setup(s => s.GetCompatibleMethods(It.IsAny<
EventDescriptor
>()))
1931
mockEventBindingService.Verify(s => s.GetEventProperty(It.IsAny<
EventDescriptor
>()), Times.Once());
1932
mockEventBindingService.Verify(s => s.GetCompatibleMethods(It.IsAny<
EventDescriptor
>()), Times.Once());
1943
mockEventBindingService.Verify(s => s.GetEventProperty(It.IsAny<
EventDescriptor
>()), Times.Exactly(2));
1944
mockEventBindingService.Verify(s => s.GetCompatibleMethods(It.IsAny<
EventDescriptor
>()), Times.Exactly(2));
2433
EventDescriptor
descriptor = TypeDescriptor.GetEvents(typeof(CustomComponent))[0];
2439
EventDescriptor
result = Assert.IsAssignableFrom<
EventDescriptor
>(events["Event"]);
2872
EventDescriptor
descriptor = TypeDescriptor.GetEvents(typeof(CustomComponent))[0];
2879
EventDescriptor
result = Assert.IsAssignableFrom<
EventDescriptor
>(events["Event"]);
System.Windows.Forms.Tests (6)
System\Windows\Forms\AxHostTests.cs (2)
2495
EventDescriptor
eventDescriptor = customTypeDescriptor.GetDefaultEvent();
2518
EventDescriptor
eventDescriptor = customTypeDescriptor.GetDefaultEvent();
System\Windows\Forms\AxSystemMonitorTests.cs (1)
51
foreach (
EventDescriptor
singleEvent in events)
System\Windows\Forms\AxWebBrowserTests.cs (1)
46
.Cast<
EventDescriptor
>()
System\Windows\Forms\ComponentModel\Com2Interop\COM2FontConverterTests.cs (1)
122
public
EventDescriptor
? GetDefaultEvent() => throw new NotImplementedException();
System\Windows\Forms\ListBindingHelperTests.cs (1)
822
public
EventDescriptor
GetDefaultEvent()