471,117 Members | 1,180 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,117 software developers and data experts.

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 1361
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.

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

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.