Пример #1
0
        void tock_Tick(object sender, EventArgs e)
        {
            Logging.LogLineIf(fTrace, "tock_Tick(): entered.");
            Logging.LogLineIf(fTrace, "   tock_Tick(): creating debugOutputWindow:");

            debugOutputWindow = new ScrollingTextWindow(this);
            debugOutputWindow.CopyTextToClipboardOnClose = true;
            debugOutputWindow.ShowDisplay();

            Logging.LogLineIf(fTrace, "  tock_Tick(): Killing timer.");

            tock.Stop();
            tock.Tick -= tock_Tick;
            tock.Dispose();
            tock = null;

            Logging.LogLineIf(fTrace, "tock_Tick(): exiting.");
        }
Пример #2
0
        /// <summary>
        /// Code called when tock Timer goes off, to create and show the debug output window.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void tock_Tick(object sender, EventArgs e)
        {
            // if this method has been called, it's because we want the
            // debug ouput window to pop up (ie, it can't be called directly
            // because there is no user UX - miniPreview mode, essentially)

            Logging.LogLineIf(fDebugTrace, "tock_Tick(): entered.");
            tock.Stop();

            Logging.LogLineIf(fDebugTrace, "   tock_Tick(): creating debugOutputWindow:");

            debugOutputWindow = new ScrollingTextWindow(this);
            debugOutputWindow.CopyTextToClipboardOnClose = true;
            debugOutputWindow.ShowDisplay();

            Logging.LogLineIf(fDebugTrace, "  tock_Tick(): Killing timer.");
            tock.Tick -= tock_Tick;
            tock.Dispose();
            tock = null;

            Logging.LogLineIf(fDebugTrace, "tock_Tick(): exiting.");
        }
Пример #3
0
        /// <summary>
        /// Event which occurs when a key goes down. Most of our keyboard handling will occur here.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ScreenSaverForm_KeyDown(object sender, KeyEventArgs e)
        {
            fInputDebugTrace = fInputDebugOutput && fInputDebugOutputAtTraceLevel;

            Logging.LogLineIf(fInputDebugTrace, "ScreenSaverForm_KeyDown(): entered.");

            // To test which keys cause which events, un-comment the following lines
            //Logging.LogLineIf(fInputDebugTrace, "   KeyDown(): KeyCode = " + e.KeyCode + ", KeyValue = " + e.KeyValue +
            //    ", KeyData = " + e.KeyData + ", Modifiers = " + e.Modifiers.ToString() + ", Handled = " + e.Handled);

            switch (e.KeyCode)
            {

                // Special Keys

                case Keys.ControlKey:
                    // set a formwide variable, reset it on KeyUp event for ControlKey
                    fCtrlDown = true;
                    break;

                case Keys.ShiftKey:
                    // set a formwide variable, reset it on KeyUp event for ShiftKey
                    fShiftDown = true;
                    break;

                case Keys.Space:
                    ourSlideshow.Toggle();
                    break;

                case Keys.Escape:
                    DoQuit();
                    break;

                case Keys.Right:
                    DoUserWantsToAdvanceToNextPhoto();
                    break;

                case Keys.Left:
                    DoUserWantsToSeePreviousPhoto();
                    break;

                case Keys.Up:
                    DoUserWantsToEnterETFMode();
                    break;

                case Keys.Down:
                    DoUserWantsToExitETFMode();
                    break;

                case Keys.PageUp:
                    break;

                case Keys.PageDown:
                    break;

                case Keys.Home:
                    break;

                case Keys.End:
                    break;

                case Keys.Insert:
                    break;

                case Keys.Delete:
                    DoBlacklistCurrentFile();
                    break;

                case Keys.LWin:
                    break;

                case Keys.RWin:
                    break;

                case Keys.Back:
                    ToggleShowMetadata();
                    break;

                case Keys.Enter:
                    break;

                case Keys.F1:
                    DoHelpAboutDialog();
                    break;

                case Keys.F2:
                    DoSettingsDialog();
                    break;

                case Keys.F3:
                    DoFontDialog();
                    break;

                case Keys.F4:
                    // DoColorDialog();
                    break;

                case Keys.F9:
                    if (debugOutputWindow != null)
                    {
                        debugOutputWindow.ToggleDisplayVisibility();
                    }
                    else
                    {
                        debugOutputWindow = new ScrollingTextWindow(this);
                        debugOutputWindow.ShowDisplay();
                    }
                    break;

                case Keys.F11:
                    ToggleScreenSaverWindowStyle();
                    break;

                case Keys.D0: // zero
                    if (e.Control)
                    {
                        DoRestoreTextValuesToLoadedValues();
                    }
                    break;

                case Keys.M:
                    {
                        // MessingAround();
                    }
                    break;

                case Keys.N:
                    break;

                // "Mouse" Keys --- Yes, I am as shocked as you are

                case Keys.LButton:
                    break;

                case Keys.RButton:
                    break;

                case Keys.MButton:
                    break;

                // Alphabetic Keys

                case Keys.S:
                    if (e.Control)
                    {
                        metaFontData.Shadowing = !metaFontData.Shadowing;
                        pbMain.Invalidate();
                    }
                    break;

                case Keys.B:
                    // Break into the debugger
                    if (e.Control && e.Shift)
                    {
                        if (!System.Diagnostics.Debugger.IsAttached)
                        {
                            return;
                        }

                        if (fScreenSaverWindowStyle)
                        {
                            ExitScreenSaverWindowStyle();
                        }

                        //if (this.WindowState != FormWindowState.Maximized) this.WindowState = FormWindowState.Normal;
                        //if (this.FormBorderStyle != System.Windows.Forms.FormBorderStyle.Sizable) this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable;
                        //if (this.TopMost != false) this.TopMost = false;

                        System.Diagnostics.Debugger.Break();
                    }
                    break;

                default:
                    break;
            }
            Logging.LogLineIf(fInputDebugTrace, "ScreenSaverForm_KeyDown(): exiting.");
        }