public static void Load() { try { string[] text = Filesystem.FileReadAllLines(Filesystem.UserProfile + "\\Popup Multibox\\prefs.txt"); MultiboxWidth = int.Parse(text[0]); ResultHeight = int.Parse(text[1]); AutoCheckUpdate = bool.Parse(text[2]); AutoCheckFrequency = int.Parse(text[3]); } catch { } }
public static void Load() { try { string[] lines = Filesystem.FileReadAllLines(Filesystem.UserProfile + "\\Popup Multibox\\bookmarks.txt"); items.Clear(); foreach (string line in lines) { BookmarkItem tmp = BookmarkItem.FromFileString(line); if (tmp != null) { items.Add(tmp); } } items.Sort(); } catch { } }
public static void Load() { try { string[] lines = Filesystem.FileReadAllLines(Filesystem.UserProfile + "\\Popup Multibox\\searches.txt"); items.Clear(); foreach (string line in lines) { SearchItem tmp = SearchItem.FromFileString(line); if (tmp != null) { items.Add(tmp); } } } catch { try { List <string> lines = new List <string>(0); lines.Add("Google;;;google;;;http://www.google.com/search?q=%s"); lines.Add("Yahoo!;;;yahoo;;;http://search.yahoo.com/search?fr=crmas&p=%s"); lines.Add("Bing;;;bing;;;http://www.bing.com/search?q=%s"); lines.Add("Wikipedia;;;wiki;;;http://en.wikipedia.org/w/index.php?title=Special:Search&search=%s"); if (!Filesystem.DirectoryExists(Filesystem.UserProfile + "\\Popup Multibox")) { Filesystem.CreateDirectory(Filesystem.UserProfile + "\\Popup Multibox"); } Filesystem.FileWriteAllLines(Filesystem.UserProfile + "\\Popup Multibox\\searches.txt", lines.ToArray()); items.Clear(); foreach (string line in lines) { SearchItem tmp = SearchItem.FromFileString(line); if (tmp != null) { items.Add(tmp); } } } catch { } } }