void ShowUpdateMessageBox() { if (UpdateAvailable.Active) { return; } UpdateAvailable form = new UpdateAvailable(); // https://stackoverflow.com/questions/8566582/how-to-centerparent-a-non-modal-form form.Location = new Point(Location.X + (Width - form.Width) / 2, Location.Y + (Height - form.Height) / 2); form.Show(this); }
private void Application_DocumentOpenendEvent(IVDocument d) { Log.Debug($"DocumentOpenEvent for Document {d.Name} detected."); if (Application.ActiveDocument.Template.Contains(Information.TemplateName) && showRationallyUpdatePopup) { Log.Debug("Rationally template and update required detected."); try { UpdateAvailable upd = new UpdateAvailable(AddInLocalVersion, addInOnlineVersion); upd.Show(); showRationallyUpdatePopup = false; Log.Debug("Shown update popup successfully."); } catch (Exception ex) { Log.Error(ex, ex); #if DEBUG throw; #endif } } }