Example #1
0
        private void OpenButton_Click(object sender, EventArgs e)
        {
            int            result          = -1;
            string         fileName        = null;
            OpenFileDialog openFileDialog1 = new OpenFileDialog();


            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                result   = checkType(openFileDialog1.FileName);
                fileName = openFileDialog1.FileName;
            }

            if (result == 1)
            {
                FILEITEM.ParseFileWindows(fileName, this);
            }
            if (result == 2)
            {
                StreamReader reading = File.OpenText(fileName);
                string       str     = reading.ReadLine();
                string       text    = File.ReadAllText(fileName);
                text     = text.Replace("./", str + "/");
                fileName = fileName + "_tmp";
                File.WriteAllText(fileName, text);
                FILEITEM.ParseFileLinux(fileName, this);
            }
            this.treeView.Nodes.Clear();
            this.treeView.Invalidate();


            FILEITEM.MakeTree(FILEITEM.files, null, treeView, 0);

            treeView.ExpandAll();
            isExpanded = true;
        }