public List <WebSearch> LoadDefaultWebSearches() { List <WebSearch> webSearches = new List <WebSearch>(); WebSearch googleWebSearch = new WebSearch() { Title = "Google", ActionWord = "g", IconPath = Directory.GetCurrentDirectory() + @"\Images\websearch\google.png", Url = "https://www.google.com/search?q={q}", Enabled = true }; webSearches.Add(googleWebSearch); WebSearch wikiWebSearch = new WebSearch() { Title = "Wikipedia", ActionWord = "wiki", IconPath = Directory.GetCurrentDirectory() + @"\Images\websearch\wiki.png", Url = "http://en.wikipedia.org/wiki/{q}", Enabled = true }; webSearches.Add(wikiWebSearch); return(webSearches); }
public List<WebSearch> LoadDefaultWebSearches() { List<WebSearch> webSearches = new List<WebSearch>(); WebSearch googleWebSearch = new WebSearch() { Title = "Google", ActionWord = "g", IconPath = Directory.GetCurrentDirectory() + @"\Images\websearch\google.png", Url = "https://www.google.com/search?q={q}", Enabled = true }; webSearches.Add(googleWebSearch); WebSearch wikiWebSearch = new WebSearch() { Title = "Wikipedia", ActionWord = "wiki", IconPath = Directory.GetCurrentDirectory() + @"\Images\websearch\wiki.png", Url = "http://en.wikipedia.org/wiki/{q}", Enabled = true }; webSearches.Add(wikiWebSearch); return webSearches; }
public void UpdateItem(WebSearch webSearch) { updateWebSearch = CommonStorage.Instance.UserSetting.WebSearches.FirstOrDefault(o => o == webSearch); if (updateWebSearch == null || string.IsNullOrEmpty(updateWebSearch.Url)) { MessageBox.Show("Invalid web search"); Close(); return; } update = true; lblAdd.Text = "Update"; tbIconPath.Text = webSearch.IconPath; ShowIcon(webSearch.IconPath); cbEnable.IsChecked = webSearch.Enabled; tbTitle.Text = webSearch.Title; tbUrl.Text = webSearch.Url; tbActionword.Text = webSearch.ActionWord; }