Exemple #1
0
 //Loading the lists again is redundant, but it was working and I did not want to risk anything
 private void frmOptions_Load(object sender, EventArgs e)
 {
     conversions = ConversionsDB.GetConversions();
     options     = OptionsDB.GetOptions();
     FillListBox(conversions);
     FillComboBox(conversions);
 }
Exemple #2
0
        //Load application, read files, and fill lists. Open a child form
        private void frmStartUp_Load(object sender, EventArgs e)
        {
            conversions = ConversionsDB.GetConversions();
            ConversionsDB.SaveConversions(conversions);

            options = OptionsDB.GetOptions();

            int count = options.Count;

            if (options[count - 1].ShowToolbar == "true")
            {
                toolStrip1.Visible = true;
            }
            else
            {
                toolStrip1.Visible = false;
            }

            frmConversion newConversionForm = new frmConversion();

            newConversionForm.MdiParent = this;
            newConversionForm.Text      = "Conversion " + childFormNum;
            newConversionForm.Show();
            childFormNum++;
        }
Exemple #3
0
        public frmConversion()
        {
            options     = OptionsDB.GetOptions();
            conversions = ConversionsDB.GetConversions();
            int    count        = options.Count;
            string selectedText = options[count - 1].DefaultConversion;

            InitializeComponent();

            foreach (Conversions row in conversions)
            {
                cmbConversion.DisplayMember = "Text";
                cmbConversion.ValueMember   = "Value";
                cmbConversion.Items.Add(new { Text = row.Unit1 + " to " + row.Unit2, Value = row.Multiplier });
            }
            cmbConversion.SelectedIndex = cmbConversion.FindStringExact(selectedText);
        }
Exemple #4
0
        //Read files and load lists. Load defaults for Show Tool Bar
        public frmOptions()
        {
            InitializeComponent();
            conversions = ConversionsDB.GetConversions();
            options     = OptionsDB.GetOptions();
            tempChanges = ConversionsDB.GetConversions();

            int count = options.Count;

            if (options[count - 1].ShowToolbar == "true")
            {
                cbxShowToolbar.Checked = true;
            }
            else
            {
                cbxShowToolbar.Checked = false;
            }
        }