private void AddApplicationItemToList(AppItem item_to_add_p) { // Add a new application to the startup list. AppListBoxItem temp_app_list_box_item = new AppListBoxItem(); temp_app_list_box_item.AppTitle = item_to_add_p.AppTitle; temp_app_list_box_item.AppPath = item_to_add_p.AppPath; temp_app_list_box_item.AppIcon = Utility.GetImageFromAppIcon(item_to_add_p.AppPath); temp_app_list_box_item.AppItemData = item_to_add_p; applicatoin_items_l.Add(temp_app_list_box_item); }
private void MenuEdit_Click(object sender, RoutedEventArgs e) { // Edit selected application settings. AppListBoxItem temp_app_list_box_item = (AppListBoxItem)application_lv.SelectedItem;; app_settings_dialog.PopulateForm(temp_app_list_box_item); app_settings_dialog.DataContext = temp_app_list_box_item; app_settings_dialog.ApplicationItems = applicatoin_items_l; app_settings_dialog.AppSettingsManager = app_settings_manager_l; app_settings_dialog.SetDialogTitle("Edit Application"); app_settings_dialog.Visibility = System.Windows.Visibility.Visible; }
private void AddApplication_Click(object sender, RoutedEventArgs e) { // Add a new application to the startup list. AppListBoxItem temp_app_list_box_item = new AppListBoxItem(); app_settings_dialog.ResetFrom(); app_settings_dialog.DataContext = temp_app_list_box_item; app_settings_dialog.ApplicationItems = applicatoin_items_l; app_settings_dialog.AppSettingsManager = app_settings_manager_l; app_settings_dialog.SetDialogTitle("Add Application"); app_settings_dialog.Visibility = System.Windows.Visibility.Visible; }
private void MenuDelete_Click(object sender, RoutedEventArgs e) { // Remove the selected AppListBoxItem. AppListBoxItem temp_app_list_box_item = (AppListBoxItem)application_lv.SelectedItem; ApplicatoinItems.Remove(temp_app_list_box_item); // Resave all of the application items. app_settings_manager_l.SaveAppItems(); // Hide the edit and delete buttons. if (application_lv.SelectedItems.Count <= 0) { RightAction_sp.Visibility = System.Windows.Visibility.Collapsed; } }
private void MenuSave_Click(object sender, RoutedEventArgs e) { if (String.IsNullOrEmpty(app_path_tb.Text)) { this.Visibility = System.Windows.Visibility.Collapsed; } // Apply the changes to the selected AppListBoxItem. AppListBoxItem temp_list_box_item = (AppListBoxItem)this.DataContext; temp_list_box_item.AppTitle = app_name_tb.Text; temp_list_box_item.AppPath = app_path_tb.Text; temp_list_box_item.AppIcon = Utility.GetImageFromAppIcon(app_path_tb.Text); temp_list_box_item.AppItemData.AppArgs = app_args_tb.Text; if (AppTitle_txt.Text.Contains("Add")) { this.ApplicationItems.Add(temp_list_box_item); } AppSettingsManager.SaveAppItems(); this.Visibility = System.Windows.Visibility.Collapsed; }
public void PopulateForm(AppListBoxItem temp_app_list_box_item_p) { app_name_tb.Text = temp_app_list_box_item_p.AppTitle; app_path_tb.Text = temp_app_list_box_item_p.AppPath; app_args_tb.Text = temp_app_list_box_item_p.AppItemData.AppArgs; }