ToggleDisabled() public static méthode

Toggle the disabled state
public static ToggleDisabled ( ) : void
Résultat void
Exemple #1
0
 private static void OnDisableEvent(object sender, EventArgs e)
 {
     if (!Composer.IsDisabled())
     {
         Composer.ToggleDisabled();
     }
 }
Exemple #2
0
 private void OnDisableEvent(object sender, EventArgs e)
 {
     if (!Composer.IsDisabled)
     {
         Composer.ToggleDisabled();
     }
     PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("IsDisabled"));
 }
 private void OnDisableEvent()
 {
     if (!Composer.IsDisabled)
     {
         Composer.ToggleDisabled();
     }
     SysTrayUpdateCallback();
 }
 private void OnDisableEvent()
 {
     if (!Composer.IsDisabled)
     {
         Composer.ToggleDisabled();
     }
     MarkIconDirty();
 }
Exemple #5
0
        private static void DisableClicked(object sender, EventArgs e)
        {
            if (Composer.IsDisabled())
            {
                m_control.TriggerDisableEvent();
            }

            Composer.ToggleDisabled();
        }
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;
            }
        }
        private void OnMenuItemClicked(object parameter)
        {
            switch (parameter as MenuCommand?)
            {
            case MenuCommand.ShowSequences:
                m_sequencewindow = m_sequencewindow ?? new SequenceWindow();
                m_sequencewindow.Show();
                m_sequencewindow.Activate();
                break;

            case MenuCommand.ShowOptions:
                m_optionswindow = m_optionswindow ?? new SettingsWindow();
                m_optionswindow.Show();
                m_optionswindow.Activate();
                break;

            case MenuCommand.DebugWindow:
                m_debugwindow = m_debugwindow ?? new DebugWindow();
                m_debugwindow.Show();
                m_debugwindow.Activate();
                break;

            case MenuCommand.About:
                m_about_box = m_about_box ?? new AboutBox();
                m_about_box.Show();
                m_about_box.Activate();
                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.DonationPage:
                System.Diagnostics.Process.Start("http://wincompose.info/donate/");
                break;

            case MenuCommand.Disable:
                if (Composer.IsDisabled)
                {
                    Application.RemoteControl.BroadcastDisableEvent();
                }
                Composer.ToggleDisabled();
                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;
                Application.Current.Shutdown();
                WinForms.Application.Restart();
                Environment.Exit(0);
                break;

            case MenuCommand.Exit:
                Application.Current.Shutdown();
                break;
            }
        }
        private void OnCommand(object o)
        {
            switch (o as MenuCommand?)
            {
            case MenuCommand.ShowSequences:
                m_sequencewindow = m_sequencewindow ?? new SequenceWindow();
                m_sequencewindow.Show();
                m_sequencewindow.Activate();
                break;

            case MenuCommand.ShowOptions:
                m_optionswindow = m_optionswindow ?? new SettingsWindow();
                m_optionswindow.Show();
                m_optionswindow.Activate();
                break;

            case MenuCommand.DebugWindow:
                m_debugwindow = m_debugwindow ?? new DebugWindow();
                m_debugwindow.Show();
                m_debugwindow.Activate();
                break;

            case MenuCommand.About:
                m_about_box = m_about_box ?? new AboutBox();
                m_about_box.Show();
                m_about_box.Activate();
                break;

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

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

            case MenuCommand.DonationPage:
                Process.Start("http://wincompose.info/donate/");
                break;

            case MenuCommand.Disable:
                if (Composer.IsDisabled)
                {
                    Application.RemoteControl.BroadcastDisableEvent();
                }
                Composer.ToggleDisabled();
                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.
                Visibility = Visibility.Collapsed;
                Application.Current.Exit += (s, e) => Process.Start(Application.ResourceAssembly.Location);
                Application.Current.Shutdown();
                break;

            case MenuCommand.Exit:
                Application.Current.Shutdown();
                break;
            }
        }