Exemplo n.º 1
0
 private void LoadProfile()
 {
     // Load user profile information such as window position, selected units, etc
         Xml profile = new Xml();
         profile.Name = "scaleview-settings.xml";
         if (profile.HasSection("MainWindow"))
         {
             this.Left = Convert.ToInt16(profile.GetValue("MainWindow", "Left"));
             this.Top = Convert.ToInt16(profile.GetValue("MainWindow", "Top"));
             radioGrams.Checked = Convert.ToBoolean(profile.GetValue("Unit", "grams"));
             radioLboz.Checked = Convert.ToBoolean(profile.GetValue("Unit", "lb\\oz"));
             radioOunces.Checked = Convert.ToBoolean(profile.GetValue("Unit", "ounces"));
             chkAutoCopy.Checked = Convert.ToBoolean(profile.GetValue("Settings", "AutoCopy"));
             chkCopyUnit.Checked = Convert.ToBoolean(profile.GetValue("Settings", "CopyUnit"));
             chkRoundOz.Checked = Convert.ToBoolean(profile.GetValue("Settings", "RoundOz"));
         }
         else
         {
             this.StartPosition = FormStartPosition.WindowsDefaultLocation;
             radioGrams.Checked = false;
             radioLboz.Checked = true;
             radioOunces.Checked = false;
             chkAutoCopy.Checked = false;
             chkCopyUnit.Checked = true;
             chkRoundOz.Checked = false;
         }
 }