Esempio n. 1
0
 private void configSaveBtn_Click(object sender, EventArgs e)
 {
     this.Cursor = Cursors.WaitCursor;
     int num = 0;
     IniHelper helper = new IniHelper(this.configFilePathVal.Text);
     if (!File.Exists(this.configFilePathVal.Text))
     {
         this.writeNewConfig(this.configFilePathVal.Text);
     }
     else
     {
         if (MessageBox.Show("File exists! -- Overwrite?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.No)
         {
             this.Cursor = Cursors.Default;
             return;
         }
         if ((File.GetAttributes(this.configFilePathVal.Text) & FileAttributes.ReadOnly) != FileAttributes.ReadOnly)
         {
             while (num < (this.configDataGridView.Rows.Count - 1))
             {
                 string str = this.configDataGridView.Rows[num].Cells[0].Value.ToString().Trim();
                 if (((str == "EXTRA_HOST_APP_ARGVS") || (str == "SIM_FILE")) || str.StartsWith("TEST_"))
                 {
                     helper.IniWriteValue(this.configDataGridView.Rows[num].HeaderCell.Value.ToString().Trim().Replace(" ", ""), this.configDataGridView.Rows[num].Cells[0].Value.ToString().Trim().Replace(" ", ""), this.configDataGridView.Rows[num].Cells[1].Value.ToString().Trim());
                 }
                 else
                 {
                     helper.IniWriteValue(this.configDataGridView.Rows[num].HeaderCell.Value.ToString().Trim().Replace(" ", ""), this.configDataGridView.Rows[num].Cells[0].Value.ToString().Trim().Replace(" ", ""), this.configDataGridView.Rows[num].Cells[1].Value.ToString().Trim().Replace(" ", ""));
                 }
                 num++;
             }
         }
         else
         {
             MessageBox.Show("File is read only!\nPlease change property and retry", "Error");
             this.Cursor = Cursors.Default;
             return;
         }
     }
     helper.IniSiRFLiveRxSetupErrorCheck(this.configFilePathVal.Text);
     string text1 = ConfigurationManager.AppSettings["InstalledDirectory"] + @"\Protocols\Protocols_AI3_Request.xml";
     helper.GetIniFileString("TEST_SETUP", "REQUIRED_AIDING", "");
     this.Cursor = Cursors.Default;
 }
Esempio n. 2
0
 public int CheckRxSetup(string configFilePath)
 {
     IniHelper helper = new IniHelper(configFilePath);
     return helper.IniSiRFLiveRxSetupErrorCheck(configFilePath);
 }
Esempio n. 3
0
 private void configCheckBtn_Click(object sender, EventArgs e)
 {
     this.Cursor = Cursors.WaitCursor;
     string fPath = @".\tmpConfigFile.cfg";
     this.writeNewConfig(fPath);
     IniHelper helper = new IniHelper(fPath);
     if (File.Exists(fPath))
     {
         if (helper.IniSiRFLiveRxSetupErrorCheck(fPath) == 0)
         {
             MessageBox.Show("No Error Found", "Success");
         }
         File.Delete(fPath);
     }
     else
     {
         MessageBox.Show("File does not exist!", "ERROR!");
     }
     this.Cursor = Cursors.Default;
 }
Esempio n. 4
0
 private int saveConfigToHash(string configFilePath)
 {
     if (File.Exists(configFilePath) && ((File.GetAttributes(configFilePath) & FileAttributes.ReadOnly) == FileAttributes.ReadOnly))
     {
         MessageBox.Show(configFilePath + "\nFile is read only! Please change property and retry.", "Error");
         this.Cursor = Cursors.Default;
         return 1;
     }
     this.Cursor = Cursors.WaitCursor;
     IniHelper helper = new IniHelper(configFilePath);
     List<string> sections = helper.GetSections();
     List<string> list2 = new List<string>();
     foreach (string str in sections)
     {
         foreach (string str2 in helper.GetKeys(str))
         {
             if (!str2.Contains("#") && clsGlobal.AutomationParamsHash.ContainsKey(str2))
             {
                 helper.IniWriteValue(str, str2, (string) clsGlobal.AutomationParamsHash[str2]);
             }
         }
     }
     int num = helper.IniSiRFLiveRxSetupErrorCheck(configFilePath);
     this.Cursor = Cursors.Default;
     return num;
 }