-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from akobr/develop
Alfa version of .NET standard library
- Loading branch information
Showing
490 changed files
with
7,987 additions
and
15,355 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
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; | ||
|
||
namespace StrongBeaver.Core.Platform | ||
{ | ||
public class DelegatedPlatformFactory : IPlatformFactory | ||
{ | ||
private readonly Func<IDeviceInfo> deviceInfoFactory; | ||
private readonly Func<IPlatformInfo> platformInfoFactory; | ||
private readonly Func<IApplicationInfo> applicationInfoFactory; | ||
|
||
public DelegatedPlatformFactory( | ||
Func<IDeviceInfo> deviceInfoFactory, | ||
Func<IPlatformInfo> platformInfoFactory, | ||
Func<IApplicationInfo> applicationInfoFactory) | ||
{ | ||
this.deviceInfoFactory = deviceInfoFactory; | ||
this.platformInfoFactory = platformInfoFactory; | ||
this.applicationInfoFactory = applicationInfoFactory; | ||
} | ||
|
||
public IDeviceInfo BuildDeviceInfo() | ||
{ | ||
return deviceInfoFactory?.Invoke(); | ||
} | ||
|
||
public IPlatformInfo BuildPlatformInfo() | ||
{ | ||
return platformInfoFactory?.Invoke(); | ||
} | ||
|
||
public IApplicationInfo BuildApplicationInfo() | ||
{ | ||
return applicationInfoFactory?.Invoke(); | ||
} | ||
} | ||
} |
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
...ver.Core/Platform/DefaultPlatformModel.cs → ...ngBeaver.Core.Platform/EnvironmentInfo.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
File renamed without changes.
File renamed without changes.
6 changes: 2 additions & 4 deletions
6
StrongBeaver.Core/Platform/IPlatformModel.cs → ...gBeaver.Core.Platform/IEnvironmentInfo.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
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,11 @@ | ||
namespace StrongBeaver.Core.Platform | ||
{ | ||
public interface IPlatformFactory | ||
{ | ||
IDeviceInfo BuildDeviceInfo(); | ||
|
||
IPlatformInfo BuildPlatformInfo(); | ||
|
||
IApplicationInfo BuildApplicationInfo(); | ||
} | ||
} |
File renamed without changes.
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,13 @@ | ||
namespace StrongBeaver.Core.Platform | ||
{ | ||
public interface IPlatformProvider | ||
{ | ||
IDeviceInfo DeviceInfo { get; } | ||
|
||
IPlatformInfo PlatformInfo { get; } | ||
|
||
IApplicationInfo ApplicationInfo { get; } | ||
|
||
IEnvironmentInfo EnvironmentInfo { get; } | ||
} | ||
} |
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,39 @@ | ||
using System; | ||
using System.Threading; | ||
|
||
namespace StrongBeaver.Core.Platform | ||
{ | ||
public class PlatformProvider : IPlatformProvider | ||
{ | ||
private readonly Lazy<IDeviceInfo> deviceInfo; | ||
private readonly Lazy<IPlatformInfo> platformInfo; | ||
private readonly Lazy<IApplicationInfo> applicationInfo; | ||
private readonly Lazy<IEnvironmentInfo> environmentInfo; | ||
|
||
public PlatformProvider(IPlatformFactory factory) | ||
{ | ||
if (factory == null) | ||
{ | ||
throw new ArgumentNullException(nameof(factory)); | ||
} | ||
|
||
deviceInfo = new Lazy<IDeviceInfo>(factory.BuildDeviceInfo, LazyThreadSafetyMode.PublicationOnly); | ||
platformInfo = new Lazy<IPlatformInfo>(factory.BuildPlatformInfo, LazyThreadSafetyMode.PublicationOnly); | ||
applicationInfo = new Lazy<IApplicationInfo>(factory.BuildApplicationInfo, LazyThreadSafetyMode.PublicationOnly); | ||
environmentInfo = new Lazy<IEnvironmentInfo>(BuildEnvironmentInfo, LazyThreadSafetyMode.PublicationOnly); | ||
} | ||
|
||
public IDeviceInfo DeviceInfo => deviceInfo.Value; | ||
|
||
public IPlatformInfo PlatformInfo => platformInfo.Value; | ||
|
||
public IApplicationInfo ApplicationInfo => applicationInfo.Value; | ||
|
||
public IEnvironmentInfo EnvironmentInfo => environmentInfo.Value; | ||
|
||
private IEnvironmentInfo BuildEnvironmentInfo() | ||
{ | ||
return new EnvironmentInfo(platformInfo.Value, deviceInfo.Value, applicationInfo.Value); | ||
} | ||
} | ||
} |
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
24 changes: 24 additions & 0 deletions
24
StrongBeaver.Core.Platform/StrongBeaver.Core.Platform.csproj
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,24 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<PackageId>BeaverSoft.StrongBeaver.Core.Platform</PackageId> | ||
<Version>0.9.1-alpha</Version> | ||
<Authors>BeaverSoft (Ales Kobr)</Authors> | ||
<Company>BeaverSoft (Ales Kobr)</Company> | ||
<Product>Platform info objects for StrongBeaver Framework</Product> | ||
<Description>Platform info objects for StrongBeaver Framework.</Description> | ||
<Copyright>Copyright 2017</Copyright> | ||
<PackageLicenseUrl>https://github.com/akobr/strong-beaver/blob/master/LICENSE</PackageLicenseUrl> | ||
<PackageProjectUrl>https://github.com/akobr/strong-beaver</PackageProjectUrl> | ||
<PackageIconUrl>https://github.com/akobr/strong-beaver/blob/master/doc/design/icon-nuget-package.png?raw=true</PackageIconUrl> | ||
<PackageTags>Framework Strong Beaver Platform</PackageTags> | ||
<PackageReleaseNotes>Alpha version created by BeaverSoft.</PackageReleaseNotes> | ||
<NeutralLanguage>en-150</NeutralLanguage> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\StrongBeaver.Core\StrongBeaver.Core.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
Oops, something went wrong.