|
4 | 4 |
|
5 | 5 | using System.ComponentModel; |
6 | 6 | using System.ComponentModel.Design.Serialization; |
7 | | -using System.Collections; |
8 | 7 | using System.Globalization; |
9 | 8 | using System.Reflection; |
10 | 9 | using System.Windows.Media; // TypeConverterHelper, UriHolder |
@@ -53,35 +52,29 @@ public override bool CanConvertTo(ITypeDescriptorContext context, Type destinati |
53 | 52 | return false; |
54 | 53 | } |
55 | 54 |
|
56 | | - /// <summary> |
57 | | - /// Gets the public/static properties of the Cursors class |
58 | | - /// </summary> |
59 | | - /// <returns>PropertyInfo array of the objects properties</returns> |
60 | | - private PropertyInfo[] GetProperties() |
61 | | - { |
62 | | - return typeof(Cursors).GetProperties(BindingFlags.Public | BindingFlags.Static); |
63 | | - } |
64 | | - |
65 | 55 | /// <summary> |
66 | 56 | /// StandardValuesCollection method override |
67 | 57 | /// </summary> |
68 | 58 | /// <param name="context">ITypeDescriptorContext</param> |
69 | 59 | /// <returns>TypeConverter.StandardValuesCollection</returns> |
70 | 60 | public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) |
71 | 61 | { |
72 | | - if(this._standardValues == null) |
| 62 | + if(_standardValues is null) |
73 | 63 | { |
74 | | - ArrayList list1 = new ArrayList(); |
75 | | - PropertyInfo[] infoArray1 = this.GetProperties(); |
76 | | - for(int num1 = 0; num1 < infoArray1.Length; num1++) |
| 64 | + PropertyInfo[] properties = typeof(Cursors).GetProperties(BindingFlags.Public | BindingFlags.Static); |
| 65 | + object[] values = new object[properties.Length]; //Could use Cursor but its wrapped in ICollection anyways |
| 66 | + |
| 67 | + for (int i = 0; i < properties.Length; i++) |
77 | 68 | { |
78 | | - PropertyInfo info1 = infoArray1[num1]; |
79 | | - object[] objArray1 = null; |
80 | | - list1.Add(info1.GetValue(null, objArray1)); |
| 69 | + PropertyInfo info = properties[i]; |
| 70 | + |
| 71 | + values[i] = info.GetValue(null, null); |
81 | 72 | } |
82 | | - this._standardValues = new TypeConverter.StandardValuesCollection(list1.ToArray()); |
| 73 | + |
| 74 | + _standardValues = new TypeConverter.StandardValuesCollection(values); |
83 | 75 | } |
84 | | - return this._standardValues; |
| 76 | + |
| 77 | + return _standardValues; |
85 | 78 | } |
86 | 79 |
|
87 | 80 | /// <summary> |
|
0 commit comments