Hi all,
I try to debug the Configuration dialog window of the FRITZ!Box Manager plugin. Therefore I created the following code. When I run it the plugin is shown without any problem and all settings are loaded. But if I change settings they are not saved to the MediaPortal.xml file. The file isn't changed at all. However the plugin 's log messages are written to the MediaPortal.log file. And there's no error message.
All other functions of the Configuration dialog window are working fine.
If I do the same via the MediaPortal Configuration.exe tool the settings are saved without any problem.
Does anyone know the reason for this strange behaviour?
Any support is highly appreciated.
I try to debug the Configuration dialog window of the FRITZ!Box Manager plugin. Therefore I created the following code. When I run it the plugin is shown without any problem and all settings are loaded. But if I change settings they are not saved to the MediaPortal.xml file. The file isn't changed at all. However the plugin 's log messages are written to the MediaPortal.log file. And there's no error message.
All other functions of the Configuration dialog window are working fine.
If I do the same via the MediaPortal Configuration.exe tool the settings are saved without any problem.
Does anyone know the reason for this strange behaviour?
Any support is highly appreciated.
Code:
namespace FritzBoxConfigTester
{
internal class Program
{
[STAThread]
private static void Main(string[] args)
{
Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);
Application.EnableVisualStyles();
// test for direct save
MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(@"C:\Documents and Settings\All Users\Application Data\Team MediaPortal\MediaPortal\MediaPortal.xml");
xmlwriter.SetValue("Section1", "Entry1", "Test");
new FritzBox.FritzBox().ShowPlugin();
}
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
try
{
Exception ex = (Exception)e.ExceptionObject;
MessageBox.Show("Unhandled exception. Please contact the developers with the following information:\n\n" + ex.Message + ex.StackTrace, "Fatal Error", MessageBoxButtons.OK, MessageBoxIcon.Stop);
}
finally
{
Application.Exit();
}
}
public static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
{
DialogResult result = DialogResult.Abort;
try
{
result = MessageBox.Show("Unhandled exception. Please contact the developers with the following information:\n\n" + e.Exception.Message + e.Exception.StackTrace, "Application Error", MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Stop);
}
finally
{
if (result == DialogResult.Abort) Application.Exit();
}
}
}
}