示例#1
0
 /// <summary>
 /// Method used to add a Desktop object to the allWindows collection.
 /// </summary>
 /// <param name="desktop">Desktop object to be added to the allWindows collection.</param>
 public static void RegisterDesktop(Desktop desktop)
 {
     allDesktops.Add(desktop);
 }
示例#2
0
        /// <summary>
        /// Class constructor.
        /// </summary>
        /// <param name="size">The number of Desktop objects to create.</param>
        public DesktopManager(int size, IntPtr applicationWindowHandle)
        {
            // Initialize static fields of other classes.
            DesktopUtil.Manager = this;

            // Initialize fields.
            this.desktopButtons = new List<Button>();
            this.scanThread = new Thread(this.Scan);
            this.continueScanning = true;
            this.removalThread = new Thread(this.Remove);
            this.continueRemoving = true;
            this.enumDesktopWindowsLpfn = new UnmanagedCode.EnumDesktopWindowsDelegate(this.EnumDesktopWindowsDelegate);
            this.applicationWindowHandle = applicationWindowHandle;

            // Create a number of size Desktop objects.
            Desktop d;
            for (int i = 0; i < size; i++)
                if (i == 0)
                    d = new Desktop(true);
                else
                    d = new Desktop(false);

            // Start window scanning and removal threads.
            this.scanThread.Start();
            this.removalThread.Start();
        }