public void SetPageData(string Name, string Data) { curGroup = CurrentGroup; string n = ""; StripGroup(Name, ref curGroup, ref n); string pn = curGroup + WikiGroupSeparator + n; string fn = GetFilePath(curGroup, n); if (Data == "" || Data == "delete") { SortedStringList curLinks = new SortedStringList(); curLinks.Load(fn + ExtWikiLinks); foreach (string x in curLinks) { SortedStringList newLinks = new SortedStringList(); string fn1 = dataDir + FileNameSafe(x) + ExtWikiBackLinks; newLinks.Load(fn1); newLinks.Remove(pn); newLinks.Save(fn1); } File.Delete(fn + ExtWikiData); File.Delete(fn + ExtWikiLinks); } else { //TODO: encoding setting using (StreamWriter sw = new StreamWriter(fn + ExtWikiData, false, Encoding.UTF8)) sw.Write(Data); //assert links loaded from previous render //load previous first SortedStringList curLinks = new SortedStringList(); curLinks.Load(fn + ExtWikiLinks); //save new links.Save(fn + ExtWikiLinks); //add new backreferences foreach (string x in links) { if (!curLinks.Remove(x)) { SortedStringList newLinks = new SortedStringList(); string fn1 = dataDir + FileNameSafe(x) + ExtWikiBackLinks; newLinks.Load(fn1); newLinks.Add(pn); newLinks.Save(fn1); } } //remove old backreferences foreach (string x in curLinks) { SortedStringList newLinks = new SortedStringList(); string fn1 = dataDir + FileNameSafe(x) + ExtWikiBackLinks; newLinks.Load(fn1); newLinks.Remove(pn); newLinks.Save(fn1); } } }
internal SortedStringListEnumerator(SortedStringList list) { this.list = list; this.index = 0; this.current = default(string); }