Merge branch 'master' of github.com:tparnell8/NOCQ
This commit is contained in:
@@ -59,12 +59,15 @@
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Extensability\Catalog.cs" />
|
||||
<Compile Include="Plugins\Email\ImapInput.cs" />
|
||||
<Compile Include="Plugins\Email\ImapInput.cs">
|
||||
<DependentUpon>IEmailSetting.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Plugins\Email\EmailSettings.cs" />
|
||||
<Compile Include="Imports\IDataImportHook.cs" />
|
||||
<Compile Include="Imports\DataImports.cs" />
|
||||
<Compile Include="DB\RedisDataase.cs" />
|
||||
<Compile Include="Plugins\Email\ParseRule.cs" />
|
||||
<Compile Include="Plugins\Email\IEmailSetting.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
|
||||
@@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
|
||||
namespace NOCQ.Plugins.Email
|
||||
{
|
||||
public class EmailSettings
|
||||
public class EmailSettings :IEmailSetting
|
||||
{
|
||||
public string Username {get;set;}
|
||||
public string Password {get;set;}
|
||||
|
||||
17
src/NOCQ/Plugins/Email/IEmailSetting.cs
Normal file
17
src/NOCQ/Plugins/Email/IEmailSetting.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
namespace NOCQ.Plugins.Email
|
||||
{
|
||||
public interface IEmailSetting
|
||||
{
|
||||
string Username {get;set;}
|
||||
string Password {get;set;}
|
||||
string Host {get;set;}
|
||||
int Port {get;set;}
|
||||
string Folder {get;set;}
|
||||
bool IsSsl {get;set;}
|
||||
int Frequency { get; set; }
|
||||
IEnumerable<ParseRule> ParseRules {get;set;}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,24 +8,24 @@ namespace NOCQ.Plugins.Email
|
||||
{
|
||||
public class ImapInput
|
||||
{
|
||||
private string loginName { get; set; }
|
||||
private string password { get; set; }
|
||||
private string server { get; set; }
|
||||
private string folderPath { get; set; }
|
||||
private Timer timer { get; set; }
|
||||
private int port { get; set; }
|
||||
private bool ssl { get; set; }
|
||||
private DateTime lastRun { get; set; }
|
||||
private List<ParseRule> parseRules{ get; set; }
|
||||
string loginName { get; set; }
|
||||
string password { get; set; }
|
||||
string server { get; set; }
|
||||
string folderPath { get; set; }
|
||||
Timer timer { get; set; }
|
||||
int port { get; set; }
|
||||
bool ssl { get; set; }
|
||||
DateTime lastRun { get; set; }
|
||||
List<ParseRule> parseRules{ get; set; }
|
||||
|
||||
public ImapInput (dynamic settings)
|
||||
{
|
||||
var sets = settings as EmailSettings;
|
||||
|
||||
if (sets.Username == null
|
||||
|| sets.Password == null
|
||||
|| sets.Host == null
|
||||
|| sets.Folder == null)
|
||||
if (sets.GetType().GetProperty("Username") == null
|
||||
|| sets.GetType().GetProperty("Password") == null
|
||||
|| sets.GetType().GetProperty("Host") == null
|
||||
|| sets.GetType().GetProperty("Folder") == null)
|
||||
throw new ArgumentException ("You are missing a required setting.");
|
||||
|
||||
parseRules = sets.ParseRules.Where (x => x.Enabled).ToList();
|
||||
|
||||
Reference in New Issue
Block a user