public void Close() { if (!IsClosed) { _Form?.Close(); } _Form = null; }
public void Show(bool AUTOFILL, bool longClick) { try { IsClosed = false; Symbols = true; Numbers = true; int topSize = 50; Upercase = true; Lowercase = true; _Form = new TExtentionGenPassView(); Text = rp.Generate(); _Form.DataContext = this; _Form.Deactivated += _Form_Deactivated; _Form.Closing += _Form_Closing; if (!longClick) { ShowHIO = false; var s = System.Windows.Forms.Screen.FromPoint(System.Windows.Forms.Cursor.Position); _Form.WindowStartupLocation = System.Windows.WindowStartupLocation.Manual; _Form.Left = s.WorkingArea.Right / HIOStaticValues.scale - _Form.Width - 16; _Form.Top = (s.WorkingArea.Top / HIOStaticValues.scale) + topSize; } else { _Form.Width = 340; _Form.Height = 300; } _Form.ShowActivated = true; _Form.Topmost = true; _Form.Show(); _Form.Activate(); _Form.Focus(); } catch (Exception ex) { } }