public static void ShortenURL(string url, UrlShortenerType urlShortener) { if (!string.IsNullOrEmpty(url)) { TaskSettings taskSettings = TaskSettings.GetDefaultTaskSettings(); taskSettings.URLShortenerDestination = urlShortener; WorkerTask task = WorkerTask.CreateURLShortenerTask(url, taskSettings); TaskManager.Start(task); } }
public static void ShortenURL(string url, TaskSettings taskSettings = null) { if (!string.IsNullOrEmpty(url)) { if (taskSettings == null) { taskSettings = TaskSettings.GetDefaultTaskSettings(); } WorkerTask task = WorkerTask.CreateURLShortenerTask(url, taskSettings); TaskManager.Start(task); } }