示例#1
0
        private void tsbEdit_Click(object sender, EventArgs e)
        {
            string disPath = op.DistPath;

            if (!Directory.Exists(disPath))
            {
                this.ShowAlert("无对应资源,请执行【开始】汉化后再操作");
                return;
            }
            string[] distFileName = op.GetFileName(disPath);
            if (distFileName.Length < 1)
            {
                return;
            }
            var dataL = (from i in distFileName
                         select new
            {
                Name = Path.GetFileName(i),
                Id = i
            }).ToList();

            this.splitContainer1.Visible  = dataL.Count > 0;
            this.tvFileName.ShowRootLines = true;
            this.tvFileName.Nodes.Clear();
            var root = this.tvFileName.Nodes.Add("中文资源文件列表");

            foreach (var item in dataL)
            {
                TreeNode tn = new TreeNode();
                tn.Name = item.Id;
                tn.Text = item.Name;
                root.Nodes.Add(tn);
                if (root.Nodes.Count == 1)
                {
                    this.tvFileName.SelectedNode = tn;
                }
            }
            root.Expand();
            this.tvFileName.Focus();
        }