private async void Upload(UploadParameters P) { var credential = await Google_auth.requestUserCredentialUpload(P.ProfileName); var youtuberequest = Youtube_request.getYoutubeService(credential); var video = video_constructor.constructVideo(P.Title, P.Description, P.tags, P.category, P.PrivacyStatus); var filePath = P.path; using (var file = new FileStream(filePath, FileMode.Open)) { filesize = file.Length; var uploadRequest = youtuberequest.Videos.Insert(video, "snippet,status", file, "video/*"); uploadRequest.ProgressChanged += new Action <Google.Apis.Upload.IUploadProgress>((p) => ProgressHandler(p, uploadRequest)); uploadRequest.ResponseReceived += uploadRequest_ResponseReceived; await uploadRequest.ResumeAsync(); } }
private async void Add_Account(object sender, RoutedEventArgs e) { //MessageDialogResult result = await this.ShowMessageAsync("Hello!", "Welcome to the world of metro!",MessageDialogStyle.AffirmativeAndNegativeAndDoubleAuxiliary); //await this.ShowMessageAsync(result.ToString(),""); string ProfileName = await this.ShowInputAsync("Please enter a Profile Name", ""); if (!string.IsNullOrEmpty(ProfileName) && !doesProfileExist(ProfileName)) { await Google_auth.requestUserCredentialUpload(ProfileName); updateProfileLists(); } else { await this.ShowMessageAsync("Invalid Profile Name specified!", ""); } }