Ejemplo n.º 1
0
        public void displayGroupControl(int selectedScreen)
        {
            Debug.WriteLine("Selected Screen: {0}", selectedScreen);
            reset();
            gcontrol = new GroupControl();
            gcontrol.groupSetting    = groupsettings[selectedScreen];
            gcontrol.isActive.Click += new RoutedEventHandler(isActive_Click);
            List <string> unassignedMonitors = new List <string>();
            int           monitorcount       = 1;

            foreach (System.Windows.Forms.Screen Screen in System.Windows.Forms.Screen.AllScreens)
            {
                string tmpMonitor = "Monitor " + monitorcount;
                if (!ownedmonitors[selectedScreen].Contains(tmpMonitor))
                {
                    unassignedMonitors.Add(tmpMonitor);
                }
                else
                {
                    gcontrol.OwnedMonitors.Add(tmpMonitor);
                }
                monitorcount++;
            }
            gcontrol.AvailableMonitors = unassignedMonitors;
            // gcontrol.OwnedMonitors = ownedmonitors[selectedScreen];
            mainPanel.Children.Add(gcontrol);
            currentActiveGroup = selectedScreen;
        }
        public void displayGroupControl(int selectedScreen)
        {
            Debug.WriteLine("Selected Screen: {0}", selectedScreen);
            reset();
            gcontrol = new GroupControl();
            gcontrol.groupSetting = groupsettings[selectedScreen];
            gcontrol.isActive.Click += new RoutedEventHandler(isActive_Click);
            List<string> unassignedMonitors = new List<string>();
            int monitorcount = 1;
            foreach (System.Windows.Forms.Screen Screen in System.Windows.Forms.Screen.AllScreens)
            {
                string tmpMonitor ="Monitor " + monitorcount++;
                if (!ownedmonitors[selectedScreen].Contains(Screen.DeviceName) && !ownedmonitors[selectedScreen].Contains(tmpMonitor))
                {
                    unassignedMonitors.Add(tmpMonitor);
                }
                else
                {
                    gcontrol.OwnedMonitors.Add(tmpMonitor);
                }
                monitorcount++;

            }
            gcontrol.AvailableMonitors = unassignedMonitors;
               // gcontrol.OwnedMonitors = ownedmonitors[selectedScreen];
            mainPanel.Children.Add(gcontrol);
            currentActiveGroup = selectedScreen;
        }