public void DisplayCategoryForm() { Focus(); /* * _categoryDisplayForm = new CategoryDisplayFormM1(this, _categoryContext) ; * _categoryDisplayForm.MinDropDownWidth = 0; * IMiniFormOwner miniFormOwner = FindForm() as IMiniFormOwner; * if (miniFormOwner != null) * _categoryDisplayForm.FloatAboveOwner(miniFormOwner); * _categoryDisplayForm.Closed += new EventHandler(_categoryDisplayForm_Closed); * using ( new WaitCursor() ) * _categoryDisplayForm.Show(); */ Point anchor = PointToScreen(new Point(RightToLeft == RightToLeft.Yes ? 0 : ClientSize.Width, ClientSize.Height)); _categoryDisplayForm = new CategoryDisplayFormW3M1(_categoryContext, anchor); _categoryDisplayForm.SelfDispose = true; IMiniFormOwner miniFormOwner = FindForm() as IMiniFormOwner; if (miniFormOwner != null) { _categoryDisplayForm.FloatAboveOwner(miniFormOwner); } _categoryDisplayForm.Closed += _categoryDisplayForm_Closed; using (new WaitCursor()) _categoryDisplayForm.Show(); }
private void DisplayCategoryForm() { // If we just dismissed the form, don't display it if (_recentlyClosedForm) { return; } Focus(); _categoryDisplayForm = new CategoryDisplayForm(this, _categoryContext); //_categoryDisplayForm.MinDropDownWidth = 0; IMiniFormOwner miniFormOwner = FindForm() as IMiniFormOwner; if (miniFormOwner != null) { _categoryDisplayForm.FloatAboveOwner(miniFormOwner); } _categoryDisplayForm.Closed += new EventHandler(_categoryDisplayForm_Closed); _categoryDisplayForm.Show(); }
public void FloatAboveOwner(IMiniFormOwner owner) { _floatAboveMainFrame = true; _owner = owner; _owner.AddOwnedForm(this); }
public void ViewContent(Control parent, Point menuLocation, int alternativeLocation, IDisposable disposeWhenDone) { try { if (!WinInet.InternetConnectionAvailable) { disposeWhenDone.Dispose(); DisplayMessage.Show(MessageId.InternetConnectionWarning); return; } // track resource that need to be disposed _disposeWhenDone = disposeWhenDone; using (new WaitCursor()) { // if the user is holding the CTRL button down then invalidate the cache bool forceResynchronize = (KeyboardHelper.GetModifierKeys() == Keys.Control); // setup download options int downloadOptions = DLCTL.DLIMAGES | DLCTL.NO_CLIENTPULL | DLCTL.NO_BEHAVIORS | DLCTL.NO_DLACTIVEXCTLS | DLCTL.SILENT; if (forceResynchronize) { downloadOptions |= DLCTL.RESYNCHRONIZE; } // determine cookies and/or network credentials WinInetCredentialsContext credentialsContext = null; try { credentialsContext = BlogClientHelper.GetCredentialsContext(_button.BlogId, _button.ContentUrl); } catch (BlogClientOperationCancelledException) { _disposeWhenDone.Dispose(); return; } // note that we have viewed the content _button.RecordButtonClicked(); // create the form and position it BrowserMiniForm form = new BrowserMiniForm(_button.ContentQueryUrl, downloadOptions, credentialsContext); form.StartPosition = FormStartPosition.Manual; form.Size = _button.ContentDisplaySize; if (!Screen.FromPoint(menuLocation).Bounds.Contains(menuLocation.X + form.Width, menuLocation.Y)) { menuLocation.X = alternativeLocation - form.Width; } form.Location = new Point(menuLocation.X + 1, menuLocation.Y); // subscribe to close event for disposal form.Closed += new EventHandler(form_Closed); // float above parent if we have one IMiniFormOwner miniFormOwner = parent.FindForm() as IMiniFormOwner; if (miniFormOwner != null) { form.FloatAboveOwner(miniFormOwner); } // show the form form.Show(); } } catch { disposeWhenDone.Dispose(); throw; } }