public void AddFrecency(string canonicalPath) { FrecencyEntry frecencyEntry = null; if (!frecencyEntries.TryGetValue(canonicalPath, out frecencyEntry)) { frecencyEntry = frecencyEntries[canonicalPath] = new FrecencyEntry(canonicalPath); } frecencyEntry.WasLaunched(); }
public void UnserializeFrecencyEntries(XElement frecencyRoot) { frecencyEntries.Clear(); if (frecencyRoot == null) return; foreach(var frecEntry in frecencyRoot.Elements("Entry")) { var nLaunches = int.Parse(frecEntry.Attribute("N").Value, CultureInfo.InvariantCulture); var lastLaunch = DateTime.Parse(frecEntry.Attribute("LL").Value, CultureInfo.InvariantCulture); var path = frecEntry.Attribute("Path").Value; frecencyEntries[path] = new FrecencyEntry(path, nLaunches, lastLaunch); } }