public static ISite CreateSiteInstance(Site site) { ISite siteInstance = null; switch (site) { case Site.Wiki: siteInstance = new VocaloWiki(); break; case Site.UtaTen: siteInstance = new UtaTen(); break; case Site.JLyric: siteInstance = new JLyric(); break; default: break; } return(siteInstance); }
/// <summary> /// 曲名で検索を行って結果をダイアログで表示する /// </summary> /// <param name="word"></param> private void Search(string word) { ISite site = null; if (btnWiki.Checked) { site = new VocaloWiki(); } else if (btnUtaten.Checked) { site = new UtaTen(); } else if (btnJLyric.Checked) { site = new JLyric(); } var list = site.GetList(word); SearchResult f = new SearchResult(this, list, txtUrl.Text); f.Show(); }