Exemple #1
0
        public InstructorSpace(RECT aFrame)
            : base("Auditorium", aFrame)
        {
            // And one larger one
            fScetchSurface = new SketchWindow(200, 0, 600, 600);
            fScetchSurface.Show();

            ClockWindow aClock = new ClockWindow(0, 0, 198, 198);
            //aClock.Show();

            tile2ID = MetaSpace.CreateSurface("tile2", new RECT(0, 200, 198, 198),null);

            tile3ID = MetaSpace.CreateSurface("tile3", new RECT(0, 400, 198, 198), null);

        }
        /// <summary>
        /// Shows the screensaver on every monitor. This is a multi monitor
        /// application.
        /// </summary>
        private void ShowScreenSaver()
        {
            ClockWindow ownerWindow = null;

            // Creates window on other screens.
            foreach (System.Windows.Forms.Screen screen in System.Windows.Forms.Screen.AllScreens)
            {
                ClockWindow window = new ClockWindow(screen.Bounds.Width,
                                                     screen.Bounds.Height);

                // Primary screen does not have WindowsStartupLocation.
                if (screen.Primary)
                {
                    // Maximizes screen.
                    window.WindowState = WindowState.Maximized;

                    ownerWindow = window;
                }
                else
                {
                    // Other screens need a WindowStartupLocation on manual.
                    window.WindowStartupLocation = WindowStartupLocation.Manual;

                    System.Drawing.Rectangle location = screen.Bounds;
                    window.Top    = location.Top;
                    window.Left   = location.Left - 480;
                    window.Width  = location.Width;
                    window.Height = location.Height;
                }

                window.Show();
            }

            // Sets owner window to primary screen. This closes owner as well
            // as other screen saver screens, if one of them is closed.
            if (ownerWindow != null)
            {
                // Sets every other screen owned to primary window.
                // It closes all windows at once.
                foreach (Window window in Current.Windows)
                {
                    if (window != ownerWindow)
                    {
                        window.Owner = ownerWindow;
                    }
                }
            }
        }
Exemple #3
0
 public static void Main(string[] args)
 {
     ClockWindow win = new ClockWindow();
     win.Show();
     win.Run();
 }