﻿<?xml version="1.0" encoding="utf-16"?>
<JiwaDocument xmlns:jiwa="http://www.jiwa.com.au/xml/schemas" Type="JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin">
  <RecID>daa73428-771d-4a1f-85a8-6672ac265007</RecID>
  <Name>Multiple Email Providers</Name>
  <Description>Adds a custom field to staff maintenance form "Email Method" - a dropdown list which selects the mechanism used to send emails.&amp;#13;&amp;#10;&amp;#13;&amp;#10;NOTE: Other email plugins (such as the standard Jiwa Email plugins "Email - Configuration Outlook", "Email - Configuration Outlook" and "Email - Configuration Outlook") should be DISABLED.&amp;#13;&amp;#10;&amp;#13;&amp;#10;This plugin has it's own set of system settings for defining values such as SMTP server address, et cetera.</Description>
  <IsEnabled>true</IsEnabled>
  <IsIsolatedToOwnAppDomain>false</IsIsolatedToOwnAppDomain>
  <ExecutionOrder>0</ExecutionOrder>
  <Author>Jiwa Financials</Author>
  <Version>7.0.175.0</Version>
  <Code>using Microsoft.VisualBasic;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using JiwaFinancials.Jiwa;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Drawing;
using System.Threading.Tasks;

#region "FormPlugin"
public class FormPlugin : System.MarshalByRefObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaFormPlugin
{

    public override object InitializeLifetimeService()
    {
        // returning null here will prevent the lease manager
        // from deleting the Object.
        return null;
    }

