Parameters are now stored in common place and available for all users (app folder in file portable.config)

This commit is contained in:
Tomek Melissa 2018-04-27 12:54:47 +02:00
Родитель e8a21e307c
Коммит 1c4334bcdb
6 изменённых файлов: 132 добавлений и 128 удалений

Просмотреть файл

@ -55,9 +55,10 @@
<setting name="UpdateSettings" serializeAs="String">
<value>True</value>
</setting>
<setting name="DataJobs" serializeAs="Xml">
<setting name="DataJobs" serializeAs="Xml">
<value>
<ArrayOfDataJob xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ArrayOfDataJob xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<DataJob>
<Name>Customers import</Name>
<ActivityId>00000000-0000-0000-0000-000000000000</ActivityId>
@ -69,7 +70,8 @@
</setting>
<setting name="Instances" serializeAs="Xml">
<value>
<ArrayOfInstance xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ArrayOfInstance xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Instance>
<Name>Contoso PROD</Name>
<AosUri>https://contoso.production.operations.dynamics.com</AosUri>
@ -81,7 +83,8 @@
</setting>
<setting name="Users" serializeAs="Xml">
<value>
<ArrayOfUser xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ArrayOfUser xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<User>
<Login>admin@contoso.com</Login>
<Password>pass@word1</Password>
@ -91,7 +94,8 @@
</setting>
<setting name="JobGroups" serializeAs="Xml">
<value>
<ArrayOfJobGroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ArrayOfJobGroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<JobGroup>
<Name>Import jobs</Name>
</JobGroup>
@ -109,17 +113,18 @@
</setting>
<setting name="AadApplications" serializeAs="Xml">
<value>
<ArrayOfAadApplication xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ArrayOfAadApplication xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<AadApplication>
<Name>User impersonation</Name>
<ClientId>00000000-0000-0000-0000-000000000000</ClientId>
<Secret/>
<Secret />
<AuthenticationType>User</AuthenticationType>
</AadApplication>
<AadApplication>
<Name>Service to Service</Name>
<ClientId>00000000-0000-0000-0000-000000000000</ClientId>
<Secret/>
<Secret />
<AuthenticationType>Service</AuthenticationType>
</AadApplication>
</ArrayOfAadApplication>

Просмотреть файл

@ -1,6 +1,7 @@
/* Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. */
using Bluegrams.Application;
using RecurringIntegrationsScheduler.Forms;
using System;
using System.Windows.Forms;
@ -15,6 +16,7 @@ namespace RecurringIntegrationsScheduler
[STAThread]
private static void Main()
{
PortableSettingsProvider.ApplyProvider(Properties.Settings.Default);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());

116
Scheduler/Properties/Settings.Designer.cs сгенерированный
Просмотреть файл

