Ejemplo n.º 1
0
        private void OnBtnOK(object sender, EventArgs e)
        {
            SearchParameters sp = GetSearchParameters();

            Form          fOptDialog;
            IStatusLogger sl = StatusUtil.CreateStatusDialog(this, out fOptDialog,
                                                             null, KPRes.SearchingOp + "...", true, false);

            // if(fOptDialog != null) Program.MainForm.RedirectActivationPush(fOptDialog);
            this.Enabled = false;

            PwGroup   pgResults = null;
            Exception exFind    = null;

            try { pgResults = SearchUtil.Find(sp, m_pgRoot, sl); }
            catch (Exception ex) { exFind = ex; }

            this.Enabled = true;
            // if(fOptDialog != null) Program.MainForm.RedirectActivationPop();
            sl.EndLogging();

            if (exFind != null)
            {
                MessageService.ShowWarning(sp.SearchString, exFind);
                this.DialogResult = DialogResult.None;
            }
            else if (pgResults != null)
            {
                m_pgResults = pgResults;
                m_spResult  = sp;
            }
            else
            {
                Debug.Assert(false);
                this.DialogResult = DialogResult.None;
            }
        }