Can i do the following ? I would like to set the $(ProjectName) as soon as the file is first loaded. It is a class that wont change.
Reason is because i need to create multiple of these but each will have a different name as the project. lets says the project was called Project1 then I would hvae to add the using for that via ctrl +. if it was Project2 the same etc .
This comes off a template that I have created and every time i need to create a project i just use the template , but i couldnt find a way to set the using as the same name I give the project when creaating
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
Member
280 Points
1000 Posts
How can i dynamically assign a value in the using of a cs file ?
Jul 03, 2014 03:46 AM|robby32|LINK
Hi
Can i do the following ? I would like to set the $(ProjectName) as soon as the file is first loaded. It is a class that wont change.
Reason is because i need to create multiple of these but each will have a different name as the project. lets says the project was called Project1 then I would hvae to add the using for that via ctrl +. if it was Project2 the same etc .
This comes off a template that I have created and every time i need to create a project i just use the template , but i couldnt find a way to set the using as the same name I give the project when creaating
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using $(ProjectName)
namespace ViewModel
{
etc etc
thanks
Member
110 Points
25 Posts
Re: How can i dynamically assign a value in the using of a cs file ?
Jul 03, 2014 08:08 AM|PANkaj9999|LINK
You should use SAME namespace for all project.
All-Star
23975 Points
4084 Posts
Re: How can i dynamically assign a value in the using of a cs file ?
Jul 04, 2014 05:17 AM|Starain chen - MSFT|LINK
Hi robby32,
As PANkaj9999 said that you could use the same namespace. After that you could use using [namespace].
For the different class name, you could have an interface, then the classes are implement this interface.
Thanks
Best Regards
Member
280 Points
1000 Posts
Re: How can i dynamically assign a value in the using of a cs file ?
Jul 07, 2014 02:22 AM|robby32|LINK
Thanks works