Alphabetically ordering classes in large cs file

N

ndawson

Hi all

I use the XSD utility provided with visual studio 2008 to convert xsd
files into a c# project file, we then call this DLL from an
application written in Delphi to provide read/write capability. To
fully get this working we need to manually modify the .cs file that is
generated adding in interface definitions so this managed dll can be
seen by COM.

This works fine until the xsd files are updated.Changes of about 5% of
the xsd files result in totally different cs files being created,
trying to perform a file comparison on current and previous versions
of the generated .cs file is near impossible even though only small
parts of the xsd files have changed. This leaves me with the job of
having to manually go though the new CS file and include all of the
interfaces that were previoulsy there.

I was thinking that there might be a utility which could process a .cs
file and reorder the classes definied within alphabetically thereby
allowing me to see the actual changes more clearly.

Perhaps someone out there could point me in the right direction or
give me an alternative solution to my problem?
 
M

Marc Gravell

I wonder if you couldn't do this better using partial classes? i.e.
leave the tool-generated file alone, and create a *separate* .cs file
for your additions. You can add attributes, interface implememntations,
and members (fields, properties, methods etc) to the classes this way.
The only thing you can't do cleanly is add attributes to individual
methods declared in the generated .cs file.

Marc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top