All,
I have a program that reads a serial port data and performs some action.
Here is little piece of code that does that .
private void SerialDataReceivedEventHandler(object sender, SerialDataReceivedEventArgs e)
{
try
{
SerialPort sp = (SerialPort)sender;
Thread.Sleep(100);
sCommdata = sp.ReadExisting();
string[] splitter = new string[2];
splitter = sCommdata.Split('\r');
string switchMaker = splitter[0].Trim();
switchMaker = switchMaker.Substring(0, 3);
Dispatcher.Invoke(new UpdateKiosk(Reintialise), DispatcherPriority.Send, sCommdata);
}
catch (Exception ex)
{
//log data goes here
}
}
Application will automatically reset every time it is used unless some double click the company logo and provide application password. Once a correct password is entered, Application will exit completely. Now, I have included the following code that stores application password in WPF app.config. Here is the XML code.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key ="ApplicationPassword" value ="xxxxxxx"/>
</appSettings>
</Configuration>
Once I added the above code , below code is executed but method that needs to be notified (Reinitialise) doesnt receive any notification.
Dispatcher.Invoke (new UpdateKiosk(Reintialise),DispatcherPriority.Send, sCommdata);
Reinitialise Method does all initial setting for the application by calling web service methods.
Any suggestion?
Thanks