J-Thread: Your code works (sort of) and mine doesn't so I'll just use yours lol
Anyway, I have the AddEventEntry in a class called Utilities.cs and I made it "public static bool" so I could then do:
code:
MLP.Utilities.AddEventEntry(thisContact, language[18] + " " + thisTitle + " " + language[19] + " " + thisArtist);
But it doesn't work.
However, I can write to the EventLog if I call the method from "MainForm_Load", why is this?
The method I want it to be called from is simply:
code:
private bool addEventLog(string thisContact, string thisTitle, string thisArtist)
{
RegistryKey rootPath = Registry.CurrentUser.CreateSubKey("Software\\Jedimark\\Music Logger Plus");
string logStatus = rootPath.GetValue("LogToPlus").ToString();
if (logStatus.Equals("true"))
{
MLP.Utilities.AddEventEntry(thisContact, language[18] + " " + thisTitle + " " + language[19] + " " + thisArtist);
return true;
}
return false;
}
(and yes, the if statement does return "true" so it is executing the call)