Exemple #1
0
 private static void ShowSequencesClicked(object sender, EventArgs e)
 {
     if (m_sequencewindow == null)
     {
         m_sequencewindow = new SequenceWindow();
         ElementHost.EnableModelessKeyboardInterop(m_sequencewindow);
     }
     m_sequencewindow.Show();
 }
        private void NotifyiconDoubleclicked(object sender, EventArgs e)
        {
            m_sequencewindow = m_sequencewindow ?? new SequenceWindow();

            if (m_sequencewindow.IsVisible)
            {
                m_sequencewindow.Hide();
            }
            else
            {
                m_sequencewindow.Show();
                m_sequencewindow.Activate();
            }
        }
        private void NotifyiconDoubleclicked(object sender, EventArgs e)
        {
            if ((e as WinForms.MouseEventArgs).Button == WinForms.MouseButtons.Left)
            {
                m_sequencewindow = m_sequencewindow ?? new SequenceWindow();

                if (m_sequencewindow.IsVisible)
                {
                    m_sequencewindow.Hide();
                }
                else
                {
                    m_sequencewindow.Show();
                    m_sequencewindow.Activate();
                }
            }
        }
Exemple #4
0
        private static void NotifyiconDoubleclicked(object sender, EventArgs e)
        {
            if (m_sequencewindow == null)
            {
                m_sequencewindow = new SequenceWindow();
                ElementHost.EnableModelessKeyboardInterop(m_sequencewindow);
            }

            if (m_sequencewindow.IsVisible)
            {
                m_sequencewindow.Hide();
            }
            else
            {
                m_sequencewindow.Show();
            }
        }
Exemple #5
0
        private void NotifyiconDoubleclicked(object sender, EventArgs e)
        {
            if ((e as WinForms.MouseEventArgs).Button == WinForms.MouseButtons.Left)
            {
                if (m_sequencewindow == null)
                {
                    m_sequencewindow = new SequenceWindow();
                    WinForms.Integration.ElementHost.EnableModelessKeyboardInterop(m_sequencewindow);
                }

                if (m_sequencewindow.IsVisible)
                {
                    m_sequencewindow.Hide();
                }
                else
                {
                    m_sequencewindow.Show();
                }
            }
        }
Exemple #6
0
        private void OnMenuItemClicked(object parameter)
        {
            switch (parameter as MenuCommand?)
            {
            case MenuCommand.ShowSequences:
                if (m_sequencewindow == null)
                {
                    m_sequencewindow = new SequenceWindow();
                    WinForms.Integration.ElementHost.EnableModelessKeyboardInterop(m_sequencewindow);
                }
                m_sequencewindow.Show();
                m_sequencewindow.Activate();
                break;

            case MenuCommand.ShowOptions:
                if (m_optionswindow == null)
                {
                    m_optionswindow = new SettingsWindow();
                    WinForms.Integration.ElementHost.EnableModelessKeyboardInterop(m_optionswindow);
                }
                m_optionswindow.Show();
                m_optionswindow.Activate();
                break;

            case MenuCommand.DebugWindow:
                if (m_debugwindow == null)
                {
                    m_debugwindow = new DebugWindow();
                }
                m_debugwindow.Show();
                m_debugwindow.Activate();
                break;

            case MenuCommand.About:
                var about_box = new AboutBox();
                about_box.ShowDialog();
                break;

            case MenuCommand.Download:
                var url = Settings.IsInstalled() ? Updater.Get("Installer")
                                                     : Updater.Get("Portable");
                System.Diagnostics.Process.Start(url);
                break;

            case MenuCommand.VisitWebsite:
                System.Diagnostics.Process.Start("http://wincompose.info/");
                break;

            case MenuCommand.Disable:
                if (Composer.IsDisabled)
                {
                    m_control.TriggerDisableEvent();
                }
                Composer.ToggleDisabled();
                SysTrayUpdateCallback(null, new EventArgs());
                break;

            case MenuCommand.Restart:
                // FIXME: there might be more cleanup to do here; but it’s probably
                // not worth it, because restarting the app is a hack and whatever
                // reason the user may have, it’s because of a bug or a limitation
                // in WinCompose that we need to fix.
                m_icon.Visible = false;
                WinForms.Application.Restart();
                Environment.Exit(0);
                break;

            case MenuCommand.Exit:
                WinForms.Application.Exit();
                break;
            }
        }
Exemple #7
0
 private static void ShowSequencesClicked(object sender, EventArgs e)
 {
     if (m_sequencewindow == null)
     {
         m_sequencewindow = new SequenceWindow();
         ElementHost.EnableModelessKeyboardInterop(m_sequencewindow);
     }
     m_sequencewindow.Show();
 }
Exemple #8
0
        private static void NotifyiconDoubleclicked(object sender, EventArgs e)
        {
            if (m_sequencewindow == null)
            {
                m_sequencewindow = new SequenceWindow();
                ElementHost.EnableModelessKeyboardInterop(m_sequencewindow);
            }

            if (m_sequencewindow.IsVisible)
            {
                m_sequencewindow.Hide();
            }
            else
            {
                m_sequencewindow.Show();
            }
        }