예제 #1
0
파일: UserSetting.cs 프로젝트: sdjc/Wox
        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);
        }
예제 #2
0
파일: UserSetting.cs 프로젝트: pluto92/Wox
        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;
        }
예제 #3
0
        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;
        }