Hello,
I am working with a class with a basetype of NameObjectCollection,
which has as a member an object array
public object[] Objects {get {return BaseGetAllValues();}}
which I want to sort before using....
I know I can do do a rough quivalent by feeding that into a new
ArrayList and then sorting the array list and using it, but is there a
better way?
I couldn't find one, but perhaps someone could suggest one?
I tried to just give the individual object class an implementation of
IComparable, but that didn't work...the CompareTo method gets called
(as of course it does when using the ArrayList, so it wsan't a waste
of time), but the result doesn't get sorted. I can't even do it by
hand assigning the values.
NameObjectCollectionBase allv = myClass.Objects;
allv[0] = allv[1];
doesn't change allv[0], it doesn't throw an exception, but it doesn't
do anything, if I pass them to a method as ref parameters I get "a ref
or out argument must be an assignable variable" exception.
So, any suggestions or am I stuck doing the new
ArrayList(myclass.Objects); Or is that really the best way of doing
it?
--
J.Moreno