Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
 private void KeyProperties_FormClosed(object sender, FormClosedEventArgs e)
 {
     singleton = null;
 }
Ejemplo n.º 4
0
 private void KeyProperties_FormClosed(object sender, FormClosedEventArgs e)
 {
     singleton = null;
 }