Пример #1
0
        private void LaunchScreensaver()
        {
            RegistryKey key      = Registry.CurrentUser.OpenSubKey("SOFTWARE\\PictureSlideshowScreensaver");
            int         interval = int.Parse((string)key.GetValue("Interval"));

            System.Windows.Forms.Screen[] screens = System.Windows.Forms.Screen.AllScreens;

            for (int i = 0; i < screens.Length; i++)
            {
                System.Windows.Forms.Screen s = screens[i];
                Screensaver scr = new Screensaver(new ScreensaverViewModel());

                scr.WindowStartupLocation = WindowStartupLocation.Manual;
                scr.Left   = s.Bounds.X;
                scr.Top    = s.Bounds.Y;
                scr.Width  = s.Bounds.Width;
                scr.Height = s.Bounds.Height;

                scr.Show();

                break;
            }

            foreach (System.Windows.Forms.Screen screen in System.Windows.Forms.Screen.AllScreens)
            {
                //#if !DEBUG
                //                if (screen.Bounds.X > 0) {
                //#endif


                //#if !DEBUG
                //                }
                //#endif
            }
        }
Пример #2
0
        private void LaunchScreensaver()
        {
            foreach (System.Windows.Forms.Screen screen in System.Windows.Forms.Screen.AllScreens)
            {
//#if !DEBUG
//                if (screen.Bounds.X > 0) {
//#endif
                Screensaver s = new Screensaver(screen.Bounds);

                s.WindowStartupLocation = WindowStartupLocation.Manual;
                s.Left   = screen.Bounds.X;
                s.Top    = screen.Bounds.Y;
                s.Width  = screen.Bounds.Width;
                s.Height = screen.Bounds.Height;

                s.Show();

//#if !DEBUG
//                }
//#endif
            }
        }