Refactor Help (ArrayList and Hashtables to Generics equivalents)

In a solution I recently converted from 1.1 to 2.0, I've got over 1000
ArrayList's I'd like to refactor to generics List objects, and nearly the same number of Hashtable's I'd like to refactor to Dictionary Objects. It's taking me a LONG time to do what I think resharper could do in seconds. (find each instance of ArrayList, look at the first object added to it, and use that object type for the T in List]]>, and change the signature to it,
with all the calls matching, etc.) Repeat for the Hashtable conversion.

Can anyone give me a hand getting started using the API to accomplish this
task? I don't even know where to begin, given the very scant examples.

Thanks








1 comment
Comment actions Permalink

I cannot give you a hand on the API, but I would like to warn you that the
Item property of a Dictionary trows a KeyNotFoundException where a Hashtable
simply returns null. So, automatically converting will be hard, though
TryGetValue might bring you some relief in this.

Success,
Erwin


"ERobishaw" <ERobishaw@Getintheword.com> schreef in bericht
news:eh03tr$822$1@is.intellij.net...

In a solution I recently converted from 1.1 to 2.0, I've got over 1000
ArrayList's I'd like to refactor to generics List<T> objects, and nearly
the same number of Hashtable's I'd like to refactor to Dictionary <K,V>
Objects.

>

It's taking me a LONG time to do what I think resharper could do in
seconds. (find each instance of ArrayList, look at the first object added
to it, and use that object type for the T in List<T>, and change the
signature to it, with all the calls matching, etc.) Repeat for the
Hashtable conversion.

>

Can anyone give me a hand getting started using the API to accomplish this
task? I don't even know where to begin, given the very scant examples.

>

Thanks

>
>
>
>
>
>
>



0

Please sign in to leave a comment.