private void btnDone_Click(object sender, RoutedEventArgs e) { foreach (var contr in this.grdOutter.Children) { TextBox control = contr as TextBox; if (control != null) { control.Background = (Brush)this.Resources["TextboxNormalKey"]; control.Foreground = (Brush)this.Resources["TextboxNormalTextKey"]; } } ServerDetails = new StardogServerDetails( this.txtServer.Text, this.txtOnt.Text, this.txtUser.Text, this.txtPassword.Text); List <string> controlsInError; if (ServerDetails.Valid(out controlsInError)) { this.DialogResult = true; this.Close(); } else { foreach (string contr in controlsInError) { TextBox control = (TextBox)this.FindName(contr);//it's all textboxes control.Background = (Brush)this.Resources["TextboxErrorKey"]; control.Foreground = (Brush)this.Resources["TextboxErrorTextKey"]; control.Focus(); } } }
private object loadSchedule(StardogServerDetails serverDetails) { theDataSource = new StarDogLinkedDataSource(serverDetails); scheduleGraph = theDataSource.GetSparlAsGraph(Properties.Settings.Default.selectServices); populateServiceListFromGraph(scheduleGraph); // schedules = SchedulesCollection.CreateFromSparql(theDataSource.Query(Properties.Settings.Default.selectServices)) as SchedulesCollection; return(null); }
private void btnLoad_Click(object sender, RoutedEventArgs e) { StardogServerDetails serverDetails = frmStardogDetails.GetServerDetails(); List <string> notUsed; if (serverDetails.Valid(out notUsed)) { System.Threading.Tasks.Task.Factory.StartNew(() => this.loadSchedule(serverDetails), CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.AttachedToParent, System.Threading.Tasks.TaskScheduler.Current); } }