View Single Post
Old 09-04-2008   #3 (permalink)
Jeff Gaines


 
 

Re: Adding Files/Links To Projects

On 04/09/2008 in message <#dDIETlDJHA.1184@xxxxxx> Pavel
Minaev wrote:
Quote:

>"Jeff Gaines" <whitedragon@xxxxxx> wrote in message
>news:xn0fuqrla1uvibc004@xxxxxx
Quote:

>>I appreciate that I could compile them into a class library but each time
>>they are used I come across another property/function that I need and it
>>is much easier to change the source from a project and re-compile than to
>>have to open and re-compile half a dozen class libraries.
>
>You need to think about organization of your modules before you write
>them. An ad-hoc approach where you just slap the class where it's easier
>(for now), and assembly partitions are arbitrary, doesn't scale.
Each class/control sits in its own directory and uses my standardised
directory/namespace/class naming for consistency.

Quote:

>Also, why "open and re-compile"? Create a multi-project solution, set up
>dependencies between projects within it (make sure you're adding project
>dependencies, not file dependencies - the latter is when you just pick the
>.dll in Browse), and just kick off builds with Ctrl+Shift+B. Visual Studio
>(or, more precisely, MSBuild) will take care of dependency resolution, and
>will rebuild only the stuff that needs rebuilding.
That could work, each class has its own project so I would just need to
add those projects to the new project, and ensure the dependencies are
clear. I will look at that.

Quote:
Quote:

>>What do other people do about this? I was very disappointed not to find a
>>#include directive in C#.
>
>This is the first time I've actually seen someone nostalgic for #include.
>Given that people are pushing to phase it out in C++ now (hopefully by the
>next TR after C++0x), it's a strange sentiment.
>
>Anyway, you don't need #include in C#, because it doesn't have the concept
>of headers.
I was thinking more of a 21st century #include pragma. If I have, say, a
ListViewEx class with a dozen or so related classes it would be good to
#include those classes in the main class file. Then it would only be
necessary to link to the main class file when using it in another project.

Quote:
Quote:

>>Is there a way I can structure things so that I can link to all files in a
>> directory for instance, rather than to each individual file in the directory?
>
>No, but why not just make an assembly out of all those files in a
>directory, and then link to that?
I could add a reference to the class file dll but would then probably need
one instance of VS running for each class project to alter/update on the
hoof so to speak. Probably adding the original projects is easier.

Thanks for the input :-)

--
Jeff Gaines Damerham Hampshire UK
I can please only one person per day. Today is not your day.
Tomorrow, isn't looking good either.
My System SpecsSystem Spec