static public IShortenService GetShortenService(string selectedItemText) { IShortenService Output = null; switch (selectedItemText) { case "bit.ly": Output = new bitly(); break; case "is.gd": Output = new isgd(); break; case "Su.pr": Output = new Supr(); break; case "TinyURL": Output = new TinyURL(); break; case "tr.im": Output = new trim(); break; default: break; } return(Output); }
public Controller(Form1 form) { _form = form; _selectedService = new isgd(); //Set the default service }
public void PerferredServiceChanged(ToolStripItem selectedServiceItem) { SetServiceMenuItemCheck(selectedServiceItem); _selectedService = ShortenServiceFactory.GetShortenService(selectedServiceItem.Text); }
public ShortenController(IShortenService shortenService, IRepository <ShortenedUrl> urlRepository, IMapper mapper) { _shortenService = shortenService; _urlRepository = urlRepository; _mapper = mapper; }