示例#1
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            try{
                if (ckWindowService.IsChecked.Value)
                {
                    //MessageBox.Show(Environment.CurrentDirectory + "/PhoneDirectory.exe");
                    appConfig.SaveValue("WindowsService", "yes");
                    CommonLibrary.ApplicationStartUp.Save(Environment.CurrentDirectory + @"\PhoneDirectory.exe");
                }
                else
                {
                    appConfig.SaveValue("WindowsService", "no");
                    CommonLibrary.ApplicationStartUp.Delete();
                }

                if (ckDebugMode.IsChecked.Value)
                {
                    appConfig.SaveValue("DebugMode", "yes");
                }
                else
                {
                    appConfig.SaveValue("DebugMode", "no");
                }
                MessageBox.Show("Save Successful!");
            }
            catch (Exception ex)
            {
                MessageBox.Show("Options - General Settings " + ex.Message);
                CommonLibrary.Utilities.Log.Create("Options - General Settings " + ex.Message);
            }
        }
示例#2
0
 private void ckWindowService_Checked(object sender, RoutedEventArgs e)
 {
     try{
         appConfig.SaveValue("WindowsService", "yes");
         CommonLibrary.ApplicationStartUp.Save(Environment.CurrentDirectory + @"\PhoneDirectory.exe");
     }
     catch (Exception ex)
     {
         MessageBox.Show("Options - General Settings " + ex.Message);
         CommonLibrary.Utilities.Log.Create("Options - General Settings " + ex.Message);
     }
 }