-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'v2/hotfix/2.0.1' into v2/main
- Loading branch information
Showing
21 changed files
with
198 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
|
||
<PropertyGroup> | ||
<vendruSyncPluginFolder>App_Plugins\Vendr.uSync</vendruSyncPluginFolder> | ||
<vendruSyncPackageContentFilesPath>$(MSBuildThisFileDirectory)..\content\$(vendruSyncPluginFolder)\**\*.*</vendruSyncPackageContentFilesPath> | ||
</PropertyGroup> | ||
|
||
<Target Name="CopyVendruSyncPackageAssets" BeforeTargets="Build"> | ||
<ItemGroup> | ||
<vendruSyncPackageContentFiles Include="$(vendruSyncPackageContentFilesPath)" /> | ||
</ItemGroup> | ||
<Message Text="Copying Vendr.uSync Package files -> $(vendruSyncPluginFolder) - #@(vendruSyncPackageContentFiles->Count()) files" Importance="high" /> | ||
<Warning Text="No Vendr.uSync Package files found in $(vendruSyncPluginFolder)" Condition="@(vendruSyncPackageContentFiles->Count()) == 0" /> | ||
|
||
<Copy | ||
SourceFiles="@(vendruSyncPackageContentFiles)" | ||
DestinationFiles="@(vendruSyncPackageContentFiles->'$(MSBuildProjectDirectory)\$(vendruSyncPluginFolder)\%(RecursiveDir)%(Filename)%(Extension)')" | ||
SkipUnchangedFiles="true" /> | ||
|
||
</Target> | ||
|
||
<Target Name="ClearVendruSyncPackageAssets" BeforeTargets="Clean"> | ||
<ItemGroup> | ||
<vendruSyncPackageDir Include="$(MSBuildProjectDirectory)\$(vendruSyncPluginFolder)\" /> | ||
</ItemGroup> | ||
<Message Text="Clear old vendr.uSync Package data" Importance="high" /> | ||
<RemoveDir Directories="@(vendruSyncPackageDir)" /> | ||
</Target> | ||
|
||
</Project> |
29 changes: 29 additions & 0 deletions
29
src/Vendr.uSync/Configuration/VendrSycnSettingsAccessor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#if NET | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.Extensions.Options; | ||
using System; | ||
#endif | ||
|
||
namespace Vendr.uSync.Configuration | ||
{ | ||
public class VendrSyncSettingsAccessor | ||
{ | ||
#if NETFRAMEWORK | ||
public VendrSyncSettings Settings { get; } | ||
|
||
public VendrSyncSettingsAccessor(VendrSyncSettings settings) | ||
{ | ||
Settings = settings; | ||
} | ||
#else | ||
private readonly IServiceProvider _serviceProvider; | ||
|
||
public VendrSyncSettingsAccessor(IServiceProvider serviceProvider) | ||
{ | ||
_serviceProvider = serviceProvider; | ||
} | ||
|
||
public VendrSyncSettings Settings => _serviceProvider.GetRequiredService<IOptions<VendrSyncSettings>>().Value; | ||
#endif | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System; | ||
|
||
#if NETFRAMEWORK | ||
using System.Configuration; | ||
using System.Linq; | ||
#endif | ||
|
||
|
||
namespace Vendr.uSync.Configuration | ||
{ | ||
public class VendrSyncSettings | ||
{ | ||
public VendrSyncPaymentMethodSettings PaymentMethods { get; set; } | ||
|
||
public VendrSyncSettings() | ||
{ | ||
PaymentMethods = new VendrSyncPaymentMethodSettings(); | ||
} | ||
} | ||
|
||
public class VendrSyncPaymentMethodSettings | ||
{ | ||
public string[] IgnoreSettings { get; set; } | ||
|
||
public VendrSyncPaymentMethodSettings() | ||
{ | ||
#if NETFRAMEWORK | ||
IgnoreSettings = (ConfigurationManager.AppSettings["Vendr.uSync:PaymentMethods:IgnoreSettings"] ?? "") | ||
.Split(new[] { "," }, System.StringSplitOptions.RemoveEmptyEntries) | ||
.ToArray(); | ||
#else | ||
IgnoreSettings = Array.Empty<string>(); | ||
#endif | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.