Ejemplo n.º 1
0
        private void ProcessItemSelection()
        {
            if (this.DialogResult == DialogResult.OK)
            {
                return;                                                  // Already closing
            }
            ListView.SelectedListViewItemCollection lvsic =
                m_lvFields.SelectedItems;
            if ((lvsic == null) || (lvsic.Count != 1))
            {
                Debug.Assert(false); return;
            }

            ListViewItem lvi = lvsic[0];

            if (lvi == null)
            {
                Debug.Assert(false); return;
            }

            FpField fpf = (lvi.Tag as FpField);

            if (fpf == null)
            {
                Debug.Assert(false); return;
            }

            m_fpResult        = fpf;
            this.DialogResult = DialogResult.OK;
        }
Ejemplo n.º 2
0
        internal static FpField ShowAndRestore(string strTitle, string strText,
                                               List <FpField> lFields)
        {
            IntPtr h = IntPtr.Zero;

            try { h = NativeMethods.GetForegroundWindowHandle(); }
            catch (Exception) { Debug.Assert(false); }

            FieldPickerForm dlg = new FieldPickerForm();

            dlg.InitEx(strTitle, strText, lFields);

            FpField fpResult = null;

            if (UIUtil.ShowDialogAndDestroy(dlg) == DialogResult.OK)
            {
                fpResult = dlg.SelectedField;
            }

            try
            {
                if (h != IntPtr.Zero)
                {
                    NativeMethods.EnsureForegroundWindow(h);
                }
            }
            catch (Exception) { Debug.Assert(false); }

            return(fpResult);
        }
Ejemplo n.º 3
0
		private void ProcessItemSelection()
		{
			if(this.DialogResult == DialogResult.OK) return; // Already closing

			ListView.SelectedListViewItemCollection lvsic =
				m_lvFields.SelectedItems;
			if((lvsic == null) || (lvsic.Count != 1)) { Debug.Assert(false); return; }

			ListViewItem lvi = lvsic[0];
			if(lvi == null) { Debug.Assert(false); return; }

			FpField fpf = (lvi.Tag as FpField);
			if(fpf == null) { Debug.Assert(false); return; }

			m_fpResult = fpf;
			this.DialogResult = DialogResult.OK;
		}