Пример #1
0
        public SearchInOptions(MainForm view, XabslBehavior behavior, string initialFindText)
        {
            InitializeComponent();

              if (behavior == null)
              {
            // who the ...
            Exception ex = new Exception("passed a null-object as behavior to SearchInOptions-dialog");
            throw ex;
              }

              if (initialFindText != null)
              {
            textBoxFind.Text = initialFindText;
              }

              _view = view;
              _behavior = behavior;
        }
Пример #2
0
        private void openBehavior(DirectoryInfo behaviorDir)
        {
            try
              {
            resetHistory();

            _curBehavior = new XabslBehavior(behaviorDir.FullName);

            if(_curBehavior.IsLoaded)
            {
              // add to list of recent behaviors
              List<string> newList = new List<string>();
              newList.Add(_curBehavior.Dir.FullName);
              int i = 1;
              foreach (string s in _recentBehaviors)
              {
            if (i < 6 && s != _curBehavior.Dir.FullName)
            {
              newList.Add(s);
              i++;
            }
              }
              _recentBehaviors = newList;
              updateRecentBehaviors();

              // just for the case...
              saveConf();

              recentBehaviorsToolStripMenuItem.Enabled = true;

              this.Text = "XabslEditor - " + _curBehavior.BehaviorName;

              // close all tabs
              _tabs.Clear();
              tabControlEditor.TabPages.Clear();

              findOptionsAndSymbols();
              toolStripStatusLabel.Text = "";
              dropDownButtonOption.Text = "(choose an option)";
              enableGraphicalEnviroment(false);
              clearCacheToolStripMenuItem.Enabled = true;
              searchInAllOptionsToolStripMenuItem.Enabled = buttonSearchInOptions.Enabled
            = true;
              configurationToolStripMenuItem.Enabled = true;

              CreateNewTab();
            }
              }
              catch (Exception ex)
              {
            ExceptionDialog.ShowError(ex);
              }
        }