Esempio n. 1
0
        public IShellScheme Clone()
        {
            GenericShellScheme ns = new GenericShellScheme(_name, _promptExpression);

            ns._backSpaceChar = _backSpaceChar;
            ns._commandList   = _commandList;
            ns._intelliSenseItemCollection = _intelliSenseItemCollection.Clone();
            return(ns);
        }
Esempio n. 2
0
        public void ParseTests()
        {
            GenericShellScheme g = new GenericShellScheme("generic", "");

            Confirm(g.ParseCommandInput("a b c"), "a", "b", "c");
            Confirm(g.ParseCommandInput(" a  b  c "), "a", "b", "c");
            Confirm(g.ParseCommandInput("abc \"abc abc\""), "abc", "\"abc abc\"");
            Confirm(g.ParseCommandInput(" abc \"abc abc "), "abc", "\"abc abc ");
        }
Esempio n. 3
0
        private void CommandListOne(string input, params string[] expected)
        {
            GenericShellScheme g = new GenericShellScheme("generic", "");

            g.SetCommandList(input);
            IntelliSenseItemCollection col = (IntelliSenseItemCollection)g.CommandHistory;

            Confirm(col.ToStringArray(), expected);
            Assert.AreEqual(input, g.FormatCommandList()); //再フォーマット
        }
Esempio n. 4
0
 private void CommandListOne(string input, params string[] expected) {
     GenericShellScheme g = new GenericShellScheme("generic", "");
     g.SetCommandList(input);
     IntelliSenseItemCollection col = (IntelliSenseItemCollection)g.CommandHistory;
     Confirm(col.ToStringArray(), expected);
     Assert.AreEqual(input, g.FormatCommandList()); //再フォーマット
 }
Esempio n. 5
0
 public void ParseTests() {
     GenericShellScheme g = new GenericShellScheme("generic", "");
     Confirm(g.ParseCommandInput("a b c"), "a", "b", "c");
     Confirm(g.ParseCommandInput(" a  b  c "), "a", "b", "c");
     Confirm(g.ParseCommandInput("abc \"abc abc\""), "abc", "\"abc abc\"");
     Confirm(g.ParseCommandInput(" abc \"abc abc "), "abc", "\"abc abc ");
 }
Esempio n. 6
0
 public IShellScheme Clone() {
     GenericShellScheme ns = new GenericShellScheme(_name, _promptExpression);
     ns._backSpaceChar = _backSpaceChar;
     ns._commandList = _commandList;
     ns._intelliSenseItemCollection = _intelliSenseItemCollection.Clone();
     return ns;
 }
Esempio n. 7
0
        public void Load() {
            _data.Clear();
            IPreferenceFolder[] folders = _preferenceFolderArray.Folders;
            foreach (IPreferenceFolder content in folders) {
                GenericShellScheme ss = new GenericShellScheme(
                    _preferenceFolderArray.ConvertItem(content, _namePreference).AsString().Value,
                    _preferenceFolderArray.ConvertItem(content, _promptPreference).AsString().Value);
                string bs = _preferenceFolderArray.ConvertItem(content, _backspacePreference).AsString().Value;
                if (bs == "7F")
                    ss.BackSpaceChar = ss.BackSpaceChar = (char)0x7F; //TODO パースが手抜き
                ss.SetCommandList(_preferenceFolderArray.ConvertItem(content, _commandListPreference).AsString().Value);
                _data.Add(ss);
            }

            _defaultScheme = FindShellScheme(DEFAULT_SCHEME_NAME) as GenericShellScheme;

            if (_defaultScheme == null) {
                _defaultScheme = new GenericShellScheme(DEFAULT_SCHEME_NAME, GenericShellScheme.DEFAULT_PROMPT_REGEX); //なければこれで
                _data.Add(_defaultScheme);
            }
        }