D
Dom
In C++ and VB, it is pretty easy to get a global constant, one that
can be used by all modules. I still have a need for this in CSharp,
but there is not easy way to get these. I can't, for example, just
"include" a file of constants.
Is it a good idea to create a class like the following:
class Parameters
{
public string FN_RegisteredServers;
public string FN_Sources;
public Parameters()
{
FN_RegisteredServers = Application.StartupPath + "\
\RegisteredServers.xml";
FN_Sources = Application.StartupPath + "\\Sources.xml";
}
}
Then, when a class needs a parameter, it does the following;
Parameters p = new Parameters ();
string FN_RegisteredServers = p.FN_RegisteredServers;
It just seems wrong that I need a new instance everytime I use it.
Dom
can be used by all modules. I still have a need for this in CSharp,
but there is not easy way to get these. I can't, for example, just
"include" a file of constants.
Is it a good idea to create a class like the following:
class Parameters
{
public string FN_RegisteredServers;
public string FN_Sources;
public Parameters()
{
FN_RegisteredServers = Application.StartupPath + "\
\RegisteredServers.xml";
FN_Sources = Application.StartupPath + "\\Sources.xml";
}
}
Then, when a class needs a parameter, it does the following;
Parameters p = new Parameters ();
string FN_RegisteredServers = p.FN_RegisteredServers;
It just seems wrong that I need a new instance everytime I use it.
Dom