-
February 26th, 2007, 02:26 PM
#1
switch between two properties
Have anyone an idea how can switch between two properties (Resources.resx, Settings.settings...)
Last edited by daniel94ever; February 26th, 2007 at 02:28 PM.
-
February 26th, 2007, 02:31 PM
#2
Re: switch between two properties
Maybe you could explain in more detail what you need to achieve?
- petter
-
February 26th, 2007, 02:39 PM
#3
Re: switch between two properties
I want to build two programs with the same code but different designs.
-
February 27th, 2007, 01:10 PM
#4
Re: switch between two properties
Originally Posted by daniel94ever
I want to build two programs with the same code but different designs.
So you do not want to share any UI stuff but only the program code?
Have you considered making two separate projects which share a .cs file containing the program code?
Instead of importing a .cs file into a project, you can link to the file. If you have a file in Project1 and want to use it in Project2:
Open Project2.
In Solution Explorer, right click on Project2.
Select "Add" in the menu.
Select "Existing Item..." in the menu.
In the File Open dialog, find and select the file you want to link to.
On the "Add" button there is a little arrow. Click it, and select "Add As Link".
I use this myself to share code between projects. The upside is that you only need to change the code in one place. The downside is that you may break functionality in one of the other projects every time you change the code in one project.
-
March 1st, 2007, 02:25 AM
#5
Re: switch between two properties
Thanks Allan.
But I´m looking for a way to use differnet Resource.resx and Settings.settings.
-
March 1st, 2007, 10:12 AM
#6
Re: switch between two properties
Allan, in your way you compile the same code twice - once for each project.
You might want to consider creating a third assembly - a Class Library - and put all the common code there. The advantage is that you have a closed assembly that can be referenced by any other assembly. The downside is that you have another dll to deploy.
daniel94ever, I don't see the problem with Resources and Settings. You might want to explain it better.
-
March 1st, 2007, 02:21 PM
#7
Re: switch between two properties
Originally Posted by jhammer
You might want to consider creating a third assembly - a Class Library - and put all the common code there.
I actually first used that approach and then left it for the approach I described.
It would probably be a maintenance nightmare when done on a large scale but for my own small cross-platform project (SmartPhone+PC) where DLLs cannot be shared between platforms, it is much easier to share the source code itself.
Originally Posted by daniel94ever
Thanks Allan.
But I´m looking for a way to use differnet Resource.resx and Settings.settings.
Two projects = Two Resources.resx.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|