Esempio n. 1
0
    // Bitmap tbBmp = null;
    #endregion

    #region " StartUp/CleanUp "
    void CommandMenuInit()
    {
        if(textMonitor == null)
            textMonitor = new TextMonitor(this);
        if (scriptRunner == null)
            scriptRunner = new ScriptRunner(this);
        if (settings == null)
            settings = LoadSettings();

      SetCommand(0, "Run Ruby Script(This File)", runTestClass, new ShortcutKey(true, false, true, Keys.Y));
      SetCommand(1, "Run Test (Single Method)", runTestMethod, new ShortcutKey(true, false, true, Keys.T));
      SetCommand(2, "---", null);
      SetCommand(3, "Toggle Output Window", toggleOutputDialog, new ShortcutKey(true, false, true, Keys.R)); idOutputDlg = 1;
      SetCommand(4, "Toggle Auto-Insert 'end's", toggleInsertEnds, settings.InsertEnds); idOutputDlg = 1;
      SetCommand(5, "---", null);
      SetCommand(6, "Settings...", showSettings);
    }
Esempio n. 2
0
    private Settings LoadSettings()
    {
        var settings = new Settings();
        try
        {
            var iniFilePath = GetSettingsFile();
            var returnString = new StringBuilder(Win32.MAX_PATH);

            Win32.GetPrivateProfileString("RubyWow", "RubyPath", "", returnString, Win32.MAX_PATH, iniFilePath);
            settings.RubyPath = returnString.ToString();

            Win32.GetPrivateProfileString("RubyWow", "InsertEnds", "1", returnString, Win32.MAX_PATH, iniFilePath);
            settings.InsertEnds = returnString.ToString() == "1";
        }
        catch (Exception ex)
        {
            MessageBox.Show("Error loading settings. " + ex.Message, "Ruby. Boo!", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
        return settings;
    }