Пример #1
0
        private DialogResult ShowDialog2(
            ResultsFormat rf,
            bool useExistingOptionValues,
            bool alertExport)
        {
            _alertExport         = alertExport;
            rf.OutputDestination = OutputDest.Excel;
            rf.ExportFileFormat  = ExportFileFormat.Csv;

            if (useExistingOptionValues)
            {
                FileName.Text = rf.OutputFileName;
            }
            else
            {
                GetDefaultExportParameters(rf);
            }

            HeaderLines.SelectedItem = rf.HeaderLines.ToString();

            if (rf.ExportStructureFormat == ExportStructureFormat.Insight)
            {
                InsightStructure.Checked = true;
            }
            else
            {
                MetafileStructure.Checked = true;
            }

            FixedHeightStructs.Checked = rf.FixedHeightStructures;
            QnfSplitOptions.Setup(rf.QualifiedNumberSplit);
            ExportInBackground.Checked = rf.RunInBackground;
            DuplicateKeyValues.Checked = rf.DuplicateKeyTableValues;

            DialogResult dr = ShowDialog(SessionManager.ActiveForm);

            if (dr == DialogResult.Cancel)
            {
                return(dr);
            }

            rf.OutputFileName = FileName.Text;

            string txt = HeaderLines.SelectedItem.ToString();

            int.TryParse(txt, out rf.HeaderLines);

            if (InsightStructure.Checked)
            {
                rf.ExportStructureFormat = ExportStructureFormat.Insight;
            }

            else if (MetafileStructure.Checked)
            {
                rf.ExportStructureFormat = ExportStructureFormat.Metafiles;
            }

            rf.FixedHeightStructures = FixedHeightStructs.Checked;

            rf.DuplicateKeyTableValues = DuplicateKeyValues.Checked;

            rf.QualifiedNumberSplit = QnfSplitOptions.Get();

            rf.RunInBackground = ExportInBackground.Checked;

            SaveDefaultExportParameters(rf);

            return(DialogResult.OK);
        }
Пример #2
0
        public DialogResult ShowDialog2(
            ResultsFormat rf,
            bool useExistingOptionValues,
            bool alertExport)
        {
            _alertExport         = alertExport;
            rf.OutputDestination = OutputDest.SdFile;

            if (useExistingOptionValues)
            {
                FileName.Text = rf.OutputFileName;
            }
            else
            {
                GetDefaultExportParameters(rf);
            }

            bool structuresOnly = (rf.StructureFlags & MoleculeTransformationFlags.StructuresOnly) != 0;

            AllData.Checked       = !structuresOnly;
            StructureOnly.Checked = structuresOnly;

            LargeFragOnly.Checked         = (rf.StructureFlags & MoleculeTransformationFlags.LargestFragmentOnly) != 0;
            NoSuperAtom.Checked           = (rf.StructureFlags & MoleculeTransformationFlags.NoSuperAtomInfo) != 0;
            RemoveHydrogens.Checked       = (rf.StructureFlags & MoleculeTransformationFlags.RemoveHydrogens) != 0;
            RemoveStereochemistry.Checked = (rf.StructureFlags & MoleculeTransformationFlags.RemoveStereochemistry) != 0;

            QnfSplitOptions.Setup(rf.QualifiedNumberSplit);

            DuplicateKeyValues.Checked         = rf.DuplicateKeyTableValues;
            AllowExtraLengthFieldNames.Checked = rf.AllowExtraLengthFieldNames;
            ExportInBackground.Checked         = rf.RunInBackground;

            DialogResult dr = ShowDialog(SessionManager.ActiveForm);

            if (dr == DialogResult.Cancel)
            {
                return(dr);
            }

            rf.OutputFileName = FileName.Text;

            rf.StructureFlags = 0;

            if (StructureOnly.Checked)
            {
                rf.StructureFlags |= MoleculeTransformationFlags.StructuresOnly;
            }

            if (LargeFragOnly.Checked)
            {
                rf.StructureFlags |= MoleculeTransformationFlags.LargestFragmentOnly;
            }

            if (NoSuperAtom.Checked)
            {
                rf.StructureFlags |= MoleculeTransformationFlags.NoSuperAtomInfo;
            }

            if (RemoveHydrogens.Checked)
            {
                rf.StructureFlags |= MoleculeTransformationFlags.RemoveHydrogens;
            }

            if (RemoveStereochemistry.Checked)
            {
                rf.StructureFlags |= MoleculeTransformationFlags.RemoveStereochemistry;
            }

            rf.QualifiedNumberSplit = QnfSplitOptions.Get();

            rf.DuplicateKeyTableValues    = DuplicateKeyValues.Checked;
            rf.AllowExtraLengthFieldNames = AllowExtraLengthFieldNames.Checked;
            rf.RunInBackground            = ExportInBackground.Checked;

            SaveDefaultExportParameters(rf);

            return(DialogResult.OK);
        }