    public void SetupBeforeHandlers(JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm JiwaForm, JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
    {
    }

    public void Setup(JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm JiwaForm, JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
    {
    }
}
#endregion

#region "BusinessLogicPlugin"
public class BusinessLogicPlugin : System.MarshalByRefObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogicPlugin
{

    public override object InitializeLifetimeService()
    {
        // returning null here will prevent the lease manager
        // from deleting the Object.
        return null;
    }

    public void Setup(JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogic JiwaBusinessLogic, JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
    {
    }
}
#endregion

#region "ApplicationManagerPlugin"
public class ApplicationManagerPlugin : System.MarshalByRefObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaApplicationManagerPlugin
{
	JiwaFinancials.Jiwa.JiwaApplication.BusinessLogic.GenericObjectItem emailProviders = new JiwaFinancials.Jiwa.JiwaApplication.BusinessLogic.GenericObjectItem();
	
    public override object InitializeLifetimeService()
    {
        // returning null here will prevent the lease manager
        // from deleting the Object.
        return null;
    }

	public void Setup(JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
    {
		List&lt;IEmailProvider&gt; emailProvidersList = new List&lt;IEmailProvider&gt;();		
		emailProvidersList.Add(new OutlookEmailProvider());
		emailProvidersList.Add(new SMTPEmailProvider());
		emailProvidersList.Add(new Office365RESTAPIEmailProvider());
		
		JiwaFinancials.Jiwa.JiwaApplication.BusinessLogic.GenericObjectItem emailProviders = new JiwaFinancials.Jiwa.JiwaApplication.BusinessLogic.GenericObjectItem();
		emailProviders.RecID = "EmailProvidersList";
		emailProviders.Object = emailProvidersList;
		
		JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.Staff.GenericObjectCollection.Add(emailProviders);		
		
		JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.EmailSendBefore += EmailSendBefore;
    }
	
	private void EmailSendBefore(JiwaFinancials.Jiwa.JiwaApplication.Documents.DocumentCollection Attachments, string EmailToAddress, string EmailFromAddress, string EmailSubject, string EmailBody, bool RequestReadReceipt, string EmailBCC, string EMailCC, string MessageID, bool BodyIsHTML)		
	{
		// Route according to email provider
		
		// Get staff custom field value
		JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomFieldValue customFieldValue = JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.Staff.CustomFieldValues.get_ItemFromSettingName("EmailProvider", "Multiple Email Providers");
		
		// Find email provider matching and invoke it's EmailSendBefore method
		JiwaFinancials.Jiwa.JiwaApplication.BusinessLogic.GenericObjectItem emailProviders = JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.Staff.GenericObjectCollection["EmailProvidersList"];
		List&lt;IEmailProvider&gt; emailProvidersList = (List&lt;IEmailProvider&gt;)emailProviders.Object;
				
		foreach(IEmailProvider emailProvider in emailProvidersList)
		{
			if (emailProvider.Name == customFieldValue.Contents)
			{
				emailProvider.EmailSendBefore(Attachments, EmailToAddress, EmailFromAddress, EmailSubject, EmailBody, RequestReadReceipt, EmailBCC, EMailCC, MessageID, BodyIsHTML);
				break;
			}
		}			
	}
}
#endregion

#region "CustomFieldPlugin"
public class CustomFieldPlugin : System.MarshalByRefObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaCustomFieldPlugin
{
    public override object InitializeLifetimeService()
    {
        // returning null here will prevent the lease manager
        // from deleting the Object.
        return null;
    }

    public void FormatCell(JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogic BusinessLogicHost, JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid GridObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm FormObject, int Col, int Row, JiwaFinancials.Jiwa.JiwaApplication.IJiwaCustomFieldValues HostObject, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomField CustomField, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomFieldValue CustomFieldValue)
    {
		if (CustomFieldValue != null &amp; CustomFieldValue.CustomField.PluginCustomField.Name == "EmailProvider")
		{
			JiwaFinancials.Jiwa.JiwaApplication.BusinessLogic.GenericObjectItem emailProviders = JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.Staff.GenericObjectCollection["EmailProvidersList"];
			List&lt;IEmailProvider&gt; emailProvidersList = (List&lt;IEmailProvider&gt;)emailProviders.Object;
			
			List&lt;string&gt; Items = new List&lt;string&gt;();
			
			foreach(IEmailProvider emailProvider in emailProvidersList)
			{
				Items.Add(emailProvider.Name);				
			}			
			
			var typeCell = new FarPoint.Win.Spread.CellType.ComboBoxCellType();			
			typeCell.Items = Items.ToArray();
			typeCell.ItemData = Items.ToArray();
            typeCell.EditorValue = FarPoint.Win.Spread.CellType.EditorValue.ItemData;                  
            GridObject.ActiveSheet.Cells[Row, GridObject.ActiveSheet.GetColumnFromTag(null, "Contents").Index].CellType = typeCell;
		}
    }

    public void ReadData(JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogic BusinessLogicHost, JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid GridObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm FormObject, int Row, JiwaFinancials.Jiwa.JiwaApplication.IJiwaCustomFieldValues HostObject, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomField CustomField, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomFieldValue CustomFieldValue)
    {
    }

    public void ButtonClicked(JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogic BusinessLogicHost, JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid GridObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm FormObject, int Col, int Row, JiwaFinancials.Jiwa.JiwaApplication.IJiwaCustomFieldValues HostObject, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomField CustomField, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomFieldValue CustomFieldValue)
    {
    }
}
#endregion

#region "LineCustomFieldPlugin"
public class LineCustomFieldPlugin : System.MarshalByRefObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaLineCustomFieldPlugin
{
    public override object InitializeLifetimeService()
    {
        // returning null here will prevent the lease manager
        // from deleting the Object.
        return null;
    }

    public void FormatCell(JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogic BusinessLogicHost, JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid GridObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm FormObject, int Col, int Row, JiwaFinancials.Jiwa.JiwaApplication.IJiwaLineCustomFieldValues HostItem, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomField CustomField, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomFieldValue CustomFieldValue)
    {
    }

    public void ReadData(JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogic BusinessLogicHost, JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid GridObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm FormObject, int Row, JiwaFinancials.Jiwa.JiwaApplication.IJiwaLineCustomFieldValues HostItem, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomField CustomField, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomFieldValue CustomFieldValue)
    {
    }

    public void ButtonClicked(JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogic BusinessLogicHost, JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid GridObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm FormObject, int Col, int Row, JiwaFinancials.Jiwa.JiwaApplication.IJiwaLineCustomFieldValues HostItem, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomField CustomField, JiwaFinancials.Jiwa.JiwaApplication.CustomFields.CustomFieldValue CustomFieldValue)
    {
    }
}
#endregion

#region "SystemSettingPlugin"
public class SystemSettingPlugin : System.MarshalByRefObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaSystemSettingPlugin
{
    public override object InitializeLifetimeService()
    {
        // returning null here will prevent the lease manager
        // from deleting the Object.
        return null;
    }

    public void FormatCell(JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogic BusinessLogicHost, JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid GridObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm FormObject, int Col, int Row, JiwaFinancials.Jiwa.JiwaApplication.SystemSettings.Setting SystemSetting)
    {
    }

    public void ReadData(JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogic BusinessLogicHost, JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid GridObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm FormObject, int Row, JiwaFinancials.Jiwa.JiwaApplication.SystemSettings.Setting SystemSetting)
    {
    }

    public void ButtonClicked(JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogic BusinessLogicHost, JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid GridObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm FormObject, int Col, int Row, JiwaFinancials.Jiwa.JiwaApplication.SystemSettings.Setting SystemSetting)
    {
    }
}
#endregion

#region "ScheduledExecutionPlugin"
public class ScheduledExecutionPlugin : System.MarshalByRefObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaScheduledExecutionPlugin
{
    public void Execute(JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin, JiwaFinancials.Jiwa.JiwaApplication.Schedule.Schedule Schedule)
    {
    }

    public void OnServiceStart(JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
    {
    }

    public void OnServiceStopping(JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
    {
    }
}
#endregion

public interface IEmailProvider
{
	string Name { get; }
	void EmailSendBefore(JiwaFinancials.Jiwa.JiwaApplication.Documents.DocumentCollection Attachments, string EmailToAddress, string EmailFromAddress, string EmailSubject, string EmailBody, bool RequestReadReceipt, string EmailBCC, string EMailCC, string MessageID, bool BodyIsHTML);
}

#region "Outlook Email Provider"
public class OutlookEmailProvider : IEmailProvider
{
	[System.Runtime.InteropServices.DllImport("user32.dll")]
	private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
	
	public string Name
	{
		get { return "Outlook"; }
	}
	
	void IEmailProvider.EmailSendBefore(JiwaFinancials.Jiwa.JiwaApplication.Documents.DocumentCollection Attachments, string EmailToAddress, string EmailFromAddress, string EmailSubject, string EmailBody, bool RequestReadReceipt, string EmailBCC, string EMailCC, string MessageID, bool BodyIsHTML)
	{		
		Microsoft.Office.Interop.Outlook.Application OutLookObject = null;
		Microsoft.Office.Interop.Outlook.MailItem MailMessage = null;
		string lTempFolderPath = "";

		try 
		{
			// We will get the error : Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE))
			// If we try to create an outlook instance whilst it is already running.
			// So we look first to see if one is already running, and we use that.
			System.Diagnostics.Process[] outlookProcesses = System.Diagnostics.Process.GetProcessesByName("OUTLOOK");
			if (outlookProcesses.Length &gt; 0) 
			{
				try 
				{
					OutLookObject = (Microsoft.Office.Interop.Outlook.Application)System.Runtime.InteropServices.Marshal.GetActiveObject("Outlook.Application");
				} 
				catch (System.Runtime.InteropServices.COMException ex) 
				{
					// we may get an exception if outlook was already running and had focus.  To work-around this we minimize outlook and try again
					// see https://support.microsoft.com/en-us/kb/316125

					// Also note : running the debugger/IDE with elevated privileges (i.e. Admin mode) can cause an exception when the
					// Process you are trying to detect is running without elevated privileges.

					ShowWindow(outlookProcesses[0].MainWindowHandle, 4);
					OutLookObject = (Microsoft.Office.Interop.Outlook.Application)System.Runtime.InteropServices.Marshal.GetActiveObject("Outlook.Application");
				}

			} 
			else 
			{
				OutLookObject = new Microsoft.Office.Interop.Outlook.Application();
				//OutLookObject = CreateObject("outlook.application")
			}

			MailMessage = (Microsoft.Office.Interop.Outlook.MailItem)OutLookObject.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem);

			if ((MailMessage != null)) 
			{
				foreach (JiwaFinancials.Jiwa.JiwaApplication.Documents.Document document in Attachments) 
				{
					byte[] FileBinary = document.FileBinary;
					System.IO.FileStream FileStream = null;
					string FullyPathedFilename = System.IO.Path.Combine(System.IO.Path.GetTempPath(), System.IO.Path.GetFileName(document.PhysicalFileName));
					try 
					{
						FileStream = new System.IO.FileStream(FullyPathedFilename, System.IO.FileMode.Create);
						FileStream.Write(FileBinary, 0, FileBinary.Length);
						FileStream.Close();
					} 
					finally 
					{
						if ((FileStream != null)) 
						{
							FileStream.Close();
						}
					}					
					MailMessage.Attachments.Add(FullyPathedFilename);
				}

				Microsoft.Office.Interop.Outlook.Account senderAccount = null;

				// Loop over the Accounts collection of the current Outlook session.
				foreach (Microsoft.Office.Interop.Outlook.Account account in OutLookObject.Session.Accounts) 
				{
					// When the e-mail address matches, return the account.
					if ((account.SmtpAddress != null) &amp;&amp; (EmailFromAddress != null) &amp;&amp; account.SmtpAddress.ToLower() == EmailFromAddress.ToLower()) 
					{
						senderAccount = account;
					}
				}

				if ((senderAccount != null)) 
				{
					MailMessage.SendUsingAccount = senderAccount;
					// Use this account to send the e-mail.
				}

				MailMessage.To = EmailToAddress;
				MailMessage.CC = EMailCC;
				MailMessage.BCC = EmailBCC;
				MailMessage.ReadReceiptRequested = RequestReadReceipt;

				if (BodyIsHTML) 
				{
					MailMessage.HTMLBody = EmailBody;
				} 
				else 
				{
					MailMessage.Body = EmailBody;
				}

				MailMessage.Subject = EmailSubject;
				MailMessage.Importance = Microsoft.Office.Interop.Outlook.OlImportance.olImportanceNormal;				

				MailMessage.Save();
				MailMessage.Send();
				JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.OnEmailSendAfter(Attachments, EmailToAddress, EmailFromAddress, EmailSubject, EmailBody, RequestReadReceipt, EmailBCC, EMailCC, MessageID, BodyIsHTML);
			}
		} 
		finally 
		{
			if (OutLookObject != null) 
			{
				OutLookObject = null;
			}
		}
	}
}
#endregion

#region "SMTP Email Provider"
public class SMTPEmailProvider : IEmailProvider
{	
	public string Name
	{
		get { return "SMTP"; }
	}
	
	void IEmailProvider.EmailSendBefore(JiwaFinancials.Jiwa.JiwaApplication.Documents.DocumentCollection Attachments, string EmailToAddress, string EmailFromAddress, string EmailSubject, string EmailBody, bool RequestReadReceipt, string EmailBCC, string EMailCC, string MessageID, bool BodyIsHTML)	
	{		
		string SMTPServerAddress = "";
		int SMTPServerPortNumber = 0;
		string SMTPUsername = "";
		string SMTPPassword = "";
		bool UseSSL = false;
		string PluginName = "Multiple Email Providers";
		string decryptedSMTPPassword = "";
		
		SMTPServerAddress = JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.Database.ReadSysData(PluginName, "SMTPServerAddress", "").ToString();
        if (SMTPServerAddress.Trim().Length == 0)
		{
            throw new System.Exception(String.Format("You have not defined a SMTP server to use for sending email.  Please check the value in 'System-&gt;System Configuration-&gt;{0}-&gt;SMTPServerAddress'.", PluginName));
        }
		
		string SMTPServerPortNumberString = JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.Database.ReadSysData(PluginName, "SMTPServerPortNumber", "").ToString();
        if (SMTPServerPortNumberString.Trim().Length &gt; 0)
        {
            int value;
            int.TryParse(SMTPServerPortNumberString, out value);
            SMTPServerPortNumber = value;
        
		}
		if (SMTPServerPortNumber == 0) 
		{
			throw new System.Exception(String.Format("You have not defined a port number to use for the SMTP Server.  Please check the value in 'System-&gt;System Configuration-&gt;{0}-&gt;SMTPServerPortNumber'.", PluginName));
		}
		
		string UseSSLString = JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.Database.ReadSysData(PluginName, "SMTPRequiresSSL", "").ToString();
        if (UseSSLString.Trim().Length &gt; 0)
        {
            bool value;
            bool.TryParse(UseSSLString, out value);
            UseSSL = value;
        }
		
		if (JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.Staff.SMTPUsername.Trim().Length &gt; 0)
		{
			SMTPUsername = JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.Staff.SMTPUsername;
            var encryptionObject = new JiwaFinancials.Jiwa.JiwaEncryption.JiwaEncrypt();
            decryptedSMTPPassword = encryptionObject.DecryptString(JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.Staff.SMTPPassword, JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.Database.FormatDateTime(JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.Staff.SMTPPasswordLastChangedDateTime, true));
        }
		
		if (EmailFromAddress.Trim().Length == 0)
		{
			throw new System.Exception("From address not specified");
        }
		
		var MailMessage = new System.Net.Mail.MailMessage();
		MailMessage.Subject = EmailSubject;
        MailMessage.Body = EmailBody;
        MailMessage.BodyEncoding = System.Text.Encoding.UTF8;
		MailMessage.IsBodyHtml = BodyIsHTML;
		
		if (BodyIsHTML)
		{
            // Add a plain text view otherwise spam filters such as SpamAssassin may recject it
            System.Net.Mail.AlternateView plainview = System.Net.Mail.AlternateView.CreateAlternateViewFromString(System.Text.RegularExpressions.Regex.Replace(EmailBody, "&lt;(.|\n)*?&gt;", String.Empty), null, "text/plain");

            System.Net.Mail.AlternateView htmlview = System.Net.Mail.AlternateView.CreateAlternateViewFromString(EmailBody, null, "text/html");

            MailMessage.AlternateViews.Add(plainview);
            MailMessage.AlternateViews.Add(htmlview);
		}
		
		if (MessageID.Trim().Length == 0)
		{
            MailMessage.Headers.Add("Message-ID", String.Format("{0}.{1}", System.Guid.NewGuid().ToString(), ".JiwaFinancials"));
        } 
		else 
		{
            MailMessage.Headers.Add("Message-ID", MessageID);
        }
		
		MailMessage.From = new System.Net.Mail.MailAddress(EmailFromAddress);
		
		if (EmailToAddress.Trim().Length &gt; 0)
		{
			string[] toAddresses = Microsoft.VisualBasic.Strings.Split(EmailToAddress, ";");
			foreach(string toAddress in toAddresses) 
			{
				if (toAddress.Trim().Length &gt; 0)
				{
					MailMessage.To.Add(toAddress);
				}
			}
		}
		else
		{
			throw new System.Exception("To address not specified");
        }
		
		if (EMailCC.Trim().Length &gt; 0)
		{
			string[] ccAddresses = Microsoft.VisualBasic.Strings.Split(EMailCC, ";");
			foreach(string ccAddress in ccAddresses) 
			{
				if (ccAddress.Trim().Length &gt; 0)
				{
					MailMessage.CC.Add(ccAddress);
				}
			}
		}
		
		if (EmailBCC.Trim().Length &gt; 0)
		{
			string[] bccAddresses = Microsoft.VisualBasic.Strings.Split(EmailBCC, ";");
			foreach(string bccAddress in bccAddresses) 
			{
				if (bccAddress.Trim().Length &gt; 0)
				{
					MailMessage.Bcc.Add(bccAddress);
				}
			}
		}
		
		if (RequestReadReceipt)
		{
			MailMessage.Headers.Add("Disposition-Notification-To", EmailFromAddress);
		}
		
		// Now add the attachments
		foreach(JiwaFinancials.Jiwa.JiwaApplication.Documents.Document document in Attachments)
		{		
			var attachment = new System.Net.Mail.Attachment(new System.IO.MemoryStream(document.FileBinary), System.IO.Path.GetFileName(document.PhysicalFileName));
			MailMessage.Attachments.Add(attachment);			
		}	
		
		var SmtpMail = new System.Net.Mail.SmtpClient();
        SmtpMail.Host = SMTPServerAddress;
        SmtpMail.Port = SMTPServerPortNumber;
        SmtpMail.EnableSsl = UseSSL;
        if (SMTPUsername.Trim().Length &gt; 0)
		{
            SmtpMail.Credentials = new System.Net.NetworkCredential(SMTPUsername, decryptedSMTPPassword);
        }
        SmtpMail.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
        SmtpMail.Send(MailMessage);
		
		JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.OnEmailSendAfter(Attachments, EmailToAddress, EmailFromAddress, EmailSubject, EmailBody, RequestReadReceipt, EmailBCC, EMailCC, MessageID, BodyIsHTML);
	}
}
#endregion
	
#region "Office 365 REST API Provider"
public class Office365RESTAPIEmailProvider : IEmailProvider
{	
	public string Name
	{
		get { return "Office 365 REST API"; }
	}
	
	void IEmailProvider.EmailSendBefore(JiwaFinancials.Jiwa.JiwaApplication.Documents.DocumentCollection Attachments, string EmailToAddress, string EmailFromAddress, string EmailSubject, string EmailBody, bool RequestReadReceipt, string EmailBCC, string EMailCC, string MessageID, bool BodyIsHTML)
	{
		SendEmail(Attachments, EmailToAddress, EmailFromAddress, EmailSubject, EmailBody, RequestReadReceipt, EmailBCC, EMailCC, MessageID, BodyIsHTML);
	}
	
	private async Task SendEmail(JiwaFinancials.Jiwa.JiwaApplication.Documents.DocumentCollection Attachments, string EmailToAddress, string EmailFromAddress, string EmailSubject, string EmailBody, bool RequestReadReceipt, string EmailBCC, string EMailCC, string MessageID, bool BodyIsHTML)		
	{
		string accessToken = GetOffice365AccessToken();
		
		Microsoft.Office365.OutlookServices.ItemBody body = new Microsoft.Office365.OutlookServices.ItemBody
        {
            Content = EmailBody,
            ContentType = BodyIsHTML ? Microsoft.Office365.OutlookServices.BodyType.HTML : Microsoft.Office365.OutlookServices.BodyType.Text
        };
		
		// Add the recipient addresses
        System.Collections.Generic.List&lt;Microsoft.Office365.OutlookServices.Recipient&gt; toRecipients = new System.Collections.Generic.List&lt;Microsoft.Office365.OutlookServices.Recipient&gt;();
		string[] emailToAddressArray = Microsoft.VisualBasic.Strings.Split(EmailToAddress, ";");
		
		foreach(string toAddress in emailToAddressArray)
		{
	        toRecipients.Add(new Microsoft.Office365.OutlookServices.Recipient
	        {
	            EmailAddress = new Microsoft.Office365.OutlookServices.EmailAddress
	            {
	                Address = toAddress
	            }
	        });
		}
		
		// Add the CC addresses
		System.Collections.Generic.List&lt;Microsoft.Office365.OutlookServices.Recipient&gt; ccRecipients = new System.Collections.Generic.List&lt;Microsoft.Office365.OutlookServices.Recipient&gt;();
		string[] emailCCAddressArray = Microsoft.VisualBasic.Strings.Split(EMailCC, ";");
		
		foreach(string CCAddress in emailCCAddressArray)
		{
	        ccRecipients.Add(new Microsoft.Office365.OutlookServices.Recipient
	        {
	            EmailAddress = new Microsoft.Office365.OutlookServices.EmailAddress
	            {
	                Address = CCAddress
	            }
	        });
		}
		
		// Add the BCC Addresses
		System.Collections.Generic.List&lt;Microsoft.Office365.OutlookServices.Recipient&gt; bccRecipients = new System.Collections.Generic.List&lt;Microsoft.Office365.OutlookServices.Recipient&gt;();
		string[] emailBCCAddressArray = Microsoft.VisualBasic.Strings.Split(EmailBCC, ";");
		
		foreach(string BCCAddress in emailBCCAddressArray)
		{
	        bccRecipients.Add(new Microsoft.Office365.OutlookServices.Recipient
	        {
	            EmailAddress = new Microsoft.Office365.OutlookServices.EmailAddress
	            {
	                Address = BCCAddress
	            }
	        });
		}
		
		// compose the message
        Microsoft.Office365.OutlookServices.Message newMessage = new Microsoft.Office365.OutlookServices.Message
        {
            Subject = EmailSubject,
            Body = body,
            ToRecipients = toRecipients,
			CcRecipients = ccRecipients,		
			BccRecipients = bccRecipients,
			From = new Microsoft.Office365.OutlookServices.Recipient { EmailAddress = new Microsoft.Office365.OutlookServices.EmailAddress { Address = EmailFromAddress } }
        };		
				
		// create the outlook client
		Microsoft.Office365.OutlookServices.OutlookServicesClient client = new Microsoft.Office365.OutlookServices.OutlookServicesClient(new Uri("https://outlook.office.com/api/v2.0"),
            () =&gt;
            {
                // Since we have it locally already just return it here.
                return System.Threading.Tasks.Task.FromResult&lt;string&gt;(accessToken);
            });
		
		// Save the message as a draft
		await client.Me.Messages.AddMessageAsync(newMessage); // This saves as a draft
		
		// Add the attachments
		foreach (JiwaFinancials.Jiwa.JiwaApplication.Documents.Document document in Attachments)
        {            
            var messageAttachment = new Microsoft.Office365.OutlookServices.FileAttachment 
			{ 
				Name = System.IO.Path.GetFileName(document.PhysicalFileName), 
				ContentId = Guid.NewGuid().ToString(), 
				ContentLocation = document.PhysicalFileName, 
				ContentType = FileTypeHelper.GetContentType(document.PhysicalFileName),
				ContentBytes = document.FileBinary
			};

			newMessage.Attachments.Add(messageAttachment);
			await newMessage.UpdateAsync(); // TODO: Work out why we can't use await! SyntaxEditor doesn't like it. UPDATE: It's because it doesn't support it, they never added support for it
        }
				
		// Send the message.
		await newMessage.SendAsync();
		JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.OnEmailSendAfter(Attachments, EmailToAddress, EmailFromAddress, EmailSubject, EmailBody, RequestReadReceipt, EmailBCC, EMailCC, MessageID, BodyIsHTML);
	}
	
	static string GetOffice365AccessToken()
        {
            //Get access token:            

            //Resource Uri for Office 365
            string resourceUri = "https://outlook.office365.com/";

            string clientId = "";
			
			clientId = JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.Database.ReadSysData("Multiple Email Providers", "ClientID", "").ToString();
			if (clientId.Trim().Length == 0)
			{
	            throw new System.Exception(String.Format("You have not defined an Azure AD Application ClientID.  Please check the value in 'System-&gt;System Configuration-&gt;{0}-&gt;ClientID'.", "Email - Configuration Office365 REST"));
	        }

            //A redirect uri gives AAD more details about the specific application that it will authenticate.
            //Since a client app does not have an external service to redirect to, this Uri is the standard placeholder for a client app.
            string redirectUri = "https://login.live.com/oauth20_desktop.srf";

            // Create an instance of AuthenticationContext to acquire an Azure access token
            // OAuth2 authority Uri
            string authorityUri = "https://login.windows.net/common/oauth2/authorize";			
            Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext authContext = new Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext(authorityUri);

            // Call AcquireToken to get an Azure token from Azure Active Directory token issuance endpoint
            //  AcquireToken takes a Client Id that Azure AD creates when you register your client app.
            //  To learn how to register a client app and get a Client ID, see https://msdn.microsoft.com/library/dn877542(Azure.100).aspx   
            string token = authContext.AcquireToken(resourceUri, clientId, new Uri(redirectUri)).AccessToken;

            return token;
        }
}

#region "FileTypeHelper"
public static class FileTypeHelper
{
    public static string GetContentType(string SourceFileName)
    {
        var extension = System.IO.Path.GetExtension(SourceFileName).ToLower();
         switch (extension)
        {
            case ".ai": return "application/postscript";
            case ".aif": return "audio/x-aiff";
            case ".aifc": return "audio/x-aiff";
            case ".aiff": return "audio/x-aiff";
            case ".asc": return "text/plain";
            case ".au": return "audio/basic";
            case ".avi": return "video/x-msvideo";
            case ".bcpio": return "application/x-bcpio";
            case ".bin": return "application/octet-stream";
            case ".c": return "text/plain";
            case ".cc": return "text/plain";
            case ".ccad": return "application/clariscad";
            case ".cdf": return "application/x-netcdf";
            case ".class": return "application/octet-stream";
            case ".cpio": return "application/x-cpio";
            case ".cpp": return "text/plain";
            case ".cpt": return "application/mac-compactpro";
            case ".cs": return "text/plain";
            case ".csh": return "application/x-csh";
            case ".css": return "text/css";
            case ".dcr": return "application/x-director";
            case ".dir": return "application/x-director";
            case ".dms": return "application/octet-stream";
            case ".doc": return "application/msword";
            case ".drw": return "application/drafting";
            case ".dvi": return "application/x-dvi";
            case ".dwg": return "application/acad";
            case ".dxf": return "application/dxf";
            case ".dxr": return "application/x-director";
            case ".eps": return "application/postscript";
            case ".etx": return "text/x-setext";
            case ".exe": return "application/octet-stream";
            case ".ez": return "application/andrew-inset";
            case ".f": return "text/plain";
            case ".f90": return "text/plain";
            case ".fli": return "video/x-fli";
            case ".flv": return "video/x-flv";
            case ".gif": return "image/gif";
            case ".gtar": return "application/x-gtar";
            case ".gz": return "application/x-gzip";
            case ".h": return "text/plain";
            case ".hdf": return "application/x-hdf";
            case ".hh": return "text/plain";
            case ".hqx": return "application/mac-binhex40";
            case ".htm": return "text/html";
            case ".html": return "text/html";
            case ".ice": return "x-conference/x-cooltalk";
            case ".ief": return "image/ief";
            case ".iges": return "model/iges";
            case ".igs": return "model/iges";
            case ".ips": return "application/x-ipscript";
            case ".ipx": return "application/x-ipix";
            case ".jpe": return "image/jpeg";
            case ".jpeg": return "image/jpeg";
            case ".jpg": return "image/jpeg";
            case ".js": return "application/x-javascript";
            case ".kar": return "audio/midi";
            case ".latex": return "application/x-latex";
            case ".lha": return "application/octet-stream";
            case ".lsp": return "application/x-lisp";
            case ".lzh": return "application/octet-stream";
            case ".m": return "text/plain";
            case ".man": return "application/x-troff-man";
            case ".me": return "application/x-troff-me";
            case ".mesh": return "model/mesh";
            case ".mid": return "audio/midi";
            case ".midi": return "audio/midi";
            case ".mime": return "www/mime";
            case ".mov": return "video/quicktime";
            case ".movie": return "video/x-sgi-movie";
            case ".mp2": return "audio/mpeg";
            case ".mp3": return "audio/mpeg";
            case ".mpe": return "video/mpeg";
            case ".mpeg": return "video/mpeg";
            case ".mpg": return "video/mpeg";
            case ".mpga": return "audio/mpeg";
            case ".ms": return "application/x-troff-ms";
            case ".msh": return "model/mesh";
            case ".nc": return "application/x-netcdf";
            case ".oda": return "application/oda";
            case ".pbm": return "image/x-portable-bitmap";
            case ".pdb": return "chemical/x-pdb";
            case ".pdf": return "application/pdf";
            case ".pgm": return "image/x-portable-graymap";
            case ".pgn": return "application/x-chess-pgn";
            case ".png": return "image/png";
            case ".pnm": return "image/x-portable-anymap";
            case ".pot": return "application/mspowerpoint";
            case ".ppm": return "image/x-portable-pixmap";
            case ".pps": return "application/mspowerpoint";
            case ".ppt": return "application/mspowerpoint";
            case ".ppz": return "application/mspowerpoint";
            case ".pre": return "application/x-freelance";
            case ".prt": return "application/pro_eng";
            case ".ps": return "application/postscript";
            case ".qt": return "video/quicktime";
            case ".ra": return "audio/x-realaudio";
            case ".ram": return "audio/x-pn-realaudio";
            case ".ras": return "image/cmu-raster";
            case ".rgb": return "image/x-rgb";
            case ".rm": return "audio/x-pn-realaudio";
            case ".roff": return "application/x-troff";
            case ".rpm": return "audio/x-pn-realaudio-plugin";
            case ".rtf": return "text/rtf";
            case ".rtx": return "text/richtext";
            case ".scm": return "application/x-lotusscreencam";
            case ".set": return "application/set";
            case ".sgm": return "text/sgml";
            case ".sgml": return "text/sgml";
            case ".sh": return "application/x-sh";
            case ".shar": return "application/x-shar";
            case ".silo": return "model/mesh";
            case ".sit": return "application/x-stuffit";
            case ".skd": return "application/x-koan";
            case ".skm": return "application/x-koan";
            case ".skp": return "application/x-koan";
            case ".skt": return "application/x-koan";
            case ".smi": return "application/smil";
            case ".smil": return "application/smil";
            case ".snd": return "audio/basic";
            case ".sol": return "application/solids";
            case ".spl": return "application/x-futuresplash";
            case ".src": return "application/x-wais-source";
            case ".step": return "application/STEP";
            case ".stl": return "application/SLA";
            case ".stp": return "application/STEP";
            case ".sv4cpio": return "application/x-sv4cpio";
            case ".sv4crc": return "application/x-sv4crc";
            case ".swf": return "application/x-shockwave-flash";
            case ".t": return "application/x-troff";
            case ".tar": return "application/x-tar";
            case ".tcl": return "application/x-tcl";
            case ".tex": return "application/x-tex";
            case ".tif": return "image/tiff";
            case ".tiff": return "image/tiff";
            case ".tr": return "application/x-troff";
            case ".tsi": return "audio/TSP-audio";
            case ".tsp": return "application/dsptype";
            case ".tsv": return "text/tab-separated-values";
            case ".txt": return "text/plain";
            case ".unv": return "application/i-deas";
            case ".ustar": return "application/x-ustar";
            case ".vcd": return "application/x-cdlink";
            case ".vda": return "application/vda";
            case ".vrml": return "model/vrml";
            case ".wav": return "audio/x-wav";
            case ".wrl": return "model/vrml";
            case ".xbm": return "image/x-xbitmap";
            case ".xlc": return "application/vnd.ms-excel";
            case ".xll": return "application/vnd.ms-excel";
            case ".xlm": return "application/vnd.ms-excel";
            case ".xls": return "application/vnd.ms-excel";
            case ".xlw": return "application/vnd.ms-excel";
            case ".xml": return "text/xml";
            case ".xpm": return "image/x-xpixmap";
            case ".xwd": return "image/x-xwindowdump";
            case ".xyz": return "chemical/x-pdb";
            case ".zip": return "application/zip";
            default: return string.Format("application/{0}", extension);
        }
    }
}
#endregion
#endregion</Code>
  <ExceptionPolicy>Report</ExceptionPolicy>
  <Language>CSharp</Language>
  <ReferenceCollection>
    <Reference>
      <RecID>8023798d-c5de-48d3-8418-5ec5255897db</RecID>
      <AssemblyFullName>JiwaApplication, Version=7.0.175.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaApplication.dll</AssemblyName>
      <AssemblyLocation>C:\VSTS\7.00.175.00\Built Files\JiwaApplication.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>dca5238a-5525-4584-a4c2-6f7bd21a6d8a</RecID>
      <AssemblyFullName>mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyFullName>
      <AssemblyName>mscorlib.dll</AssemblyName>
      <AssemblyLocation>C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>bc1b1fee-2f2b-4297-bc08-fbdb1a8d1e72</RecID>
      <AssemblyFullName>System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyFullName>
      <AssemblyName>System.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>8fafef3a-1c5b-4ab8-a65a-068609ad9a62</RecID>
      <AssemblyFullName>System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyFullName>
      <AssemblyName>System.Data.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>e1a8103e-6dc1-4bb4-b080-8f3830b114fd</RecID>
      <AssemblyFullName>JiwaODBC, Version=7.0.175.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaODBC.dll</AssemblyName>
      <AssemblyLocation>C:\VSTS\7.00.175.00\Built Files\JiwaODBC.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>18668f8d-9454-42e9-b7af-9e8621713f9e</RecID>
      <AssemblyFullName>System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyFullName>
      <AssemblyName>System.Xml.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>c727961f-fb69-4a36-b847-a3d1f3862876</RecID>
      <AssemblyFullName>System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyFullName>
      <AssemblyName>System.Runtime.Serialization.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>e9b0d73c-fbae-4399-aa76-287a83fdc6e6</RecID>
      <AssemblyFullName>System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</AssemblyFullName>
      <AssemblyName>System.Drawing.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>f262124b-2ee0-4e82-a860-b511e0945d56</RecID>
      <AssemblyFullName>Microsoft.SqlServer.Smo, Version=13.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91</AssemblyFullName>
      <AssemblyName>Microsoft.SqlServer.Smo.dll</AssemblyName>
      <AssemblyLocation>C:\VSTS\7.00.175.00\Built Files\Microsoft.SqlServer.Smo.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>b1af3cd0-9fc8-4374-890a-1dc7282497d6</RecID>
      <AssemblyFullName>Microsoft.SqlServer.ConnectionInfo, Version=13.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91</AssemblyFullName>
      <AssemblyName>Microsoft.SqlServer.ConnectionInfo.dll</AssemblyName>
      <AssemblyLocation>C:\VSTS\7.00.175.00\Built Files\Microsoft.SqlServer.ConnectionInfo.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>85f3162f-71f7-4b11-b361-206811892db0</RecID>
      <AssemblyFullName>System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyFullName>
      <AssemblyName>System.Windows.Forms.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>ecd7a118-02ff-4e25-b856-91389dc17886</RecID>
      <AssemblyFullName>Infragistics4.Win.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Win.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Win.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>be098588-944b-40b5-bf65-64aead4adea3</RecID>
      <AssemblyFullName>Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</AssemblyFullName>
      <AssemblyName>Microsoft.VisualBasic.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.VisualBasic\v4.0_10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualBasic.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>7c2a33cc-3c64-4f1e-b261-a4c9bdff68f3</RecID>
      <AssemblyFullName>Infragistics4.Win.Misc.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.Misc.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Win.Misc.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Win.Misc.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>95cf340f-ae1a-4160-afde-08c5334ea34c</RecID>
      <AssemblyFullName>Infragistics4.Win.UltraWinEditors.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.UltraWinEditors.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Win.UltraWinEditors.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Win.UltraWinEditors.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>1c96bb5a-67d0-4b07-9041-816c649ba21e</RecID>
      <AssemblyFullName>Infragistics4.Win.UltraWinExplorerBar.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.UltraWinExplorerBar.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Win.UltraWinExplorerBar.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Win.UltraWinExplorerBar.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>4661bb9a-5291-418a-b2b1-5a447bb65ff4</RecID>
      <AssemblyFullName>Infragistics4.Win.UltraWinTree.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.UltraWinTree.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Win.UltraWinTree.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Win.UltraWinTree.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>a5eabf7a-9e2c-4a80-98c0-ab1c68a858cc</RecID>
      <AssemblyFullName>FarPoint.Win.Spread, Version=8.35.20151.0, Culture=neutral, PublicKeyToken=327c3516b1b18457</AssemblyFullName>
      <AssemblyName>FarPoint.Win.Spread.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\assembly\GAC_MSIL\FarPoint.Win.Spread\8.35.20151.0__327c3516b1b18457\FarPoint.Win.Spread.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>e3199f12-c8b0-4fd8-be02-077bf655bde2</RecID>
      <AssemblyFullName>Infragistics4.Win.UltraWinTabControl.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.UltraWinTabControl.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Win.UltraWinTabControl.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Win.UltraWinTabControl.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>9127d57a-1dc3-4fdd-9550-76ab8bd0aa56</RecID>
      <AssemblyFullName>Infragistics4.Win.UltraWinToolbars.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.UltraWinToolbars.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Win.UltraWinToolbars.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Win.UltraWinToolbars.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>236692ab-e215-4500-8c90-85ce47bc36c5</RecID>
      <AssemblyFullName>Infragistics4.Win.UltraWinStatusBar.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.UltraWinStatusBar.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Win.UltraWinStatusBar.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Win.UltraWinStatusBar.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>69d10254-d82a-493d-ab60-5de4c2e2f2f0</RecID>
      <AssemblyFullName>Infragistics4.Win.UltraWinListView.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.UltraWinListView.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Win.UltraWinListView.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Win.UltraWinListView.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>4f7facf1-e85d-4958-8764-8869ac63683c</RecID>
      <AssemblyFullName>ActiproSoftware.SyntaxEditor.WinForms, Version=12.1.304.0, Culture=neutral, PublicKeyToken=c27e062d3c1a4763</AssemblyFullName>
      <AssemblyName>ActiproSoftware.SyntaxEditor.WinForms.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\assembly\GAC_MSIL\ActiproSoftware.SyntaxEditor.WinForms\16.1.330.0__c27e062d3c1a4763\ActiproSoftware.SyntaxEditor.WinForms.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>31e6d857-5049-4684-a579-55aa91052a65</RecID>
      <AssemblyFullName>ZetaHtmlEditControl, Version=1.1.0.3, Culture=neutral, PublicKeyToken=2e2e5ba5da72b6c0</AssemblyFullName>
      <AssemblyName>ZetaHtmlEditControl.dll</AssemblyName>
      <AssemblyLocation>C:\VSTS\7.00.175.00\Built Files\ZetaHtmlEditControl.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>f3b71f21-b564-4fc3-968a-7550df205709</RecID>
      <AssemblyFullName>ActiproSoftware.SyntaxEditor.Addons.DotNet.WinForms, Version=12.1.304.0, Culture=neutral, PublicKeyToken=c27e062d3c1a4763</AssemblyFullName>
      <AssemblyName>ActiproSoftware.SyntaxEditor.Addons.DotNet.WinForms.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\assembly\GAC_MSIL\ActiproSoftware.SyntaxEditor.Addons.DotNet.WinForms\16.1.330.0__c27e062d3c1a4763\ActiproSoftware.SyntaxEditor.Addons.DotNet.WinForms.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>25e3747f-4a61-4779-9ddf-3649cb52da7f</RecID>
      <AssemblyFullName>JiwaEncryption, Version=7.0.175.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaEncryption.dll</AssemblyName>
      <AssemblyLocation>C:\VSTS\7.00.175.00\Built Files\JiwaEncryption.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>a068e266-ae37-44b7-98d6-bcaedfa2c5b4</RecID>
      <AssemblyFullName>System.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</AssemblyFullName>
      <AssemblyName>System.Security.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Security\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Security.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>64c76c1e-c2b6-4915-87e3-df45b4eb686d</RecID>
      <AssemblyFullName>Microsoft.SqlServer.Dac, Version=13.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</AssemblyFullName>
      <AssemblyName>Microsoft.SqlServer.Dac.dll</AssemblyName>
      <AssemblyLocation>C:\VSTS\7.00.175.00\Built Files\Microsoft.SqlServer.Dac.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>b8eef940-c717-4749-9d90-5e95a9d12061</RecID>
      <AssemblyFullName>CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304</AssemblyFullName>
      <AssemblyName>CrystalDecisions.CrystalReports.Engine.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\assembly\GAC_MSIL\CrystalDecisions.CrystalReports.Engine\13.0.2000.0__692fbea5521e1304\CrystalDecisions.CrystalReports.Engine.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>46c3bef0-ef89-41bd-beb3-2a9e599dd32f</RecID>
      <AssemblyFullName>CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304</AssemblyFullName>
      <AssemblyName>CrystalDecisions.Shared.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\assembly\GAC_MSIL\CrystalDecisions.Shared\13.0.2000.0__692fbea5521e1304\CrystalDecisions.Shared.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>c846a0c7-14b0-4fa5-a419-619b996d3a08</RecID>
      <AssemblyFullName>CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304</AssemblyFullName>
      <AssemblyName>CrystalDecisions.ReportAppServer.ClientDoc.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\assembly\GAC_MSIL\CrystalDecisions.ReportAppServer.ClientDoc\13.0.2000.0__692fbea5521e1304\CrystalDecisions.ReportAppServer.ClientDoc.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>f18cfa69-380c-4a8e-a007-09c5aed1da47</RecID>
      <AssemblyFullName>CrystalDecisions.ReportAppServer.Controllers, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304</AssemblyFullName>
      <AssemblyName>CrystalDecisions.ReportAppServer.Controllers.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\assembly\GAC_MSIL\CrystalDecisions.ReportAppServer.Controllers\13.0.2000.0__692fbea5521e1304\CrystalDecisions.ReportAppServer.Controllers.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>ad5eb47c-a990-4f79-9b72-19c5eab1b042</RecID>
      <AssemblyFullName>System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</AssemblyFullName>
      <AssemblyName>System.Core.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>e945be8f-7460-4af4-a48b-82d201a531bc</RecID>
      <AssemblyFullName>Infragistics4.Win.AppStylistSupport.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.AppStylistSupport.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Win.AppStylistSupport.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Win.AppStylistSupport.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>c222e9d5-e18d-4f58-a6ec-6bd16ffe1f9a</RecID>
      <AssemblyFullName>JiwaLib, Version=7.0.175.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c</AssemblyFullName>
      <AssemblyName>JiwaLib.dll</AssemblyName>
      <AssemblyLocation>C:\VSTS\7.00.175.00\Built Files\JiwaLib.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>d5fea2e7-f759-4fdc-9743-72101fe31080</RecID>
      <AssemblyFullName>CrystalDecisions.Windows.Forms, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304</AssemblyFullName>
      <AssemblyName>CrystalDecisions.Windows.Forms.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\assembly\GAC_MSIL\CrystalDecisions.Windows.Forms\13.0.2000.0__692fbea5521e1304\CrystalDecisions.Windows.Forms.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>269d3544-378a-498b-acf6-88448feb7626</RecID>
      <AssemblyFullName>Infragistics4.Win.UltraWinSchedule.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.UltraWinSchedule.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Win.UltraWinSchedule.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Win.UltraWinSchedule.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>9910969f-d287-40d7-b428-c61cc3a10cb9</RecID>
      <AssemblyFullName>Infragistics4.Win.UltraWinGrid.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Win.UltraWinGrid.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Win.UltraWinGrid.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Win.UltraWinGrid.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>d6686748-0f26-4828-b000-0fe5d69b7b69</RecID>
      <AssemblyFullName>Infragistics4.Shared.v13.1, Version=13.1.20131.2060, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb</AssemblyFullName>
      <AssemblyName>Infragistics4.Shared.v13.1.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Infragistics4.Shared.v13.1\v4.0_13.1.20131.2060__7dd5c3163f2cd0cb\Infragistics4.Shared.v13.1.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>1876e8c4-f240-4467-9af6-256117e38ba8</RecID>
      <AssemblyFullName>ActiproSoftware.Shared.WinForms, Version=12.1.304.0, Culture=neutral, PublicKeyToken=c27e062d3c1a4763</AssemblyFullName>
      <AssemblyName>ActiproSoftware.Shared.WinForms.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\assembly\GAC_MSIL\ActiproSoftware.Shared.WinForms\16.1.330.0__c27e062d3c1a4763\ActiproSoftware.Shared.WinForms.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>b08b695c-682f-4523-901b-feca5c180451</RecID>
      <AssemblyFullName>FarPoint.Win, Version=8.35.20151.0, Culture=neutral, PublicKeyToken=327c3516b1b18457</AssemblyFullName>
      <AssemblyName>FarPoint.Win.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\assembly\GAC_MSIL\FarPoint.Win\8.35.20151.0__327c3516b1b18457\FarPoint.Win.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>1aec915e-4ae6-4224-b0c0-395f4d2126a8</RecID>
      <AssemblyFullName>CrystalDecisions.ReportAppServer.ReportDefModel, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304</AssemblyFullName>
      <AssemblyName>CrystalDecisions.ReportAppServer.ReportDefModel.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\assembly\GAC_MSIL\CrystalDecisions.ReportAppServer.ReportDefModel\13.0.2000.0__692fbea5521e1304\CrystalDecisions.ReportAppServer.ReportDefModel.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>6a624d47-fd26-4f71-b2ac-e14e1aa5fe87</RecID>
      <AssemblyFullName>Microsoft.OData.Client, Version=6.14.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35</AssemblyFullName>
      <AssemblyName>Microsoft.OData.Client.dll</AssemblyName>
      <AssemblyLocation>C:\VSTS\7.00.175.00\Built Files\Microsoft.OData.Client.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>0f39f70b-e304-4795-aac9-b43a1b0820fa</RecID>
      <AssemblyFullName>Microsoft.OData.Core, Version=6.14.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35</AssemblyFullName>
      <AssemblyName>Microsoft.OData.Core.dll</AssemblyName>
      <AssemblyLocation>C:\VSTS\7.00.175.00\Built Files\Microsoft.OData.Core.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>b852c90a-3a43-4e2a-a2d0-c518095aba1f</RecID>
      <AssemblyFullName>Microsoft.OData.Edm, Version=6.14.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35</AssemblyFullName>
      <AssemblyName>Microsoft.OData.Edm.dll</AssemblyName>
      <AssemblyLocation>C:\VSTS\7.00.175.00\Built Files\Microsoft.OData.Edm.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>e8abd33b-6d29-4403-a13e-9beca0f8c4c5</RecID>
      <AssemblyFullName>Microsoft.OData.ProxyExtensions, Version=1.0.35.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</AssemblyFullName>
      <AssemblyName>Microsoft.OData.ProxyExtensions.dll</AssemblyName>
      <AssemblyLocation>C:\VSTS\7.00.175.00\Built Files\Microsoft.OData.ProxyExtensions.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>5d701ee0-f841-48d4-a3d1-e8f9cf3e9521</RecID>
      <AssemblyFullName>Microsoft.Office.Interop.Outlook, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</AssemblyFullName>
      <AssemblyName>Microsoft.Office.Interop.Outlook.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\assembly\GAC_MSIL\Microsoft.Office.Interop.Outlook\15.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Outlook.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>546a13a4-b0e3-4289-8c7e-3b8a2fdaa938</RecID>
      <AssemblyFullName>Microsoft.Office365.OutlookServices.Portable, Version=2.0.1.0, Culture=neutral, PublicKeyToken=null</AssemblyFullName>
      <AssemblyName>Microsoft.Office365.OutlookServices.Portable.dll</AssemblyName>
      <AssemblyLocation>C:\VSTS\7.00.175.00\Built Files\Microsoft.Office365.OutlookServices.Portable.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>44c8d5fe-d6a1-4e61-994f-7e07b4c25206</RecID>
      <AssemblyFullName>Microsoft.Spatial, Version=6.14.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35</AssemblyFullName>
      <AssemblyName>Microsoft.Spatial.dll</AssemblyName>
      <AssemblyLocation>C:\VSTS\7.00.175.00\Built Files\Microsoft.Spatial.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>604bf891-da58-4ffb-9c2c-a10417cd88b6</RecID>
      <AssemblyFullName>System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</AssemblyFullName>
      <AssemblyName>System.Runtime.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>e9558774-7eae-4952-93e9-3df67b27c9ae</RecID>
      <AssemblyFullName>System.Threading.Tasks, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</AssemblyFullName>
      <AssemblyName>System.Threading.Tasks.dll</AssemblyName>
      <AssemblyLocation>C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Threading.Tasks\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Threading.Tasks.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>d2ebbfa2-6043-4589-969e-63004a8eb6cc</RecID>
      <AssemblyFullName>Microsoft.IdentityModel.Clients.ActiveDirectory, Version=2.23.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35</AssemblyFullName>
      <AssemblyName>Microsoft.IdentityModel.Clients.ActiveDirectory.dll</AssemblyName>
      <AssemblyLocation>C:\VSTS\7.00.175.00\Built Files\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</AssemblyLocation>
    </Reference>
    <Reference>
      <RecID>3439e60e-c427-49ff-ae65-f38a65dfa6d3</RecID>
      <AssemblyFullName>Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms, Version=2.23.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35</AssemblyFullName>
      <AssemblyName>Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</AssemblyName>
      <AssemblyLocation>C:\VSTS\7.00.175.00\Built Files\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</AssemblyLocation>
    </Reference>
  </ReferenceCollection>
  <CustomFieldCollection>
    <CustomField>
      <RecID>0c8cf71b-0a76-4e16-a614-e6af3fb45c76</RecID>
      <Name>EmailProvider</Name>
      <Description>Email Provider to use to send emails</Description>
      <DisplayOrder>1</DisplayOrder>
      <CellType>Combo</CellType>
      <CustomFieldModule>Staff Maintenance</CustomFieldModule>
    </CustomField>
  </CustomFieldCollection>
  <SystemSettingCollection>
    <SystemSetting>
      <RecID>41fb0e8c177b47378792</RecID>
      <IDKey>SMTPServerAddress</IDKey>
      <Description>Address of the SMTP server to use for sending emails (if Staff member has Email Provider set to SMTP)</Description>
      <DisplayOrder>1</DisplayOrder>
      <CellType>Text</CellType>
      <Contents />
      <DisplayContents />
    </SystemSetting>
    <SystemSetting>
      <RecID>9371c6e80ef749728825</RecID>
      <IDKey>SMTPServerPortNumber</IDKey>
      <Description>Port number to use when connecting to the SMTP server (if Staff member has Email Provider set to SMTP)</Description>
      <DisplayOrder>2</DisplayOrder>
      <CellType>Integer</CellType>
      <Contents />
      <DisplayContents />
    </SystemSetting>
    <SystemSetting>
      <RecID>2d626250be98439f952f</RecID>
      <IDKey>SMTPRequiresSSL</IDKey>
      <Description>Does the SMTP server require SSL (if Staff member has Email Provider set to SMTP)</Description>
      <DisplayOrder>3</DisplayOrder>
      <CellType>Checkbox</CellType>
      <Contents />
      <DisplayContents />
    </SystemSetting>
    <SystemSetting>
      <RecID>8dcf70ca7caf4ec9b0fe</RecID>
      <IDKey>ClientID</IDKey>
      <Description>The ClientID of the Azure AD Application (Applicable only if Staff member has Email Provider set to OFFICE 365 REST API)</Description>
      <DisplayOrder>4</DisplayOrder>
      <CellType>Text</CellType>
      <Contents />
      <DisplayContents />
    </SystemSetting>
  </SystemSettingCollection>
</JiwaDocument>