Exemple #1
0
 // ReSharper restore InconsistentNaming
 // ReSharper disable InconsistentNaming
 void search_StructureTransfered(object sender, StructureTransferEventsArgs e)
 {
     pictureBox1.Image = e.ThumbNail;
 }
Exemple #2
0
 // ReSharper restore InconsistentNaming
 // ReSharper disable InconsistentNaming
 void resultsForm_StructureTransfering(object sender, StructureTransferEventsArgs e)
 {
     StructureTransfered(this, e);
 }
Exemple #3
0
        private void tsbTransfer_Click(object sender, EventArgs e)
        {
            Image thumbNail = null;
            var smiles = string.Empty;
            var inchi = string.Empty;
            var inchiKey = string.Empty;
            var molfileString = string.Empty;

            var html = webBrowser1.DocumentText;

            switch (_transferType)
            {
                case(TransferType.All):
                    {
                        var compoundInfo = _cs.GetCompoundInfo(_results[_position], _token);
                        molfileString = _ci.CSIDToMol(_results[_position].ToString(), _token);
                        thumbNail = ByteArrayToImage(_cs.GetCompoundThumbnail(_results[_position].ToString(), _token));
                        smiles = compoundInfo.SMILES;
                        inchi = compoundInfo.InChI;
                        inchiKey = compoundInfo.InChIKey;
                        break;
                    }

                case (TransferType.AllChemistry):
                    {
                        var compoundInfo = _cs.GetCompoundInfo(_results[_position], _token);
                        molfileString = _ci.CSIDToMol(_results[_position].ToString(), _token);
                        smiles = compoundInfo.SMILES;
                        inchi = compoundInfo.InChI;
                        inchiKey = compoundInfo.InChIKey;
                        break;
                    }

                case (TransferType.AllInChI):
                    {
                        var compoundInfo = _cs.GetCompoundInfo(_results[_position], _token);
                        inchi = compoundInfo.InChI;
                        inchiKey = compoundInfo.InChIKey;
                        break;
                    }

                case (TransferType.InChI):
                    {
                        var compoundInfo = _cs.GetCompoundInfo(_results[_position], _token);
                        inchi = compoundInfo.InChI;
                        break;
                    }

                case (TransferType.InChIKey):
                    {
                        var compoundInfo = _cs.GetCompoundInfo(_results[_position], _token);
                        inchiKey = compoundInfo.InChIKey;
                        break;
                    }

                case (TransferType.MolfileString):
                    {
                        molfileString = _ci.CSIDToMol(_results[_position].ToString(), _token);
                        break;
                    }

                case (TransferType.Smiles):
                    {
                        var compoundInfo = _cs.GetCompoundInfo(_results[_position], _token);
                        smiles = compoundInfo.SMILES;
                        break;
                    }
            }

            var structureTransferEventArgs = new StructureTransferEventsArgs
            {
                SMILES = smiles,
                CSID = _results[_position],
                InChI = inchiKey,
                InChIKey = inchiKey,
                MolfileString = molfileString,
                ThumbNail = thumbNail
            };
            StructureTransfering(this, structureTransferEventArgs);
            if (_closeOnTransfer)
                Close();
        }