/// <summary> /// Agent that runs a scheduled task /// </summary> /// <param name="task"> /// The invoked task /// </param> /// <remarks> /// This method is called when a periodic or resource intensive task is invoked /// </remarks> protected override void OnInvoke(ScheduledTask task) { var h = new OAuthMessageHandler(new HttpClientHandler()); HttpClient client = new HttpClient(); client.BaseAddress = new Uri("https://api-content.dropbox.com/1/dropbox/"); string toastMessage = "Upload started"; ShellToast toast = new ShellToast(); toast.Title = "Auto Upload"; toast.Content = toastMessage; toast.Show(); PostFile(client); }