Add MailTo
This commit is contained in:
@ -7,6 +7,7 @@ using System.Windows.Media;
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Diagnostics;
|
||||||
|
|
||||||
namespace WGneu {
|
namespace WGneu {
|
||||||
public static class Utils {
|
public static class Utils {
|
||||||
@ -56,6 +57,13 @@ namespace WGneu {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void MailTo(string emailAddress) {
|
||||||
|
Process.Start(new ProcessStartInfo() {
|
||||||
|
FileName = $"mailto:{emailAddress}",
|
||||||
|
UseShellExecute = true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public sealed class TemporaryFile : IDisposable {
|
public sealed class TemporaryFile : IDisposable {
|
||||||
private int Usages = 0;
|
private int Usages = 0;
|
||||||
public string FilePath { get; private set; }
|
public string FilePath { get; private set; }
|
||||||
|
@ -51,7 +51,8 @@
|
|||||||
|
|
||||||
<Menu Grid.ColumnSpan="3" BorderThickness="0,0,0,1" BorderBrush="LightGray" Background="White">
|
<Menu Grid.ColumnSpan="3" BorderThickness="0,0,0,1" BorderBrush="LightGray" Background="White">
|
||||||
<MenuItem Header="Mitglied">
|
<MenuItem Header="Mitglied">
|
||||||
<MenuItem Header="E-Mail senden"/>
|
<MenuItem x:Name="Menu_Member_SendEmail" Header="E-Mail senden" IsEnabled="False"
|
||||||
|
Click="Menu_Member_SendEmail_Click"/>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="Drucken">
|
<MenuItem Header="Drucken">
|
||||||
<MenuItem Header="Stammdatenblatt drucken"/>
|
<MenuItem Header="Stammdatenblatt drucken"/>
|
||||||
|
@ -266,6 +266,10 @@ namespace WGneu.Windows {
|
|||||||
RefreshMemberList();
|
RefreshMemberList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Menu_Member_SendEmail_Click(object sender, EventArgs e) {
|
||||||
|
Utils.MailTo(((Member)MemberList.SelectedItem).Email);
|
||||||
|
}
|
||||||
|
|
||||||
private void FocusSearchInput(object sender, RoutedEventArgs e) {
|
private void FocusSearchInput(object sender, RoutedEventArgs e) {
|
||||||
if (!IsEditing && !IsCreating) {
|
if (!IsEditing && !IsCreating) {
|
||||||
SearchInput.Focus();
|
SearchInput.Focus();
|
||||||
@ -398,6 +402,8 @@ namespace WGneu.Windows {
|
|||||||
case "email": ContactEmailInput.IsChecked = true; break;
|
case "email": ContactEmailInput.IsChecked = true; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Menu_Member_SendEmail.IsEnabled = m.Email != null;
|
||||||
|
|
||||||
foreach (var tb in Utils.FindVisualChilds<TextBox>(this, ExemptInputs))
|
foreach (var tb in Utils.FindVisualChilds<TextBox>(this, ExemptInputs))
|
||||||
OriginalValues[tb] = tb.Text;
|
OriginalValues[tb] = tb.Text;
|
||||||
foreach (var cb in Utils.FindVisualChilds<ComboBox>(this, ExemptInputs))
|
foreach (var cb in Utils.FindVisualChilds<ComboBox>(this, ExemptInputs))
|
||||||
@ -409,6 +415,7 @@ namespace WGneu.Windows {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void ClearInputs() {
|
private void ClearInputs() {
|
||||||
|
Menu_Member_SendEmail.IsEnabled = false;
|
||||||
OriginalValues.Clear();
|
OriginalValues.Clear();
|
||||||
foreach (var tb in Utils.FindVisualChilds<TextBox>(this, ExemptInputs))
|
foreach (var tb in Utils.FindVisualChilds<TextBox>(this, ExemptInputs))
|
||||||
tb.Text = "";
|
tb.Text = "";
|
||||||
|
Reference in New Issue
Block a user