Example #1
0
        private void IonTableListboxSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (IonTableListbox is null || ionTable is null || IonTableListbox.SelectedIndex < 0)
            {
                return;
            }

            string selectedIonName = IonTableListbox.SelectedItem.ToString();
            Ion    ion             = ionTable.Lookup(selectedIonName);

            IonNameTextbox.Text         = ion.name;
            IonChargeTextbox.Text       = ion.charge.ToString();
            IonConductivityTextbox.Text = (ion.conductivity * 1e4).ToString("0.000");
            IonC0Textbox.Text           = "0";
            IonCLTextbox.Text           = "0";
            Message($"Loaded Ion: {ion.nameWithCharge}", ion.ToString());

            ValidateIon();
        }
Example #2
0
        public void TestIonFormatedToString()
        {
            Ion ion = new Ion(4.083286, 142.545026);

            Assert.AreEqual("4.083286:142.545026", ion.ToString());
        }