private static void RemoveDoFile_Executed(object target, ExecutedRoutedEventArgs e) { DCSInterfaceEditor editor = target as DCSInterfaceEditor; string file = e.Parameter as string; if (editor != null && !string.IsNullOrWhiteSpace(file) && editor.Configuration.DoFiles.Contains(file)) { editor.Configuration.DoFiles.Remove(file); } }
private static void AddDoFile_Executed(object target, ExecutedRoutedEventArgs e) { DCSInterfaceEditor editor = target as DCSInterfaceEditor; TextBox newDoFile = (TextBox)e.Parameter; string file = newDoFile.Text; if (editor != null && !string.IsNullOrWhiteSpace(file) && !editor.Configuration.DoFiles.Contains(file)) { editor.Configuration.DoFiles.Add(file); newDoFile.Text = ""; } }