Esempio n. 1
0
        /// <summary>
        /// 初始化替换树
        /// </summary>
        /// <param name="menpaiName">地图名</param>
        /// <param name="strFind">查找的字符串</param>
        /// <param name="strReplace">替换的字符串</param>
        private void InitTreeReplace(string menpaiName, string strFind, string strReplace)
        {
            Hashtable        ht_data       = new Hashtable();
            TreeReplaceOpera tro           = new TreeReplaceOpera();
            Hashtable        ht_filelist   = new Hashtable();
            ArrayList        al_fileIDlist = new ArrayList();

            if (!string.IsNullOrEmpty(strFind) && !findTextList.Contains(strFind))
            {
                findTextList.Add(strFind);
            }

            if (!string.IsNullOrEmpty(strReplace) && !replaceTextList.Contains(strReplace))
            {
                replaceTextList.Add(strReplace);
            }

            if (menpaiName != m_strAllMaps)
            {
                ht_filelist = this.m_parent.getFileListFromPath("scripts\\Map\\" + menpaiName);
            }
            else
            {
                ht_filelist = this.m_parent.getFileListFromPath("scripts");
            }

            ht_data["filelist"] = ht_filelist;
            ht_data["find"]     = strFind;
            ht_data["replace"]  = strReplace;
            TreeNodeCollection tnc = tro.LoadTreeNodeCollection(ht_data);

            treePreview.Nodes.Clear();

            foreach (TreeNode tn in tnc)
            {
                this.treePreview.Nodes.Add(tn);
            }

            if (tnc.Count > 0)
            {
                btnReplace.Enabled = true;
            }

            wbPriview.DocumentText = "";

            InitComboBox();
        }
Esempio n. 2
0
        /// <summary>
        /// 初始化替换树
        /// </summary>
        /// <param name="menpaiName">地图名</param>
        /// <param name="strFind">查找的字符串</param>
        /// <param name="strReplace">替换的字符串</param>
        private void InitTreeReplace(string menpaiName, string strFind, string strReplace)
        {
            Hashtable ht_data = new Hashtable();
            TreeReplaceOpera tro = new TreeReplaceOpera();
            Hashtable ht_filelist = new Hashtable();
            ArrayList al_fileIDlist = new ArrayList();

            if (!string.IsNullOrEmpty(strFind) && !findTextList.Contains(strFind))
            {
                findTextList.Add(strFind);
            }

            if (!string.IsNullOrEmpty(strReplace) && !replaceTextList.Contains(strReplace))
            {
                replaceTextList.Add(strReplace);
            }

            if (menpaiName != m_strAllMaps)
            {
                ht_filelist = this.m_parent.getFileListFromPath("scripts\\Map\\" + menpaiName);
            }
            else
            {
                ht_filelist = this.m_parent.getFileListFromPath("scripts");
            }

            ht_data["filelist"] = ht_filelist;
            ht_data["find"] = strFind;
            ht_data["replace"] = strReplace;
            TreeNodeCollection tnc = tro.LoadTreeNodeCollection(ht_data);
            treePreview.Nodes.Clear();

            foreach (TreeNode tn in tnc)
            {
                this.treePreview.Nodes.Add(tn);
            }

            if (tnc.Count > 0)
            {
                btnReplace.Enabled = true;
            }

            wbPriview.DocumentText = "";

            InitComboBox();
        }