T
tiger79
Hello,
I've made an API which I reference to in one of my programs.
In this API I got a class with some const string variables (not that
variable though )
Now I'd like to copy its values in the calling class :
I'll show some code :
This is the calling function :
obviously using
using Dictionarytest1;
public Form1()
{
InitializeComponent();
Dictionarytest1.peccDictionary Dictionary = new peccDictionary();
ShowDictionary();
}
private void ShowDictionary()
{
name = Dictionary.GetName();
version = Dictionary.GetVersion();
description = Dictionary.GetDescription();
MessageBox.Show("The next Dictionary has been instantiated : "+name+",
version : "+version+", description : "+description+". It's entities will be
loaded");
}
Ok so I made those get functions so that I could retrieve the interested
const variables :
amespace Dictionarytest1
{
public class peccDictionary
{
public const string NAME = "TestDictionary";
public const string VERSION = "0,7";
public const string DESCRIPTION = "First test-version of Dictionary";
public peccDictionary()
{
peccEntities Entities = new peccEntities();
}
public string GetName()
{
return NAME;
}
public string GetVersion()
{
return VERSION;
}
public string GetDescription()
{
return DESCRIPTION;
}
}
}
Ok, can anyone see what I am doing wrong here ?
BTW, the error I get is a nullexception error
I've made an API which I reference to in one of my programs.
In this API I got a class with some const string variables (not that
variable though )
Now I'd like to copy its values in the calling class :
I'll show some code :
This is the calling function :
obviously using
using Dictionarytest1;
public Form1()
{
InitializeComponent();
Dictionarytest1.peccDictionary Dictionary = new peccDictionary();
ShowDictionary();
}
private void ShowDictionary()
{
name = Dictionary.GetName();
version = Dictionary.GetVersion();
description = Dictionary.GetDescription();
MessageBox.Show("The next Dictionary has been instantiated : "+name+",
version : "+version+", description : "+description+". It's entities will be
loaded");
}
Ok so I made those get functions so that I could retrieve the interested
const variables :
amespace Dictionarytest1
{
public class peccDictionary
{
public const string NAME = "TestDictionary";
public const string VERSION = "0,7";
public const string DESCRIPTION = "First test-version of Dictionary";
public peccDictionary()
{
peccEntities Entities = new peccEntities();
}
public string GetName()
{
return NAME;
}
public string GetVersion()
{
return VERSION;
}
public string GetDescription()
{
return DESCRIPTION;
}
}
}
Ok, can anyone see what I am doing wrong here ?
BTW, the error I get is a nullexception error