F
FrankYM
Hi all,
I have a general question concerning the capability of the
PropertyDescriptorCollection. It seems to be impossible to remove a
PropertyDescriptor savely using Remove or RemoveAt. I use framework
1.1. Why does the following code always crash resulting in the error
message "Source array was not long enough. Check srcIndex and length,
and the array's lower bounds.":
PropertyDescriptorCollection PDC = new
PropertyDescriptorCollection(null);
PDC.Add(new MyItemDescriptor(null, "first", ""));
PDC.Add(new MyItemDescriptor(null, "second", ""));
PDC.RemoveAt(0);
But removing the second element works this time:
PropertyDescriptorCollection PDC = new
PropertyDescriptorCollection(null);
PDC.Add(new MyItemDescriptor(null, "first", ""));
PDC.Add(new MyItemDescriptor(null, "second", ""));
PDC.RemoveAt(1);
For me it's impossible to foresee when it will fail, sometimes it's
removable sometimes not.
Thanks in advance,
Frank
I have a general question concerning the capability of the
PropertyDescriptorCollection. It seems to be impossible to remove a
PropertyDescriptor savely using Remove or RemoveAt. I use framework
1.1. Why does the following code always crash resulting in the error
message "Source array was not long enough. Check srcIndex and length,
and the array's lower bounds.":
PropertyDescriptorCollection PDC = new
PropertyDescriptorCollection(null);
PDC.Add(new MyItemDescriptor(null, "first", ""));
PDC.Add(new MyItemDescriptor(null, "second", ""));
PDC.RemoveAt(0);
But removing the second element works this time:
PropertyDescriptorCollection PDC = new
PropertyDescriptorCollection(null);
PDC.Add(new MyItemDescriptor(null, "first", ""));
PDC.Add(new MyItemDescriptor(null, "second", ""));
PDC.RemoveAt(1);
For me it's impossible to foresee when it will fail, sometimes it's
removable sometimes not.
Thanks in advance,
Frank