Email provider form

This commit is contained in:
Ben Olden-Cooligan 2018-08-05 12:12:41 -04:00
parent 39b4149822
commit 791e37a3ba
18 changed files with 816 additions and 17 deletions

View File

@ -450,6 +450,16 @@ namespace NAPS2 {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap gmail {
get {
object obj = ResourceManager.GetObject("gmail", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
@ -480,6 +490,16 @@ namespace NAPS2 {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap outlookweb {
get {
object obj = ResourceManager.GetObject("outlookweb", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>

View File

@ -322,4 +322,10 @@
<data name="btn_donate_LG" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Icons\btn_donate_LG.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="gmail" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Icons\gmail.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="outlookweb" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Icons\outlookweb.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

BIN
NAPS2.Core/Icons/gmail.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 899 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 817 B

View File

@ -1,14 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using NAPS2.Lang.Resources;
using NAPS2.Scan;
namespace NAPS2.ImportExport.Email
{
public enum EmailProviderType
{
System,
[LocalizedDescription(typeof(SettingsResources), "EmailProviderType_CustomSmtp")]
CustomSmtp,
[LocalizedDescription(typeof(SettingsResources), "EmailProviderType_Gmail")]
Gmail,
[LocalizedDescription(typeof(SettingsResources), "EmailProviderType_OutlookWeb")]
OutlookWeb
}
}

View File

@ -9,10 +9,26 @@ namespace NAPS2.ImportExport.Email
{
public EmailProviderType ProviderType { get; set; }
public string SystemAppName { get; set; }
public string GmailUser { get; set; }
public string GmailTokenSecure { get; set; }
public string OutlookWebUser { get; set; }
public string OutlookWebTokenSecure { get; set; }
public string SmtpHost { get; set; }
public string SmtpFrom { get; set; }
public int? SmtpPort { get; set; }
public bool SmtpTls { get; set; }
public string SmtpUser { get; set; }
public string SmtpPasswordSecure { get; set; }
}
}

View File

@ -159,6 +159,33 @@ namespace NAPS2.Lang.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Custom SMTP.
/// </summary>
internal static string EmailProviderType_CustomSmtp {
get {
return ResourceManager.GetString("EmailProviderType_CustomSmtp", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Gmail.
/// </summary>
internal static string EmailProviderType_Gmail {
get {
return ResourceManager.GetString("EmailProviderType_Gmail", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Outlook Web Access.
/// </summary>
internal static string EmailProviderType_OutlookWeb {
get {
return ResourceManager.GetString("EmailProviderType_OutlookWeb", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Center.
/// </summary>

View File

@ -150,6 +150,15 @@
<data name="Dpi_800" xml:space="preserve">
<value>800 dpi</value>
</data>
<data name="EmailProviderType_CustomSmtp" xml:space="preserve">
<value>Custom SMTP</value>
</data>
<data name="EmailProviderType_Gmail" xml:space="preserve">
<value>Gmail</value>
</data>
<data name="EmailProviderType_OutlookWeb" xml:space="preserve">
<value>Outlook Web Access</value>
</data>
<data name="HorizontalAlign_Center" xml:space="preserve">
<value>Center</value>
</data>

View File

@ -341,6 +341,12 @@
<Compile Include="WinForms\DragScrollListView.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="WinForms\EmailProviderWidget.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="WinForms\EmailProviderWidget.Designer.cs">
<DependentUpon>EmailProviderWidget.cs</DependentUpon>
</Compile>
<Compile Include="WinForms\FAbout.cs">
<SubType>Form</SubType>
</Compile>
@ -371,6 +377,12 @@
<Compile Include="WinForms\FBatchScan.Designer.cs">
<DependentUpon>FBatchScan.cs</DependentUpon>
</Compile>
<Compile Include="WinForms\FEmailProvider.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="WinForms\FEmailProvider.Designer.cs">
<DependentUpon>FEmailProvider.cs</DependentUpon>
</Compile>
<Compile Include="WinForms\FHueSaturation.cs">
<SubType>Form</SubType>
</Compile>
@ -695,6 +707,9 @@
<EmbeddedResource Include="Lang\Resources\SettingsResources.vi.resx" Condition="'$(Configuration)' != 'Debug'" />
<EmbeddedResource Include="Lang\Resources\SettingsResources.zh-CHS.resx" Condition="'$(Configuration)' != 'Debug'" />
<EmbeddedResource Include="Lang\Resources\SettingsResources.zh-TW.resx" Condition="'$(Configuration)' != 'Debug'" />
<EmbeddedResource Include="WinForms\EmailProviderWidget.resx">
<DependentUpon>EmailProviderWidget.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="WinForms\FAbout.af.resx" Condition="'$(Configuration)' != 'Debug'">
<DependentUpon>FAbout.cs</DependentUpon>
</EmbeddedResource>
@ -1348,6 +1363,9 @@
<EmbeddedResource Include="WinForms\FEditProfile.ja.resx">
<DependentUpon>FEditProfile.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="WinForms\FEmailProvider.resx">
<DependentUpon>FEmailProvider.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="WinForms\FEmailSettings.ja.resx">
<DependentUpon>FEmailSettings.cs</DependentUpon>
</EmbeddedResource>
@ -5227,7 +5245,9 @@
<Content Include="Icons\control_play_blue-small.png" />
<Content Include="Icons\email.ico" />
<Content Include="Icons\file_extension_pdf.ico" />
<None Include="Icons\gmail.png" />
<Content Include="Icons\image_edit.png" />
<None Include="Icons\outlookweb.png" />
<Content Include="Icons\picture.ico" />
<Content Include="Icons\pictures.png" />
<Content Include="Icons\picture_edit.png" />

View File

@ -0,0 +1,71 @@
namespace NAPS2.WinForms
{
partial class EmailProviderWidget
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.pboxIcon = new System.Windows.Forms.PictureBox();
this.lblName = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.pboxIcon)).BeginInit();
this.SuspendLayout();
//
// pboxIcon
//
this.pboxIcon.Location = new System.Drawing.Point(3, 3);
this.pboxIcon.Name = "pboxIcon";
this.pboxIcon.Size = new System.Drawing.Size(50, 50);
this.pboxIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.pboxIcon.TabIndex = 0;
this.pboxIcon.TabStop = false;
//
// lblName
//
this.lblName.AutoSize = true;
this.lblName.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblName.Location = new System.Drawing.Point(59, 18);
this.lblName.Name = "lblName";
this.lblName.Size = new System.Drawing.Size(0, 20);
this.lblName.TabIndex = 1;
//
// EmailProviderWidget
//
this.Controls.Add(this.lblName);
this.Controls.Add(this.pboxIcon);
this.Name = "EmailProviderWidget";
this.Size = new System.Drawing.Size(348, 54);
((System.ComponentModel.ISupportInitialize)(this.pboxIcon)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.PictureBox pboxIcon;
private System.Windows.Forms.Label lblName;
}
}

View File

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using NAPS2.ImportExport.Email;
namespace NAPS2.WinForms
{
public partial class EmailProviderWidget : UserControl
{
public EmailProviderWidget()
{
InitializeComponent();
}
public IEmailProvider Provider { get; set; }
public Image ProviderIcon
{
get => pboxIcon.Image;
set => pboxIcon.Image = value;
}
public string ProviderName
{
get => lblName.Text;
set => lblName.Text = value;
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,64 @@
namespace NAPS2.WinForms
{
partial class FEmailProvider
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FEmailProvider));
this.panel1 = new System.Windows.Forms.Panel();
this.SuspendLayout();
//
// panel1
//
this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.panel1.Location = new System.Drawing.Point(12, 12);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(480, 56);
this.panel1.TabIndex = 0;
//
// FEmailProvider
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(504, 80);
this.Controls.Add(this.panel1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximumSize = new System.Drawing.Size(1000, 119);
this.MinimumSize = new System.Drawing.Size(300, 119);
this.Name = "FEmailProvider";
this.Text = "Choose Email Provider";
this.Load += new System.EventHandler(this.FEmailProvider_Load);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel1;
}
}

View File

@ -0,0 +1,118 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.Win32;
using NAPS2.ImportExport.Email;
using NAPS2.Scan;
namespace NAPS2.WinForms
{
public partial class FEmailProvider : FormBase
{
private readonly IEmailProviderFactory emailProviderFactory;
private List<EmailProviderWidget> providerWidgets;
private string[] systemClientNames;
private string defaultSystemClientName;
public FEmailProvider(IEmailProviderFactory emailProviderFactory)
{
this.emailProviderFactory = emailProviderFactory;
InitializeComponent();
}
private void FEmailProvider_Load(object sender, EventArgs e)
{
providerWidgets = new List<EmailProviderWidget>();
systemClientNames = GetSystemClientNames();
defaultSystemClientName = GetDefaultSystemClientName();
foreach (var clientName in systemClientNames.OrderBy(x => x == defaultSystemClientName ? 0 : 1))
{
providerWidgets.Add(new EmailProviderWidget
{
Provider = emailProviderFactory.Create(EmailProviderType.System),
ProviderIcon = GetSystemClientIcon(clientName),
ProviderName = clientName
});
}
providerWidgets.Add(new EmailProviderWidget
{
Provider = emailProviderFactory.Create(EmailProviderType.Gmail),
ProviderIcon = Icons.gmail,
ProviderName = EmailProviderType.Gmail.Description()
});
providerWidgets.Add(new EmailProviderWidget
{
Provider = emailProviderFactory.Create(EmailProviderType.OutlookWeb),
ProviderIcon = Icons.outlookweb,
ProviderName = EmailProviderType.OutlookWeb.Description()
});
providerWidgets.Add(new EmailProviderWidget
{
Provider = emailProviderFactory.Create(EmailProviderType.CustomSmtp),
ProviderIcon = null,
ProviderName = EmailProviderType.CustomSmtp.Description()
});
// A lot of little fiddling here. This just makes the widgets display nicely
int heightDiff = Height - panel1.Height;
panel1.Height = 0;
foreach (var widget in providerWidgets)
{
panel1.Controls.Add(widget);
widget.BorderStyle = BorderStyle.FixedSingle;
widget.Top = panel1.Height;
widget.Width = panel1.Width;
widget.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
panel1.Height += widget.Height - 1;
}
panel1.Height += 1;
MaximumSize = new Size(MaximumSize.Width, panel1.Height + heightDiff);
MinimumSize = new Size(MinimumSize.Width, panel1.Height + heightDiff);
}
private string GetDefaultSystemClientName()
{
using (var key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Clients\Mail", false))
{
return key?.GetValue(null).ToString();
}
}
private string[] GetSystemClientNames()
{
// TODO: Swallow errors
using (var clientList = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Clients\Mail", false))
{
return clientList?.GetSubKeyNames().Where(clientName =>
{
using (var clientKey = Registry.LocalMachine.OpenSubKey($@"SOFTWARE\Clients\Mail\{clientName}"))
{
return clientKey?.GetValue("DllPath") != null;
}
}).ToArray() ?? new string[0];
}
}
private Image GetSystemClientIcon(string clientName)
{
using (var command = Registry.LocalMachine.OpenSubKey($@"SOFTWARE\Clients\Mail\{clientName}\shell\open\command", false))
{
string commandText = command?.GetValue(null).ToString() ?? "";
if (!commandText.StartsWith("\""))
{
return null;
}
string exePath = commandText.Substring(1, commandText.IndexOf("\"", 1, StringComparison.InvariantCulture) - 1);
var icon = Icon.ExtractAssociatedIcon(exePath);
return icon?.ToBitmap();
}
}
}
}

View File

@ -0,0 +1,145 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAA
AAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
/wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
/wD///8A////AAAAADAAAAAzAAAAMwAAADMAAAAzAAAAMwAAADMAAAAzAAAAMwAAADMAAAAzAAAAMwAA
ADMAAAAzAAAAMwAAADDLomryzKBm/8qeY//KnmP/yp5j/8qeYv/KnmL/yp5i/8qeYv/KnmL/yp5i/8qe
Y//KnmP/yp5j/8ygZv/LomryzKBm////9f///+3///7r///96////er///3p///96f///en///3p///9
6v///ev///7r////7f///uz/zKBm/8qeY////u3/5sqh//fkxf//9t////Tc///z2///89v///Pb///z
2///9Nz///bf//fkxf/myqH///7t/8qeY//KnmP///vp///77//atoT/48SX///z2P//89n///Ta///0
2v//89n///PY/+PEl//atoT///vv///76f/KnmP/yp5j///56P//79D///31/9u1gv//9Nj/3LmI/8SV
Vv/ElVb/3LmI///02P/btYL///31///v0P//+ej/yp5j/8qeY///+uj//+vK///sy/////7/5MOT/9y6
iP///////////9y6iP/kw5P////+///sy///68r///ro/8qeY//KnmP///rq///pxf//6sf/68ue/9u2
hP///////+/P///vz///////27aE/+vLnv//6sf//+nF///66v/KnmP/yp5j///77P//6MH/9tmv/966
h/////r//+nH///pxv//6cb//+nH////+v/euof/9tmv///owf//++z/yp5j/8qeY////PH//uG1/962
gv//++///+a9///mvf//5r7//+a+///mvf//5r3///vv/962gv/+4bX///zx/8qeY//Kn2P///70/+a+
iP//9eP//+Gy///gsv//4bP//+Gz///hs///4bP//+Cy///hsv//9eP/5r6I///+9P/Kn2P/zKBl////
/f////j////3////9/////f////3////9/////f////3////9/////f////3////+P////3/zKBl/82k
a7DMoGX/yp5j/8qeYv/KnmL/yp5i/8qeYv/KnmL/yp5i/8qeYv/KnmL/yp5i/8qeYv/KnmP/zKBl/82k
a8X///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP//
/wD///8A//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAA//8AAA==
</value>
</data>
</root>

View File

@ -42,6 +42,11 @@ namespace NAPS2.WinForms
this.txtAttachmentName = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.linkPlaceholders = new System.Windows.Forms.LinkLabel();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.lblUser = new System.Windows.Forms.Label();
this.lblProvider = new System.Windows.Forms.Label();
this.btnChangeProvider = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// btnOK
@ -88,10 +93,37 @@ namespace NAPS2.WinForms
this.linkPlaceholders.TabStop = true;
this.linkPlaceholders.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkPlaceholders_LinkClicked);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.lblUser);
this.groupBox1.Controls.Add(this.lblProvider);
this.groupBox1.Controls.Add(this.btnChangeProvider);
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false;
//
// lblUser
//
resources.ApplyResources(this.lblUser, "lblUser");
this.lblUser.Name = "lblUser";
//
// lblProvider
//
resources.ApplyResources(this.lblProvider, "lblProvider");
this.lblProvider.Name = "lblProvider";
//
// btnChangeProvider
//
resources.ApplyResources(this.btnChangeProvider, "btnChangeProvider");
this.btnChangeProvider.Name = "btnChangeProvider";
this.btnChangeProvider.UseVisualStyleBackColor = true;
this.btnChangeProvider.Click += new System.EventHandler(this.btnChangeProvider_Click);
//
// FEmailSettings
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.linkPlaceholders);
this.Controls.Add(this.txtAttachmentName);
this.Controls.Add(this.label1);
@ -102,6 +134,8 @@ namespace NAPS2.WinForms
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FEmailSettings";
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
@ -117,5 +151,9 @@ namespace NAPS2.WinForms
private System.Windows.Forms.TextBox txtAttachmentName;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.LinkLabel linkPlaceholders;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Button btnChangeProvider;
private System.Windows.Forms.Label lblProvider;
private System.Windows.Forms.Label lblUser;
}
}

View File

@ -73,5 +73,12 @@ namespace NAPS2.WinForms
txtAttachmentName.Text = form.FileName;
}
}
private void btnChangeProvider_Click(object sender, EventArgs e)
{
var form = FormFactory.Create<FEmailProvider>();
// TODO: This should provide a result (though we might ignore it here except to update the UI)
form.ShowDialog();
}
}
}

View File

@ -123,7 +123,7 @@
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="btnOK.Location" type="System.Drawing.Point, System.Drawing">
<value>264, 89</value>
<value>264, 267</value>
</data>
<data name="btnOK.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
@ -145,13 +145,13 @@
<value>$this</value>
</data>
<data name="&gt;&gt;btnOK.ZOrder" xml:space="preserve">
<value>6</value>
<value>7</value>
</data>
<data name="btnCancel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnCancel.Location" type="System.Drawing.Point, System.Drawing">
<value>345, 89</value>
<value>345, 267</value>
</data>
<data name="btnCancel.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
@ -172,7 +172,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;btnCancel.ZOrder" xml:space="preserve">
<value>5</value>
<value>6</value>
</data>
<metadata name="ilProfileIcons.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
@ -181,7 +181,7 @@
<value>True</value>
</data>
<data name="cbRememberSettings.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 68</value>
<value>12, 246</value>
</data>
<data name="cbRememberSettings.Size" type="System.Drawing.Size, System.Drawing">
<value>145, 17</value>
@ -202,13 +202,13 @@
<value>$this</value>
</data>
<data name="&gt;&gt;cbRememberSettings.ZOrder" xml:space="preserve">
<value>4</value>
<value>5</value>
</data>
<data name="btnRestoreDefaults.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="btnRestoreDefaults.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 89</value>
<value>12, 267</value>
</data>
<data name="btnRestoreDefaults.Size" type="System.Drawing.Size, System.Drawing">
<value>145, 23</value>
@ -229,10 +229,10 @@
<value>$this</value>
</data>
<data name="&gt;&gt;btnRestoreDefaults.ZOrder" xml:space="preserve">
<value>3</value>
<value>4</value>
</data>
<data name="txtAttachmentName.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 22</value>
<value>12, 200</value>
</data>
<data name="txtAttachmentName.Size" type="System.Drawing.Size, System.Drawing">
<value>396, 20</value>
@ -250,7 +250,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;txtAttachmentName.ZOrder" xml:space="preserve">
<value>1</value>
<value>2</value>
</data>
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -259,7 +259,7 @@
<value>NoControl</value>
</data>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 6</value>
<value>12, 184</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 13</value>
@ -280,7 +280,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>2</value>
<value>3</value>
</data>
<data name="linkPlaceholders.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -289,7 +289,7 @@
<value>NoControl</value>
</data>
<data name="linkPlaceholders.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 45</value>
<value>12, 223</value>
</data>
<data name="linkPlaceholders.Size" type="System.Drawing.Size, System.Drawing">
<value>68, 13</value>
@ -310,6 +310,105 @@
<value>$this</value>
</data>
<data name="&gt;&gt;linkPlaceholders.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="lblUser.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="lblUser.Location" type="System.Drawing.Point, System.Drawing">
<value>6, 35</value>
</data>
<data name="lblUser.Size" type="System.Drawing.Size, System.Drawing">
<value>0, 13</value>
</data>
<data name="lblUser.TabIndex" type="System.Int32, mscorlib">
<value>35</value>
</data>
<data name="&gt;&gt;lblUser.Name" xml:space="preserve">
<value>lblUser</value>
</data>
<data name="&gt;&gt;lblUser.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;lblUser.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;lblUser.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="lblProvider.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="lblProvider.Location" type="System.Drawing.Point, System.Drawing">
<value>6, 19</value>
</data>
<data name="lblProvider.Size" type="System.Drawing.Size, System.Drawing">
<value>108, 13</value>
</data>
<data name="lblProvider.TabIndex" type="System.Int32, mscorlib">
<value>34</value>
</data>
<data name="lblProvider.Text" xml:space="preserve">
<value>No provider selected.</value>
</data>
<data name="&gt;&gt;lblProvider.Name" xml:space="preserve">
<value>lblProvider</value>
</data>
<data name="&gt;&gt;lblProvider.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;lblProvider.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;lblProvider.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="btnChangeProvider.Location" type="System.Drawing.Point, System.Drawing">
<value>327, 19</value>
</data>
<data name="btnChangeProvider.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="btnChangeProvider.TabIndex" type="System.Int32, mscorlib">
<value>33</value>
</data>
<data name="btnChangeProvider.Text" xml:space="preserve">
<value>Change</value>
</data>
<data name="&gt;&gt;btnChangeProvider.Name" xml:space="preserve">
<value>btnChangeProvider</value>
</data>
<data name="&gt;&gt;btnChangeProvider.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnChangeProvider.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;btnChangeProvider.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 12</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>408, 57</value>
</data>
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
<value>32</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>Provider</value>
</data>
<data name="&gt;&gt;groupBox1.Name" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;groupBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;groupBox1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
@ -319,7 +418,7 @@
<value>6, 13</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>432, 124</value>
<value>432, 302</value>
</data>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
@ -346,7 +445,7 @@
</value>
</data>
<data name="$this.MaximumSize" type="System.Drawing.Size, System.Drawing">
<value>800, 163</value>
<value>800, 500</value>
</data>
<data name="$this.MinimumSize" type="System.Drawing.Size, System.Drawing">
<value>400, 163</value>
@ -358,12 +457,12 @@
<value>ilProfileIcons</value>
</data>
<data name="&gt;&gt;ilProfileIcons.Type" xml:space="preserve">
<value>NAPS2.WinForms.ILProfileIcons, NAPS2.Core, Version=4.4.1.24470, Culture=neutral, PublicKeyToken=null</value>
<value>NAPS2.WinForms.ILProfileIcons, NAPS2.Core, Version=5.8.2.20106, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>FEmailSettings</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>NAPS2.WinForms.FormBase, NAPS2.Core, Version=4.4.1.24470, Culture=neutral, PublicKeyToken=null</value>
<value>NAPS2.WinForms.FormBase, NAPS2.Core, Version=5.8.2.20106, Culture=neutral, PublicKeyToken=null</value>
</data>
</root>