예제 #1
0
파일: Duh.cs 프로젝트: nextLane/Duh
        public void OnImport()
        {
            var trieDictionary     = new HashSet <string>();
            var assembly           = Assembly.GetExecutingAssembly();
            var stdGitCommandsFile = "GitCommonStdCommands.txt";
            var resourcePrefix     = "Duh.Resources.";

            //Loading up all the default standard Git Commands in the trie
            using (Stream stream = assembly.GetManifestResourceStream(string.Concat(resourcePrefix, stdGitCommandsFile)))
                using (StreamReader reader = new StreamReader(stream)) {
                    while (reader.Peek() != -1)
                    {
                        var val = reader.ReadLine();
                        trieDictionary.Add(val);
                    }
                }


            var commandsToBeAdded = PowershellHelperClass.GetFrequentHistoryCommands();
            var trieWords         = trieDictionary.ToList <string>().Concat(commandsToBeAdded.ToList <string>());

            Trie.LoadTrie(trieWords);
            var list = new List <Node>();

            list.Add(Trie._root);
        }
예제 #2
0
파일: Duh.cs 프로젝트: nextLane/Duh
        protected override void ProcessRecord()
        {
            Trie.LoadTrie(PowershellHelperClass.GetFrequentHistoryCommands());
            var list = new List <Node>();

            list.Add(Trie._root);
        }