コード例 #1
0
        public void SSF_ConstructorTest_01()
        {
            Form   form            = CreatePreviewWindow();
            string windowHandleArg = form.Handle.ToString();

            try
            {
                ScreenSaverForm target = new ScreenSaverForm(windowHandleArg);
                target.Show();
                Application.Run(form);
            }
            catch (Exception e)
            {
                Assert.Fail(e.ToString());
            }
        }
コード例 #2
0
        internal static void ShowScreenSaver()
        {
#if DEBUG
            var screen = Screen.AllScreens[0];
            var saver  = new ScreenSaverForm {
                Bounds = screen.Bounds, RandomSeed = 1
            };
            saver.Show();
#else
            var i = 0;
            foreach (var screensaver in Screen.AllScreens.Select(screen => new ScreenSaverForm {
                Bounds = screen.Bounds, RandomSeed = ++i
            }))
            {
                screensaver.Show();
            }
#endif
        }
コード例 #3
0
        /// <summary>
        /// Display the form on each of the computer's monitors.
        /// </summary>
        static void ShowScreenSaver()
        {
            int i = 0;
            var multiscreenDisabled = new RegSettings().MultiscreenDisabled;

            foreach (Screen screen in Screen.AllScreens)
            {
                bool showVideo = true;
                // disable video on multi-displays (3+) except the first
                if (Screen.AllScreens.Length > 2 && screen != Screen.PrimaryScreen && multiscreenDisabled)
                {
                    showVideo = false;
                }

                ScreenSaverForm screensaver = new ScreenSaverForm(screen.Bounds, i == 0, showVideo);
                screensaver.Show();
                i++;
            }
        }