private void LoadVideoList(Viddler.ViddlerService viddlerService) { this.fileComboBox.Items.Clear(); Viddler.Data.VideoList videoList = viddlerService.Videos.GetByUser(); if (videoList != null && videoList.Items != null && videoList.Items.Count > 0) { foreach (Viddler.Data.Video video in videoList.Items) { this.fileComboBox.Items.Add(new VideoListItem(video)); } if (this.fileComboBox.Items.Count > 0) { this.fileComboBox.SelectedIndex = 0; this.filePropertyGrid.SelectedObject = ((VideoListItem)this.fileComboBox.SelectedItem); this.actionPanel.ShowButton.Enabled = true; this.actionPanel.RemoveButton.Enabled = true; this.actionPanel.UpdateButton.Enabled = true; return; } } this.filePropertyGrid.SelectedObject = null; this.actionPanel.ShowButton.Enabled = false; this.actionPanel.RemoveButton.Enabled = false; this.actionPanel.UpdateButton.Enabled = false; }
internal VideoListItem(Viddler.Data.Video video) { this.Title = video.Title; this.Url = new Uri(video.Url); this.UploadTime = (video.UploadTime.HasValue) ? video.UploadTime.Value.DateTime : DateTime.MinValue; this.Author = video.Author; this.Description = video.Description; this.Id = video.Id; this.Status = video.Status.ToString(); if (video.Permission != null) { if (video.Permission.View != null) this.SecurityView = video.Permission.View.Level.ToString(); if (video.Permission.Download != null) this.SecurityDownload = video.Permission.Download.Level.ToString(); if (video.Permission.Commenting != null) this.SecurityCommenting = video.Permission.Commenting.Level.ToString(); if (video.Permission.Embed != null) this.SecurityEmbed = video.Permission.Embed.Level.ToString(); if (video.Permission.Tagging != null) this.SecurityTagging = video.Permission.Tagging.Level.ToString(); if (video.Permission.SecretUrl != null) this.SecretUrl = new Uri(video.Permission.SecretUrl); } }
private void viddlerService_BeginRequest(object sender, Viddler.ViddlerRequestEventArgs e) { this.WriteOutputText("BEGIN: "); this.WriteOutputText(e.ContractType.ToString()); this.WriteOutputText("\r\n------------------------------\r\n"); }
private void viddlerService_Error(object sender, Viddler.ViddlerRequestErrorEventArgs e) { this.WriteOutputText("ERROR: "); this.WriteOutputText(e.ContractType.ToString()); this.WriteOutputText("\r\n------------------------------\r\n"); this.WriteOutputText(e.Exception.Message); this.WriteOutputText("\r\n------------------------------\r\n"); //this.WriteOutputText(e.Exception.ToString()); //this.WriteOutputText("\r\n------------------------------\r\n"); }
private void viddlerService_Uploading(object sender, Viddler.ViddlerRequestUploadEventArgs e) { this.actionPanel.SetUploadProgress((int)(e.BytesSent * this.actionPanel.ProgressBar.Maximum / e.TotalBytes), true); if (this.isCancel) { e.Cancel = true; this.isCancel = false; this.WriteOutputText("UPLOAD ABORTED\r\n------------------------------\r\n"); } }