示例#1
0
文件: Dispatcher.cs 项目: seanofw/joy
        public void AboutCommand()
        {
            BetterMessageBox.Caption("About Joy")
            .Message(@"Joy v1.0

An Integrated Development Environment (IDE) for the Smile Programming Language.

Copyright (c) 2019 by Sean Werkema.  All rights reserved.

Licenses:
- The Smile runtime is licensed under the Apache 2.0 license.
- Sean's Dialog Icons are in the public domain.
- Joy and all other components below are licensed under the MIT license.

Libraries and tools used by Joy:
- C# and .NET 4.5 (by Microsoft)
- Windows Forms (by Microsoft)
- System.Collections.Immutable (by Microsoft)
- Scintilla.NET: https://github.com/jacobslusser/ScintillaNET (by Jacob Slusser)
- DockPanel Suite: http://dockpanelsuite.com (by Weifen Luo)
- Cyotek ColorPicker control:
   https://github.com/cyotek/Cyotek.Windows.Forms.ColorPicker (by Richard Moss)
- Json.NET: https://www.newtonsoft.com/json (by Newtonsoft)
- BetterControls: https://github.com/seanofw/better-controls (by Sean Werkema)
- Sean's Dialog Icons: https://github.com/seanofw/icons (by Sean Werkema)
- Smile: https://smile.dev (by Sean Werkema)

For help with Smile, please visit https://smile.dev ; for help with Joy, please
visit https://github.com/seanofw/joy .")
            .Button("Joy!", DialogResult.OK, true)
            .Owner(MainForm)
            .Image(_joyIcon)
            .Show();
        }
示例#2
0
        public void ApplyChanges()
        {
            bool needsRestart = false;

            if (AppConfig.Theme != Configurator.AppConfig.Theme)
            {
                needsRestart = true;
            }

            Configurator.AppConfig        = AppConfig;
            Configurator.TextEditorConfig = TextEditorConfig;
            Configurator.StyleConfig      = StyleConfig;

            if (needsRestart)
            {
                DialogResult result = BetterMessageBox.Caption("Joy")
                                      .Message("You must restart Joy to apply these changes.")
                                      .Owner(this)
                                      .Button("Restart now", DialogResult.OK, true)
                                      .Button("Later", DialogResult.Cancel)
                                      .StandardImage(StandardImageKind.Warning)
                                      .Show();
                if (result == DialogResult.OK)
                {
                    Close();
                    Dispatcher.Restart();
                }
            }
        }
示例#3
0
 private void DarkThemeButton_Click(object sender, EventArgs e)
 {
     if (BetterMessageBox.Owner(this)
         .Message("You are about to replace all of your current text\r\n"
                  + "styles with the default \"dark\" color scheme.\r\n"
                  + "Are you sure you want to do this?\r\n")
         .Button("OK", DialogResult.OK, true)
         .Button("Cancel", DialogResult.Cancel)
         .Caption("Warning")
         .StandardImage(StandardImageKind.Warning)
         .Show() == DialogResult.OK)
     {
         StyleConfig = new StyleConfig(DefaultStyles.DarkTheme);
         PopulateColorEditorUI(StyleConfig);
     }
 }