Exemple #1
0
        private void importFormTESTToolStripMenuItem_Click(object sender, EventArgs e)
        {
            TestResults test = null;

            try
            {
                test = new TestResults();
            }
            catch (Exception)
            {
                return;
            }
            test.ShowDialog();
            string filepath = test.FilePath;

            if (string.IsNullOrEmpty(filepath))
            {
                return;
            }
            molecule = ChemInfo.MoleFileReader.ReadMoleFile(test.FilePath);
            this.dataGridView1.Rows.Clear();
            this.moleculeViewer1.Molecule     = molecule;
            this.propertyGrid1.SelectedObject = this.molecule;
            foreach (System.Data.DataRow dr in app_functionalgroup.Rows)
            {
                string smarts = dr["Smarts"].ToString();
                if (!string.IsNullOrEmpty(smarts))
                {
                    this.molecule.FindFunctionalGroup(dr);
                }
            }

            this.textBox1.Text = Newtonsoft.Json.JsonConvert.SerializeObject(this.molecule, Newtonsoft.Json.Formatting.Indented);
            foreach (string group in this.molecule.FunctionalGroups)
            {
                this.functionalGroupComboBox.Items.Add(group);
            }
        }
        private void importFormTESTToolStripMenuItem_Click(object sender, EventArgs e)
        {
            TestResults test = null;

            try
            {
                test = new TestResults();
            }
            catch (Exception)
            {
                return;
            }
            test.ShowDialog();
            string filepath = test.FilePath;

            if (string.IsNullOrEmpty(filepath))
            {
                return;
            }
            molecule = ChemInfo.MoleFileReader.ReadMoleFile(test.FilePath);
            this.listBox1.Items.Clear();
            this.moleculeViewer1.Molecule = molecule;
        }