public static void ShowProperties(Dictionary<string, VisibleKey> selectedKeys) { if (singleton == null) { if (selectedKeys == null || selectedKeys.Count == 0) { return; } singleton = new KeyProperties(); singleton.Owner = Earth3d.MainWindow; } if (selectedKeys == null || selectedKeys.Count == 0) { singleton.Hide(); } else { singleton.Show(); var visible = false; foreach (var screen in Screen.AllScreens) { if (screen.WorkingArea.Contains(singleton.DesktopLocation)) { visible = true; break; } } if (!visible) { var parent = Earth3d.MainWindow.DesktopLocation; singleton.Location = new Point(parent.X + 100, parent.Y +100); } } singleton.Keys = selectedKeys; }
static public void ShowProperties(Dictionary <string, VisibleKey> selectedKeys) { if (singleton == null) { if (selectedKeys == null || selectedKeys.Count == 0) { return; } singleton = new KeyProperties(); singleton.Owner = Earth3d.MainWindow; } if (selectedKeys == null || selectedKeys.Count == 0) { singleton.Hide(); } else { singleton.Show(); bool visible = false; foreach (var screen in Screen.AllScreens) { if (screen.WorkingArea.Contains(singleton.DesktopLocation)) { visible = true; break; } } if (!visible) { Point parent = Earth3d.MainWindow.DesktopLocation; singleton.Location = new Point(parent.X + 100, parent.Y + 100); } } singleton.Keys = selectedKeys; }
private void KeyProperties_FormClosed(object sender, FormClosedEventArgs e) { singleton = null; }