public void AddDictFile(string newChannel, string parentChannel) { if (this.DictFiles.ContainsKey(newChannel)) { Debug.Fail(newChannel + " is Exist!"); return; } JDictionary jd = new JDictionary(); string newdir; string newsubdir = Utility.File.GetLimitDirectory(this.RootDir, this.FileCountForDir, out newdir); string newFileName = newsubdir + newChannel + "." + JDictionaryType.ToString(); string newFileFullName = Path.Combine(this.RootDir, newFileName); Directory.CreateDirectory(newdir); FileStream fs = File.Create(newFileFullName); fs.Close(); fs.Dispose(); jd.FileInfo = new FileInfo(newFileFullName); XmlNode parentNode; if (string.IsNullOrEmpty(parentChannel)) { parentNode = this.InnerDocument.DocumentElement; } else { parentNode = this.InnerDocument.DocumentElement. SelectSingleNode(string.Format(".//dictfile[@channel='{0}']", parentChannel)); if (parentNode == null) { Debug.Fail(parentChannel + " isn't Exist!!!"); parentNode = this.InnerDocument.DocumentElement; } } XmlElement ele = this.InnerDocument.CreateElement("dictfile"); ele.SetAttribute("channel", newChannel); ele.InnerText = newFileName; parentNode.AppendChild(ele); jd.Save(); this.DictFiles.Add(newChannel, new FileInfo(newFileFullName)); }