i dont really think you can do that, basically what your saying is, have two
people edit a single file at the same time... just like anything else,
databases, file systems, etc etc you can only have one process (person,
thread, how ever you want to look at it) edit the file at once... typically
how things are done for group development is one guy builds the interface
and another guy builds a class... or something like that.. basically each
guy is working on a different file..
but bottom line is, two people cant edit the same file at once, someone will
always lose data...
Justin
> Hi,
> I'm asking how two developers can work at the same time on a Windows
[quoted text clipped - 6 lines]
>
> Thanks!
naromi - 06 Oct 2007 12:08 GMT
Hi Justin,
thanks for your reply.
Using a version control system (as CVS, SVN, ...) you can actually
edit the same file at the same time, the system will check for update
and if possible it will merge the 2 different versions. The problem
here is that the designer auto-generated code is most of the time
rewritten after any change, and any component is put there in a random
order, making the merge not so easy.
Could there be a way to split the auto-generated code in more than one
file? Or just to move some initializations away from the Designer.cs
file?
Thanks!
Davide
James Crosswell - 08 Oct 2007 19:18 GMT
> Hi Justin,
> thanks for your reply.
[quoted text clipped - 9 lines]
> file? Or just to move some initializations away from the Designer.cs
> file?
The Designer.cs file is just a partial class and you could split this
into multiple files using the same principle... but your designer is
only ever going to be putting it's changes into one of these. So the
answer, in short, is no you can't do what you want to.
The only solution available to you is to merge the changes when designer
number 2 checks his changes into the VCS. In a few situations these
changes might be incompatible (if both designers were modifying
properties/events of the same components) but generally speaking a
descent file compare tool should let you merge changes without any
problem (although not without a considerable amount of effort in the
case of the Designer.cs file). If the compare tool you're using at the
moment sux I could recommend CompareIt! (which I've been using for years
- very slick).
I would have to say that what you're trying to do is basically not a
good idea though. If you have multiple developers working on different
aspects of the same interface, you should try to split the interface
into components and have each developer build only the component(s) that
he/she is responsible for. If that's still not enough flexibility for
you then you could go for a plugin based approach/framework - which
gives you the advantage of a formal contract that you can define to
specify the interaction between one developer's components/plugins and
another's.
Best Regards,
James Crosswell
Microforge.net LLC
http://www.microforge.net