Пример #1
0
        private void setup()
        {
            controller = new Controller(this.screenSaverMode, true);

            textCanvas = new Canvas();
            Grid.SetZIndex(textCanvas, 100000);
            grdMain.Children.Add(textCanvas);

            timer         = new CallbackTimer();
            timerCallback = new CallbackTimer.WaitOrTimerDelegate(render);
            timer.Create(100, (int)(1000.0 / FRAMES_PER_SECOND), timerCallback);
        }
Пример #2
0
        private void frmMain_Load(object sender, EventArgs e)
        {
            if (this.screenSaverMode == ScreenSaverMode.Application)
            {
                var r = Properties.Settings.Default.ScreenBounds;

                if (r.IsEmpty || !r.IsContainedIn(Screen.PrimaryScreen.WorkingArea))
                {
                    this.Bounds = new Rectangle(Screen.PrimaryScreen.WorkingArea.Left + 20,
                                                Screen.PrimaryScreen.WorkingArea.Top + 20,
                                                Screen.PrimaryScreen.WorkingArea.Width - 40,
                                                Screen.PrimaryScreen.WorkingArea.Height - 40);
                }
                else
                {
                    this.Bounds = r;
                }
            }
            timer         = new CallbackTimer();
            timerCallback = new CallbackTimer.TimerDelegate(invalidateCallback);
            timer.Create(100, 1000 / FRAMES_PER_SECOND, timerCallback);
        }