private void btnIncludeDirectory_Click(object sender, RoutedEventArgs e) { var folderDialog = new FolderBrowserDialog(); folderDialog.SelectedPath = YouTube_Uploader.Properties.Settings.Default.IncludeFolder; DialogResult result = folderDialog.ShowDialog(); if (result.ToString() == "OK") { var VideoList = new VideoWatcher(folderDialog.SelectedPath); txtDirectory.Text = folderDialog.SelectedPath; VideoList.Refresh(listVideosView); } }
public MainWindow() { InitializeComponent(); /*Default Button states*/ lblBadCredentials.Visibility = Visibility.Hidden; lblLoginSuccess.Visibility = Visibility.Hidden; /*Stored field data*/ txtDirectory.Text = StoredVariables.IncludeDirectory; txtLogin.Text = StoredVariables.Login; passwordBox1.Password = StoredVariables.Password; /*Event handler for saving values when application closes*/ System.Windows.Application.Current.MainWindow.Closing += new System.ComponentModel.CancelEventHandler(MainWindow_Closing); /*Stored directory for Videos*/ var VideoList = new VideoWatcher(StoredVariables.IncludeDirectory); VideoList.Refresh(listVideosView); DataContext = VideoList.DataContext(); }
void Upload_AsyncOperationCompleted(object sender, AsyncOperationCompletedEventArgs e) { //(e.Entry as YouTubeEntry).VideoId; if (!String.IsNullOrEmpty((e.Entry as YouTubeEntry).VideoId)) { button1.IsEnabled = true; var procstatus = (e.Entry as YouTubeEntry).State.Name; //Processing - use later var actstatus = (e.Entry as YouTubeEntry).State.Value; //Actual status - use later var name = textBox1.Text; //Filename listVideosView.IsEnabled = true; StoredVariables.SetFilename(name); StoredVariables.SetYoutube_ID( (e.Entry as YouTubeEntry).VideoId ); StoredVariables.SetYoutube_Status((e.Entry as YouTubeEntry).State.Value); var VideoList = new VideoWatcher(StoredVariables.IncludeDirectory); VideoList.Refresh(listVideosView); } }