/// <summary>Hit when the user wants to add a new EMail Account.</summary> /// <param name="sender">btnAddEmail</param> /// <param name="e">RoutedEventArgs</param> private void btnAddEmail_Click(object sender, RoutedEventArgs e) { Details_EmailServer win = new Details_EmailServer(null, this.settings.Application_Servers); bool?resp = win.ShowDialog(); if (resp.HasValue && resp.Value) { //Save the application server! this.AddOrUpdateEmailAccount(win.EMailAccount); } }
/// <summary>Hit when the user wants to edit an existing item.</summary> /// <param name="sender">lstEmailAccounts</param> /// <param name="e">MouseButtonEventArgs</param> private void lstEmailAccountsItem_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { if (e.ClickCount == 2) { //Get the data item.. if (sender is StackPanel) { if (((StackPanel)sender).DataContext is AccountDetails) { AccountDetails emAcct = (AccountDetails)((StackPanel)sender).DataContext; //Display the form.. Details_EmailServer win = new Details_EmailServer(emAcct, this.settings.Application_Servers); bool?resp = win.ShowDialog(); if (resp.HasValue && resp.Value) { //Add or update the list.. this.AddOrUpdateEmailAccount(emAcct); } } } } }