@ -12,7 +12,7 @@ namespace RecurringIntegrationsScheduler.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.6.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.7.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@ -116,17 +116,15 @@ namespace RecurringIntegrationsScheduler.Properties {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute(@"
<?xml version=""1.0"" encoding=""utf-16""?>
<ArrayOfDataJob xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
<DataJob>
<Name>Customers import</Name>
<ActivityId>00000000-0000-0000-0000-000000000000</ActivityId>
<EntityName>Customers</EntityName>
<Type>Download</Type>
</DataJob>
</ArrayOfDataJob>
")]
[global::System.Configuration.DefaultSettingValueAttribute(@"<?xml version=""1.0"" encoding=""utf-16""?>
<ArrayOfDataJob xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
<DataJob>
<Name>Customers import</Name>
<ActivityId>00000000-0000-0000-0000-000000000000</ActivityId>
<EntityName>Customers</EntityName>
<Type>Download</Type>
</DataJob>
</ArrayOfDataJob>")]
[global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)]
public global::RecurringIntegrationsScheduler.Settings.DataJobs DataJobs {
get {
@ -139,17 +137,15 @@ namespace RecurringIntegrationsScheduler.Properties {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute(@"
<?xml version=""1.0"" encoding=""utf-16""?>
<ArrayOfAxInstance xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
<Instance>
<Name>Contoso PROD</Name>
<AosUri>https://contoso.production.axcloud.dynamics.com</AosUri>
<AzureAuthEndpoint>https://login.microsoftonline.com</AzureAuthEndpoint>
<AadTenant>contoso.com</AadTenant>
</Instance>
</ArrayOfInstance>
")]
[global::System.Configuration.DefaultSettingValueAttribute(@"<?xml version=""1.0"" encoding=""utf-16""?>
<ArrayOfInstance xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
<Instance>
<Name>Contoso PROD</Name>
<AosUri>https://contoso.production.operations.dynamics.com</AosUri>
<AzureAuthEndpoint>https://login.microsoftonline.com</AzureAuthEndpoint>
<AadTenant>contoso.com</AadTenant>
</Instance>
</ArrayOfInstance>")]
[global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)]
public global::RecurringIntegrationsScheduler.Settings.Instances Instances {
get {
@ -162,15 +158,13 @@ namespace RecurringIntegrationsScheduler.Properties {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute(@"
<?xml version=""1.0"" encoding=""utf-16""?>
<ArrayOfUser xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
<User>
<Login>admin@contoso.com</Login>
<Password>pass@word1</Password>
</User>
</ArrayOfUser>
")]
[global::System.Configuration.DefaultSettingValueAttribute(@"<?xml version=""1.0"" encoding=""utf-16""?>
<ArrayOfUser xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
<User>
<Login>admin@contoso.com</Login>
<Password>pass@word1</Password>
</User>
</ArrayOfUser>")]
[global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)]
public global::RecurringIntegrationsScheduler.Settings.Users Users {
get {
@ -183,17 +177,21 @@ namespace RecurringIntegrationsScheduler.Properties {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute(@"
<?xml version=""1.0"" encoding=""utf-16""?>
<ArrayOfJobGroup xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
<JobGroup>
<Name>Download jobs</Name>
</JobGroup>
<JobGroup>
<Name>Upload jobs</Name>
</JobGroup>
</ArrayOfJobGroup>
")]
[global::System.Configuration.DefaultSettingValueAttribute(@"<?xml version=""1.0"" encoding=""utf-16""?>
<ArrayOfJobGroup xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
<JobGroup>
<Name>Import jobs</Name>
</JobGroup>
<JobGroup>
<Name>Export jobs</Name>
</JobGroup>
<JobGroup>
<Name>Download jobs</Name>
</JobGroup>
<JobGroup>
<Name>Upload jobs</Name>
</JobGroup>
</ArrayOfJobGroup>")]
[global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)]
public global::RecurringIntegrationsScheduler.Settings.JobGroups JobGroups {
get {
@ -206,23 +204,21 @@ namespace RecurringIntegrationsScheduler.Properties {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute(@"
<?xml version=""1.0"" encoding=""utf-16""?>
<ArrayOfAadApplication xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
<AadApplication>
<Name>User impersonation</Name>
<ClientId>00000000-0000-0000-0000-000000000000</ClientId>
<Secret />
<AuthenticationType>User</AuthenticationType>
</AadApplication>
<AadApplication>
<Name>Service to Service</Name>
<ClientId>00000000-0000-0000-0000-000000000000</ClientId>
<Secret />
<AuthenticationType>Service</AuthenticationType>
</AadApplication>
</ArrayOfAadApplication>
")]
[global::System.Configuration.DefaultSettingValueAttribute(@"<?xml version=""1.0"" encoding=""utf-16""?>
<ArrayOfAadApplication xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
<AadApplication>
<Name>User impersonation</Name>
<ClientId>00000000-0000-0000-0000-000000000000</ClientId>
<Secret />
<AuthenticationType>User</AuthenticationType>
</AadApplication>
<AadApplication>
<Name>Service to Service</Name>
<ClientId>00000000-0000-0000-0000-000000000000</ClientId>
<Secret />
<AuthenticationType>Service</AuthenticationType>
</AadApplication>
</ArrayOfAadApplication>")]
[global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)]
public global::RecurringIntegrationsScheduler.Settings.AadApplications AadApplications {
get {

Просмотреть файл

@ -20,77 +20,73 @@
<Setting Name="ProcessingErrorsFolder" Roaming="true" Type="System.String" Scope="User">
<Value Profile="(Default)">ProcessingErrors</Value>
</Setting>
<Setting Name="UpdateSettings" Roaming="true" Type="System.Boolean" Scope="User">
<Setting Name="UpdateSettings" Roaming="true" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="DataJobs" Roaming="true" Type="RecurringIntegrationsScheduler.Settings.DataJobs" Scope="User">
<Value Profile="(Default)">
&lt;?xml version="1.0" encoding="utf-16"?&gt;
&lt;ArrayOfDataJob xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
&lt;DataJob&gt;
&lt;Name&gt;Customers import&lt;/Name&gt;
&lt;ActivityId&gt;00000000-0000-0000-0000-000000000000&lt;/ActivityId&gt;
&lt;EntityName&gt;Customers&lt;/EntityName&gt;
&lt;Type&gt;Download&lt;/Type&gt;
&lt;/DataJob&gt;
&lt;/ArrayOfDataJob&gt;
</Value>
<Value Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;
&lt;ArrayOfDataJob xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
&lt;DataJob&gt;
&lt;Name&gt;Customers import&lt;/Name&gt;
&lt;ActivityId&gt;00000000-0000-0000-0000-000000000000&lt;/ActivityId&gt;
&lt;EntityName&gt;Customers&lt;/EntityName&gt;
&lt;Type&gt;Download&lt;/Type&gt;
&lt;/DataJob&gt;
&lt;/ArrayOfDataJob&gt;</Value>
</Setting>
<Setting Name="Instances" Roaming="true" Type="RecurringIntegrationsScheduler.Settings.Instances" Scope="User">
<Value Profile="(Default)">
&lt;?xml version="1.0" encoding="utf-16"?&gt;
&lt;ArrayOfAxInstance xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
&lt;Instance&gt;
&lt;Name&gt;Contoso PROD&lt;/Name&gt;
&lt;AosUri&gt;https://contoso.production.axcloud.dynamics.com&lt;/AosUri&gt;
&lt;AzureAuthEndpoint&gt;https://login.microsoftonline.com&lt;/AzureAuthEndpoint&gt;
&lt;AadTenant&gt;contoso.com&lt;/AadTenant&gt;
&lt;/Instance&gt;
&lt;/ArrayOfInstance&gt;
</Value>
<Value Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;
&lt;ArrayOfInstance xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
&lt;Instance&gt;
&lt;Name&gt;Contoso PROD&lt;/Name&gt;
&lt;AosUri&gt;https://contoso.production.operations.dynamics.com&lt;/AosUri&gt;
&lt;AzureAuthEndpoint&gt;https://login.microsoftonline.com&lt;/AzureAuthEndpoint&gt;
&lt;AadTenant&gt;contoso.com&lt;/AadTenant&gt;
&lt;/Instance&gt;
&lt;/ArrayOfInstance&gt;</Value>
</Setting>
<Setting Name="Users" Roaming="true" Type="RecurringIntegrationsScheduler.Settings.Users" Scope="User">
<Value Profile="(Default)">
&lt;?xml version="1.0" encoding="utf-16"?&gt;
&lt;ArrayOfUser xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
&lt;User&gt;
&lt;Login&gt;admin@contoso.com&lt;/Login&gt;
&lt;Password&gt;pass@word1&lt;/Password&gt;
&lt;/User&gt;
&lt;/ArrayOfUser&gt;
</Value>
<Value Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;
&lt;ArrayOfUser xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
&lt;User&gt;
&lt;Login&gt;admin@contoso.com&lt;/Login&gt;
&lt;Password&gt;pass@word1&lt;/Password&gt;
&lt;/User&gt;
&lt;/ArrayOfUser&gt;</Value>
</Setting>
<Setting Name="JobGroups" Roaming="true" Type="RecurringIntegrationsScheduler.Settings.JobGroups" Scope="User">
<Value Profile="(Default)">
&lt;?xml version="1.0" encoding="utf-16"?&gt;
&lt;ArrayOfJobGroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
&lt;JobGroup&gt;
&lt;Name&gt;Download jobs&lt;/Name&gt;
&lt;/JobGroup&gt;
&lt;JobGroup&gt;
&lt;Name&gt;Upload jobs&lt;/Name&gt;
&lt;/JobGroup&gt;
&lt;/ArrayOfJobGroup&gt;
</Value>
<Value Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;
&lt;ArrayOfJobGroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
&lt;JobGroup&gt;
&lt;Name&gt;Import jobs&lt;/Name&gt;
&lt;/JobGroup&gt;
&lt;JobGroup&gt;
&lt;Name&gt;Export jobs&lt;/Name&gt;
&lt;/JobGroup&gt;
&lt;JobGroup&gt;
&lt;Name&gt;Download jobs&lt;/Name&gt;
&lt;/JobGroup&gt;
&lt;JobGroup&gt;
&lt;Name&gt;Upload jobs&lt;/Name&gt;
&lt;/JobGroup&gt;
&lt;/ArrayOfJobGroup&gt;</Value>
</Setting>
<Setting Name="AadApplications" Roaming="true" Type="RecurringIntegrationsScheduler.Settings.AadApplications" Scope="User">
<Value Profile="(Default)">
&lt;?xml version="1.0" encoding="utf-16"?&gt;
&lt;ArrayOfAadApplication xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
&lt;AadApplication&gt;
&lt;Name&gt;User impersonation&lt;/Name&gt;
&lt;ClientId&gt;00000000-0000-0000-0000-000000000000&lt;/ClientId&gt;
&lt;Secret /&gt;
&lt;AuthenticationType&gt;User&lt;/AuthenticationType&gt;
&lt;/AadApplication&gt;
&lt;AadApplication&gt;
&lt;Name&gt;Service to Service&lt;/Name&gt;
&lt;ClientId&gt;00000000-0000-0000-0000-000000000000&lt;/ClientId&gt;
&lt;Secret /&gt;
&lt;AuthenticationType&gt;Service&lt;/AuthenticationType&gt;
&lt;/AadApplication&gt;
&lt;/ArrayOfAadApplication&gt;
</Value>
<Value Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;
&lt;ArrayOfAadApplication xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
&lt;AadApplication&gt;
&lt;Name&gt;User impersonation&lt;/Name&gt;
&lt;ClientId&gt;00000000-0000-0000-0000-000000000000&lt;/ClientId&gt;
&lt;Secret /&gt;
&lt;AuthenticationType&gt;User&lt;/AuthenticationType&gt;
&lt;/AadApplication&gt;
&lt;AadApplication&gt;
&lt;Name&gt;Service to Service&lt;/Name&gt;
&lt;ClientId&gt;00000000-0000-0000-0000-000000000000&lt;/ClientId&gt;
&lt;Secret /&gt;
&lt;AuthenticationType&gt;Service&lt;/AuthenticationType&gt;
&lt;/AadApplication&gt;
&lt;/ArrayOfAadApplication&gt;</Value>
</Setting>
</Settings>
</SettingsFile>

Просмотреть файл

@ -68,10 +68,14 @@
<Reference Include="Polly, Version=5.8.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Polly.5.8.0\lib\net45\Polly.dll</HintPath>
</Reference>
<Reference Include="PortableSettingsProvider, Version=0.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\PortableSettingsProvider.0.1.0\lib\net45\PortableSettingsProvider.dll</HintPath>
</Reference>
<Reference Include="Quartz, Version=3.0.4.0, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4, processorArchitecture=MSIL">
<HintPath>..\packages\Quartz.3.0.4\lib\net452\Quartz.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml.Linq" />

Просмотреть файл

@ -3,5 +3,6 @@
<package id="log4net" version="2.0.8" targetFramework="net46" />
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net46" />
<package id="Polly" version="5.8.0" targetFramework="net45" />
<package id="PortableSettingsProvider" version="0.1.0" targetFramework="net46" />
<package id="Quartz" version="3.0.4" targetFramework="net46" />
</packages>