468,765 Members | 809 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,765 developers. It's quick & easy.

Alphabetically ordering classes in large cs file

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?
Jun 27 '08 #1
1 1307
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
Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

17 posts views Thread by Phil Powell | last post: by
5 posts views Thread by Hal Vaughan | last post: by
4 posts views Thread by Anon Email | last post: by
2 posts views Thread by Si | last post: by
10 posts views Thread by Ben Taylor | last post: by
13 posts views Thread by Simon Dean | last post: by
1 post views Thread by CARIGAR | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.