Beispiel #1
0
        private void listBox1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            PathAnalyser pathanalyser = LsKeyword.getThis().getPathAnalyser();

            string s = (string)this.listBox1.Items[listBox1.SelectedIndex];

            if (s == "..")
            {
                s = pathanalyser.getParentPath(currentpath);
            }
            else
            {
                s = currentpath + "\\" + s;
            }

            if (s == null)
            {
                return;
            }
            if (File.Exists(s))
            {
                return;
            }

            onOpenPath(s);
        }
Beispiel #2
0
        void onOpenPath(string path)
        {
            if (path.EndsWith(":"))
            {
                path += "\\";
            }

            if (currentpath == path)
            {
                return;
            }

            PathAnalyser pathanalyser = LsKeyword.getThis().getPathAnalyser();

            pathanalyser.openPath(path, true, -1);

            //currentpath = path;
            setCurrentPath(path);

            //
            listBox1.Items.Clear();
            ArrayList als = pathanalyser.listPath(path);

            foreach (string s in als)
            {
                listBox1.Items.Add(s);
            }
        }
Beispiel #3
0
        void onSearch(string keys)
        {
            PathAnalyser pathanalyser = LsKeyword.getThis().getPathAnalyser();

            HashSet <string> hss = pathanalyser.search(keys);

            if (hss.Count > 0)
            {
                ResultForm rf = new ResultForm();
                rf.Show();
                rf.showList(hss);
                rf.Activate();
            }
        }
Beispiel #4
0
        public void loadFile()
        {
            if (pathfile == null || pathfile.Length == 0)
            {
                return;
            }

            ArrayList als = this.readFile(pathfile);

            // proc relative path;
            Hashtable hss = new Hashtable();
            string    str;
            string    rpath = relativepath + "\\";

            for (int i = 0; i < als.Count; i++)
            {
                string s = (string)als[i];
                str = s;
                if (s[0] == '\\')
                {
                    str = relativepath + s;
                }
                else if (s[0] == '.')
                {
                    str = relativepath + s.Substring(1, s.Length - 1);
                    //str = s.Replace(
                }
                //Int32 it2 = (Int32)alslinenum[i];
                hss.Add(str, (Int32)alslinenum[i]);
            }

            //
            PathAnalyser pas = LsKeyword.getThis().getPathAnalyser();

            pas.reset();

            pas.openPath(relativepath, true, -1);
            foreach (DictionaryEntry de in hss)
            {
                //Int32 it = (Int32)de.Value;
                pas.openPath((string)de.Key, false, (Int32)de.Value);
            }
            //LsKeyword.getThis().getSearchForm().showList(hss);
        }