private void MyWindow_Closing(object sender, CancelEventArgs e)
 {
     //Empty the IP address when closing alway is ""?
     if (Properties.Settings.Default.CodingIP != "" && Properties.Settings.Default.CodingIP != null)
     {
         Properties.Settings.Default.CodingIP  = "";
         Properties.Settings.Default.CurrentID = "";
         Properties.Settings.Default.Save();
         if (isInternetup)
         {
             _CallOut_CodingService.Close();
         }
         else
         {
             _CallOut_CodingService.Abort();
         }
     }
 }
        private void MyWindow_Closing(object sender, CancelEventArgs e)
        {
            if (_CallOut_CodingService != null)
            {
                //possible of remove the stationID in the setting file?
                if (isInternetup)
                {
                    _CallOut_CodingService.Close();
                }
                else
                {
                    //Use abort as internet is been cut
                    _CallOut_CodingService.Abort();
                }
            }

            //remove the networkstatus handler
            NetworkChange.NetworkAvailabilityChanged -=
                new NetworkAvailabilityChangedEventHandler(DoNetworkChanged);
        }