Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ReflectPropertyDescriptor.cs
Go to the documentation of this file.
6
8
10{
11 private static readonly object s_noValue = new object();
12
14
16
18
20
22
24
26
28
30
32
34
35 [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
36 private readonly Type _componentClass;
37
38 private readonly Type _type;
39
40 private object _defaultValue;
41
42 private object _ambientValue;
43
45
47
49
51
53
55
57
58 private readonly Type _receiverType;
59
60 private object AmbientValue
61 {
62 get
63 {
65 {
66 Attribute attribute = Attributes[typeof(AmbientValueAttribute)];
67 if (attribute != null)
68 {
69 _ambientValue = ((AmbientValueAttribute)attribute).Value;
70 }
71 else
72 {
74 }
76 }
77 return _ambientValue;
78 }
79 }
80
82 {
83 get
84 {
86 {
89 }
90 return _realChangedEvent;
91 }
92 }
93
95 {
96 get
97 {
99 {
100 if (typeof(INotifyPropertyChanged).IsAssignableFrom(ComponentType))
101 {
103 }
105 }
107 }
108 }
109
111
112 private object DefaultValue
113 {
114 get
115 {
117 {
118 Attribute attribute = Attributes[typeof(DefaultValueAttribute)];
119 if (attribute != null)
120 {
121 object value = ((DefaultValueAttribute)attribute).Value;
122 bool flag = value != null && PropertyType.IsEnum && PropertyType.GetEnumUnderlyingType() == value.GetType();
124 }
125 else
126 {
128 }
130 }
131 return _defaultValue;
132 }
133 }
134
136 {
137 get
138 {
140 {
141 if (_receiverType == null)
142 {
143 if (_propInfo == null)
144 {
145 BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.GetProperty;
147 }
148 if (_propInfo != null)
149 {
150 _getMethod = _propInfo.GetGetMethod(nonPublic: true);
151 }
152 if (_getMethod == null)
153 {
155 }
156 }
157 else
158 {
160 if (_getMethod == null)
161 {
163 }
164 }
165 _state[s_bitGetQueried] = true;
166 }
167 return _getMethod;
168 }
169 }
170
171 private bool IsExtender => _receiverType != null;
172
173 public override bool IsReadOnly
174 {
175 get
176 {
177 if (!(SetMethodValue == null))
178 {
179 return ((ReadOnlyAttribute)Attributes[typeof(ReadOnlyAttribute)]).IsReadOnly;
180 }
181 return true;
182 }
183 }
184
185 public override Type PropertyType => _type;
186
188 {
189 get
190 {
192 {
193 _resetMethod = MemberDescriptor.FindMethod(args: (!(_receiverType == null)) ? new Type[1] { _receiverType } : Type.EmptyTypes, componentClass: _componentClass, name: "Reset" + Name, returnType: typeof(void), publicOnly: false);
195 }
196 return _resetMethod;
197 }
198 }
199
201 {
202 get
203 {
205 {
206 string name = _propInfo.Name;
207 if (_setMethod == null)
208 {
209 Type baseType = _componentClass.BaseType;
210 while (baseType != null && baseType != typeof(object))
211 {
212 BindingFlags bindingAttr = BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public;
213 PropertyInfo property = baseType.GetProperty(name, bindingAttr, null, PropertyType, Type.EmptyTypes, null);
214 if (property != null)
215 {
216 _setMethod = property.GetSetMethod(nonPublic: false);
217 if (_setMethod != null)
218 {
219 break;
220 }
221 }
222 baseType = baseType.BaseType;
223 }
224 }
225 _state[s_bitSetQueried] = true;
226 }
228 {
229 if (_receiverType == null)
230 {
231 if (_propInfo == null)
232 {
233 BindingFlags bindingAttr2 = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.GetProperty;
235 }
236 if (_propInfo != null)
237 {
238 _setMethod = _propInfo.GetSetMethod(nonPublic: true);
239 }
240 }
241 else
242 {
243 _setMethod = MemberDescriptor.FindMethod(_componentClass, "Set" + Name, new Type[2] { _receiverType, _type }, typeof(void));
244 }
245 _state[s_bitSetQueried] = true;
246 }
247 return _setMethod;
248 }
249 }
250
252 {
253 get
254 {
256 {
257 _shouldSerializeMethod = MemberDescriptor.FindMethod(args: (!(_receiverType == null)) ? new Type[1] { _receiverType } : Type.EmptyTypes, componentClass: _componentClass, name: "ShouldSerialize" + Name, returnType: typeof(bool), publicOnly: false);
259 }
261 }
262 }
263
264 public override bool SupportsChangeEvents
265 {
266 get
267 {
268 if (IPropChangedEventValue == null)
269 {
270 return ChangedEventValue != null;
271 }
272 return true;
273 }
274 }
275
276 [RequiresUnreferencedCode("PropertyDescriptor's PropertyType cannot be statically discovered.")]
277 public ReflectPropertyDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentClass, string name, Type type, Attribute[] attributes)
278 : base(name, attributes)
279 {
280 try
281 {
282 if (type == null)
283 {
285 }
286 if (componentClass == null)
287 {
288 throw new ArgumentException(System.SR.Format(System.SR.InvalidNullArgument, "componentClass"));
289 }
290 _type = type;
291 _componentClass = componentClass;
292 }
293 catch (Exception)
294 {
295 throw;
296 }
297 }
298
299 [RequiresUnreferencedCode("PropertyDescriptor's PropertyType cannot be statically discovered.")]
300 public ReflectPropertyDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentClass, string name, Type type, PropertyInfo propInfo, MethodInfo getMethod, MethodInfo setMethod, Attribute[] attrs)
301 : this(componentClass, name, type, attrs)
302 {
303 _propInfo = propInfo;
304 _getMethod = getMethod;
305 _setMethod = setMethod;
306 if (getMethod != null && propInfo != null && setMethod == null)
307 {
309 }
310 else
311 {
313 }
314 }
315
316 [RequiresUnreferencedCode("PropertyDescriptor's PropertyType cannot be statically discovered.")]
317 public ReflectPropertyDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentClass, string name, Type type, Type receiverType, MethodInfo getMethod, MethodInfo setMethod, Attribute[] attrs)
318 : this(componentClass, name, type, attrs)
319 {
320 _receiverType = receiverType;
321 _getMethod = getMethod;
322 _setMethod = setMethod;
324 }
325
326 [RequiresUnreferencedCode("PropertyDescriptor's PropertyType cannot be statically discovered.")]
327 public ReflectPropertyDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentClass, PropertyDescriptor oldReflectPropertyDescriptor, Attribute[] attributes)
328 : base(oldReflectPropertyDescriptor, attributes)
329 {
330 _componentClass = componentClass;
331 _type = oldReflectPropertyDescriptor.PropertyType;
332 if (componentClass == null)
333 {
334 throw new ArgumentException(System.SR.Format(System.SR.InvalidNullArgument, "componentClass"));
335 }
336 if (!(oldReflectPropertyDescriptor is ReflectPropertyDescriptor reflectPropertyDescriptor))
337 {
338 return;
339 }
340 if (reflectPropertyDescriptor.ComponentType == componentClass)
341 {
342 _propInfo = reflectPropertyDescriptor._propInfo;
343 _getMethod = reflectPropertyDescriptor._getMethod;
344 _setMethod = reflectPropertyDescriptor._setMethod;
345 _shouldSerializeMethod = reflectPropertyDescriptor._shouldSerializeMethod;
346 _resetMethod = reflectPropertyDescriptor._resetMethod;
347 _defaultValue = reflectPropertyDescriptor._defaultValue;
348 _ambientValue = reflectPropertyDescriptor._ambientValue;
349 _state = reflectPropertyDescriptor._state;
350 }
351 if (attributes == null)
352 {
353 return;
354 }
355 foreach (Attribute attribute in attributes)
356 {
357 if (attribute is DefaultValueAttribute defaultValueAttribute)
358 {
359 _defaultValue = defaultValueAttribute.Value;
361 {
363 }
365 }
366 else if (attribute is AmbientValueAttribute ambientValueAttribute)
367 {
368 _ambientValue = ambientValueAttribute.Value;
370 }
371 }
372 }
373
374 public override void AddValueChanged(object component, EventHandler handler)
375 {
376 if (component == null)
377 {
378 throw new ArgumentNullException("component");
379 }
380 if (handler == null)
381 {
382 throw new ArgumentNullException("handler");
383 }
384 EventDescriptor changedEventValue = ChangedEventValue;
385 if (changedEventValue != null && changedEventValue.EventType.IsInstanceOfType(handler))
386 {
387 changedEventValue.AddEventHandler(component, handler);
388 return;
389 }
390 if (GetValueChangedHandler(component) == null)
391 {
393 }
394 base.AddValueChanged(component, handler);
395 }
396
397 internal bool ExtenderCanResetValue(IExtenderProvider provider, object component)
398 {
399 if (DefaultValue != s_noValue)
400 {
401 return !object.Equals(ExtenderGetValue(provider, component), _defaultValue);
402 }
403 MethodInfo resetMethodValue = ResetMethodValue;
404 if (resetMethodValue != null)
405 {
406 MethodInfo shouldSerializeMethodValue = ShouldSerializeMethodValue;
407 if (shouldSerializeMethodValue != null)
408 {
409 try
410 {
412 return (bool)shouldSerializeMethodValue.Invoke(obj, new object[1] { component });
413 }
414 catch
415 {
416 }
417 }
418 return true;
419 }
420 return false;
421 }
422
424 {
425 return _receiverType;
426 }
427
429 {
430 return PropertyType;
431 }
432
433 internal object ExtenderGetValue(IExtenderProvider provider, object component)
434 {
435 if (provider != null)
436 {
438 return GetMethodValue.Invoke(obj, new object[1] { component });
439 }
440 return null;
441 }
442
443 internal void ExtenderResetValue(IExtenderProvider provider, object component, PropertyDescriptor notifyDesc)
444 {
445 if (DefaultValue != s_noValue)
446 {
447 ExtenderSetValue(provider, component, DefaultValue, notifyDesc);
448 }
449 else if (AmbientValue != s_noValue)
450 {
451 ExtenderSetValue(provider, component, AmbientValue, notifyDesc);
452 }
453 else
454 {
455 if (!(ResetMethodValue != null))
456 {
457 return;
458 }
459 ISite site = MemberDescriptor.GetSite(component);
460 IComponentChangeService componentChangeService = null;
461 object oldValue = null;
462 if (site != null)
463 {
464 componentChangeService = (IComponentChangeService)site.GetService(typeof(IComponentChangeService));
465 }
466 if (componentChangeService != null)
467 {
468 oldValue = ExtenderGetValue(provider, component);
469 try
470 {
471 componentChangeService.OnComponentChanging(component, notifyDesc);
472 }
473 catch (CheckoutException ex)
474 {
475 if (ex == CheckoutException.Canceled)
476 {
477 return;
478 }
479 throw;
480 }
481 }
483 if (ResetMethodValue != null)
484 {
485 ResetMethodValue.Invoke(extenderProvider, new object[1] { component });
486 if (componentChangeService != null)
487 {
488 object newValue = ExtenderGetValue(extenderProvider, component);
489 componentChangeService.OnComponentChanged(component, notifyDesc, oldValue, newValue);
490 }
491 }
492 }
493 }
494
495 internal void ExtenderSetValue(IExtenderProvider provider, object component, object value, PropertyDescriptor notifyDesc)
496 {
497 if (provider == null)
498 {
499 return;
500 }
501 ISite site = MemberDescriptor.GetSite(component);
502 IComponentChangeService componentChangeService = null;
503 object oldValue = null;
504 if (site != null)
505 {
506 componentChangeService = (IComponentChangeService)site.GetService(typeof(IComponentChangeService));
507 }
508 if (componentChangeService != null)
509 {
510 oldValue = ExtenderGetValue(provider, component);
511 try
512 {
513 componentChangeService.OnComponentChanging(component, notifyDesc);
514 }
515 catch (CheckoutException ex)
516 {
517 if (ex == CheckoutException.Canceled)
518 {
519 return;
520 }
521 throw;
522 }
523 }
525 if (SetMethodValue != null)
526 {
527 SetMethodValue.Invoke(obj, new object[2] { component, value });
528 componentChangeService?.OnComponentChanged(component, notifyDesc, oldValue, value);
529 }
530 }
531
532 internal bool ExtenderShouldSerializeValue(IExtenderProvider provider, object component)
533 {
535 if (IsReadOnly)
536 {
537 if (ShouldSerializeMethodValue != null)
538 {
539 try
540 {
541 return (bool)ShouldSerializeMethodValue.Invoke(extenderProvider, new object[1] { component });
542 }
543 catch
544 {
545 }
546 }
548 }
549 if (DefaultValue == s_noValue)
550 {
551 if (ShouldSerializeMethodValue != null)
552 {
553 try
554 {
555 return (bool)ShouldSerializeMethodValue.Invoke(extenderProvider, new object[1] { component });
556 }
557 catch
558 {
559 }
560 }
561 return true;
562 }
563 return !object.Equals(DefaultValue, ExtenderGetValue(extenderProvider, component));
564 }
565
566 [DynamicDependency(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor | DynamicallyAccessedMemberTypes.PublicFields, typeof(DesignerSerializationVisibilityAttribute))]
567 [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "The DynamicDependency ensures the correct members are preserved.")]
572
573 public override bool CanResetValue(object component)
574 {
575 if (IsExtender || IsReadOnly)
576 {
577 return false;
578 }
579 if (DefaultValue != s_noValue)
580 {
581 return !object.Equals(GetValue(component), DefaultValue);
582 }
583 if (ResetMethodValue != null)
584 {
585 if (ShouldSerializeMethodValue != null)
586 {
587 component = GetInvocationTarget(_componentClass, component);
588 try
589 {
590 return (bool)ShouldSerializeMethodValue.Invoke(component, null);
591 }
592 catch
593 {
594 }
595 }
596 return true;
597 }
598 if (AmbientValue != s_noValue)
599 {
600 return ShouldSerializeValue(component);
601 }
602 return false;
603 }
604
605 [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2072:UnrecognizedReflectionPattern", Justification = "ReflectPropertyDescriptor ctors are all marked as RequiresUnreferencedCode because PropertyType can't be annotated as 'All'.")]
606 protected override void FillAttributes(IList attributes)
607 {
608 foreach (Attribute attribute2 in TypeDescriptor.GetAttributes(PropertyType))
609 {
610 attributes.Add(attribute2);
611 }
613 int num = 0;
614 while (type != null && type != typeof(object))
615 {
616 num++;
617 type = type.BaseType;
618 }
619 if (num > 0)
620 {
622 Attribute[][] array = new Attribute[num][];
623 while (type != null && type != typeof(object))
624 {
625 MemberInfo memberInfo = null;
626 BindingFlags bindingAttr = BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;
627 memberInfo = ((!IsExtender) ? ((MemberInfo)type.GetProperty(Name, bindingAttr, null, PropertyType, Type.EmptyTypes, Array.Empty<ParameterModifier>())) : ((MemberInfo)type.GetMethod("Get" + Name, bindingAttr, null, new Type[1] { _receiverType }, null)));
628 if (memberInfo != null)
629 {
631 }
632 type = type.BaseType;
633 }
634 Attribute[][] array2 = array;
635 foreach (Attribute[] array3 in array2)
636 {
637 if (array3 == null)
638 {
639 continue;
640 }
641 Attribute[] array4 = array3;
642 foreach (Attribute attribute in array4)
643 {
644 if (!(attribute is AttributeProviderAttribute attributeProviderAttribute))
645 {
646 continue;
647 }
648 Type type2 = Type.GetType(attributeProviderAttribute.TypeName);
649 if (!(type2 != null))
650 {
651 continue;
652 }
653 Attribute[] array5 = null;
654 if (!string.IsNullOrEmpty(attributeProviderAttribute.PropertyName))
655 {
656 MemberInfo[] member = type2.GetMember(attributeProviderAttribute.PropertyName);
657 if (member.Length != 0 && member[0] != null)
658 {
660 }
661 }
662 else
663 {
665 }
666 if (array5 != null)
667 {
668 Attribute[] array6 = array5;
669 foreach (Attribute value2 in array6)
670 {
671 attributes.Add(value2);
672 }
673 }
674 }
675 }
676 Attribute[][] array7 = array;
677 foreach (Attribute[] array8 in array7)
678 {
679 if (array8 != null)
680 {
681 Attribute[] array9 = array8;
682 foreach (Attribute value3 in array9)
683 {
684 attributes.Add(value3);
685 }
686 }
687 }
688 }
689 base.FillAttributes(attributes);
690 if (SetMethodValue == null)
691 {
692 attributes.Add(ReadOnlyAttribute.Yes);
693 }
694 }
695
696 public override object GetValue(object component)
697 {
698 if (IsExtender)
699 {
700 return null;
701 }
702 if (component != null)
703 {
704 component = GetInvocationTarget(_componentClass, component);
705 try
706 {
707 return GetMethodValue.Invoke(component, null);
708 }
709 catch (Exception innerException)
710 {
711 string text = null;
712 ISite site = ((component is IComponent component2) ? component2.Site : null);
713 if (site != null && site.Name != null)
714 {
715 text = site.Name;
716 }
717 if (text == null)
718 {
719 text = component.GetType().FullName;
720 }
721 if (innerException is TargetInvocationException)
722 {
723 innerException = innerException.InnerException;
724 }
725 string p = innerException.Message ?? innerException.GetType().Name;
727 }
728 }
729 return null;
730 }
731
732 internal void OnINotifyPropertyChanged(object component, PropertyChangedEventArgs e)
733 {
734 if (string.IsNullOrEmpty(e.PropertyName) || string.Compare(e.PropertyName, Name, ignoreCase: true, CultureInfo.InvariantCulture) == 0)
735 {
736 OnValueChanged(component, e);
737 }
738 }
739
740 protected override void OnValueChanged(object component, EventArgs e)
741 {
742 if (_state[s_bitChangedQueried] && _realChangedEvent == null)
743 {
744 base.OnValueChanged(component, e);
745 }
746 }
747
748 public override void RemoveValueChanged(object component, EventHandler handler)
749 {
750 if (component == null)
751 {
752 throw new ArgumentNullException("component");
753 }
754 if (handler == null)
755 {
756 throw new ArgumentNullException("handler");
757 }
758 EventDescriptor changedEventValue = ChangedEventValue;
759 if (changedEventValue != null && changedEventValue.EventType.IsInstanceOfType(handler))
760 {
761 changedEventValue.RemoveEventHandler(component, handler);
762 return;
763 }
764 base.RemoveValueChanged(component, handler);
765 if (GetValueChangedHandler(component) == null)
766 {
767 IPropChangedEventValue?.RemoveEventHandler(component, new PropertyChangedEventHandler(OnINotifyPropertyChanged));
768 }
769 }
770
771 public override void ResetValue(object component)
772 {
773 object invocationTarget = GetInvocationTarget(_componentClass, component);
774 if (DefaultValue != s_noValue)
775 {
776 SetValue(component, DefaultValue);
777 }
778 else if (AmbientValue != s_noValue)
779 {
780 SetValue(component, AmbientValue);
781 }
782 else
783 {
784 if (!(ResetMethodValue != null))
785 {
786 return;
787 }
788 ISite site = MemberDescriptor.GetSite(component);
789 IComponentChangeService componentChangeService = null;
790 object oldValue = null;
791 if (site != null)
792 {
793 componentChangeService = (IComponentChangeService)site.GetService(typeof(IComponentChangeService));
794 }
795 if (componentChangeService != null)
796 {
797 oldValue = GetMethodValue.Invoke(invocationTarget, null);
798 try
799 {
800 componentChangeService.OnComponentChanging(component, this);
801 }
802 catch (CheckoutException ex)
803 {
804 if (ex == CheckoutException.Canceled)
805 {
806 return;
807 }
808 throw;
809 }
810 }
811 if (ResetMethodValue != null)
812 {
813 ResetMethodValue.Invoke(invocationTarget, null);
814 if (componentChangeService != null)
815 {
816 object newValue = GetMethodValue.Invoke(invocationTarget, null);
817 componentChangeService.OnComponentChanged(component, this, oldValue, newValue);
818 }
819 }
820 }
821 }
822
823 public override void SetValue(object component, object value)
824 {
825 if (component == null)
826 {
827 return;
828 }
829 ISite site = MemberDescriptor.GetSite(component);
830 object obj = null;
831 object invocationTarget = GetInvocationTarget(_componentClass, component);
832 if (IsReadOnly)
833 {
834 return;
835 }
836 IComponentChangeService componentChangeService = null;
837 if (site != null)
838 {
839 componentChangeService = (IComponentChangeService)site.GetService(typeof(IComponentChangeService));
840 }
841 if (componentChangeService != null)
842 {
843 obj = GetMethodValue.Invoke(invocationTarget, null);
844 try
845 {
846 componentChangeService.OnComponentChanging(component, this);
847 }
848 catch (CheckoutException ex)
849 {
850 if (ex == CheckoutException.Canceled)
851 {
852 return;
853 }
854 throw;
855 }
856 }
857 try
858 {
859 SetMethodValue.Invoke(invocationTarget, new object[1] { value });
860 OnValueChanged(invocationTarget, EventArgs.Empty);
861 }
862 catch (Exception ex2)
863 {
864 value = obj;
865 if (ex2 is TargetInvocationException && ex2.InnerException != null)
866 {
867 throw ex2.InnerException;
868 }
869 throw;
870 }
871 finally
872 {
873 componentChangeService?.OnComponentChanged(component, this, obj, value);
874 }
875 }
876
877 public override bool ShouldSerializeValue(object component)
878 {
879 component = GetInvocationTarget(_componentClass, component);
880 if (IsReadOnly)
881 {
882 if (ShouldSerializeMethodValue != null)
883 {
884 try
885 {
886 return (bool)ShouldSerializeMethodValue.Invoke(component, null);
887 }
888 catch
889 {
890 }
891 }
892 return AttributesContainsDesignerVisibilityContent();
893 }
894 if (DefaultValue == s_noValue)
895 {
896 if (ShouldSerializeMethodValue != null)
897 {
898 try
899 {
900 return (bool)ShouldSerializeMethodValue.Invoke(component, null);
901 }
902 catch
903 {
904 }
905 }
906 return true;
907 }
908 return !object.Equals(DefaultValue, GetValue(component));
909 }
910}
static readonly CheckoutException Canceled
void RemoveEventHandler(object component, Delegate value)
void AddEventHandler(object component, Delegate value)
static ? ISite GetSite(object? component)
static ? MethodInfo FindMethod([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] Type componentClass, string name, Type[] args, Type returnType)
virtual AttributeCollection Attributes
EventHandler? GetValueChangedHandler(object component)
override? object GetInvocationTarget(Type type, object instance)
static readonly ReadOnlyAttribute Yes
void ExtenderSetValue(IExtenderProvider provider, object component, object value, PropertyDescriptor notifyDesc)
ReflectPropertyDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentClass, string name, Type type, PropertyInfo propInfo, MethodInfo getMethod, MethodInfo setMethod, Attribute[] attrs)
void OnINotifyPropertyChanged(object component, PropertyChangedEventArgs e)
void ExtenderResetValue(IExtenderProvider provider, object component, PropertyDescriptor notifyDesc)
bool ExtenderCanResetValue(IExtenderProvider provider, object component)
object ExtenderGetValue(IExtenderProvider provider, object component)
override void RemoveValueChanged(object component, EventHandler handler)
override void SetValue(object component, object value)
bool ExtenderShouldSerializeValue(IExtenderProvider provider, object component)
ReflectPropertyDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentClass, string name, Type type, Type receiverType, MethodInfo getMethod, MethodInfo setMethod, Attribute[] attrs)
override void AddValueChanged(object component, EventHandler handler)
override void OnValueChanged(object component, EventArgs e)
ReflectPropertyDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentClass, string name, Type type, Attribute[] attributes)
ReflectPropertyDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentClass, PropertyDescriptor oldReflectPropertyDescriptor, Attribute[] attributes)
static EventDescriptorCollection GetEvents([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType)
static AttributeCollection GetAttributes([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentType)
static object ToObject(Type enumType, object value)
Definition Enum.cs:874
static readonly EventArgs Empty
Definition EventArgs.cs:9
new Type GetType()
Definition Exception.cs:437
Exception? InnerException
Definition Exception.cs:104
static CultureInfo InvariantCulture
object? Invoke(object? obj, object?[]? parameters)
static string ErrorPropertyAccessorException
Definition SR.cs:124
static string ErrorMissingPropertyAccessors
Definition SR.cs:34
static string InvalidNullArgument
Definition SR.cs:86
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string ErrorInvalidPropertyType
Definition SR.cs:30
Definition SR.cs:7
static ? Type GetType(string typeName, bool throwOnError, bool ignoreCase)
Definition Type.cs:408
PropertyInfo? GetProperty(string name)
Definition Type.cs:815
virtual bool IsEnum
Definition Type.cs:227
virtual bool IsInstanceOfType([NotNullWhen(true)] object? o)
Definition Type.cs:1020
virtual Type GetEnumUnderlyingType()
Definition Type.cs:1035
Type? BaseType
Definition Type.cs:295
string? FullName
Definition Type.cs:47
static readonly Type[] EmptyTypes
Definition Type.cs:19
MemberInfo[] GetMember(string name)
Definition Type.cs:625
void OnComponentChanged(object component, MemberDescriptor? member, object? oldValue, object? newValue)
void OnComponentChanging(object component, MemberDescriptor? member)
object? GetService(Type serviceType)
delegate void PropertyChangedEventHandler(object? sender, PropertyChangedEventArgs e)