Skip to content

Commit

Permalink
Merge branch 'main' into doc
Browse files Browse the repository at this point in the history
  • Loading branch information
lpeyr committed Jun 30, 2023
2 parents fe967e8 + 4fd3357 commit 382b81a
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 33 deletions.
24 changes: 22 additions & 2 deletions PeyrSharp.Core/Internet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,33 @@ public static async Task<StatusInfo> GetStatusInfoAsync(string url)
/// </summary>
/// <param name="url">The page where to check if Internet is available.</param>
/// <returns><see langword="true"/> if the Internet can be reach.</returns>
public static async Task<bool> IsAvailableAsync(string url) => await GetStatusCodeAsync(url) != 400;
public static async Task<bool> IsAvailableAsync(string url)
{
try
{
return await GetStatusCodeAsync(url) != 400;
}
catch
{
return false; // An excpetion has been thrown likely because the client couldn't resolve the host.
}
}

/// <summary>
/// Checks if a connection to the Internet is available.
/// </summary>
/// <returns><see langword="true"/> if the Internet can be reach.</returns>
public static async Task<bool> IsAvailableAsync() => await GetStatusCodeAsync("https://www.bing.com") != 400;
public static async Task<bool> IsAvailableAsync()
{
try
{
return await GetStatusCodeAsync("https://www.bing.com") != 400;
}
catch
{
return false; // An excpetion has been thrown likely because the client couldn't resolve the host.
}
}

/// <summary>
/// Gets the kind of the status code.
Expand Down
12 changes: 5 additions & 7 deletions PeyrSharp.Core/PeyrSharp.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFrameworks>net5.0;net6.0;net7.0</TargetFrameworks>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<Title>PeyrSharp.Core</Title>
<Version>1.7.0.2307-pre1</Version>
<Version>1.6.1.2305</Version>
<Authors>Devyus</Authors>
<Description>Core methods and features of PeyrSharp.</Description>
<Copyright>© 2023</Copyright>
Expand All @@ -16,10 +16,8 @@
<PackageReadmeFile>NUGET_README.md</PackageReadmeFile>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<PackageReleaseNotes>- Added Range() method in Stats (#117)
- Added Variance() method in Stats (#118)
- Improved exceptions
</PackageReleaseNotes>
<PackageReleaseNotes>- Fixed IsAvailableAsync() crashes when no internet connection is available
(#112)</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
Expand All @@ -34,8 +32,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="PeyrSharp.Enums" Version="1.6.0.2305" />
<PackageReference Include="PeyrSharp.Exceptions" Version="1.6.0.2305" />
<PackageReference Include="PeyrSharp.Enums" Version="1.6.1.2305" />
<PackageReference Include="PeyrSharp.Exceptions" Version="1.6.1.2305" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion PeyrSharp.Enums/PeyrSharp.Enums.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<PackageProjectUrl>https://peyrsharp.leocorporation.dev/</PackageProjectUrl>
<RepositoryUrl>https://github.com/DevyusCode/PeyrSharp</RepositoryUrl>
<PackageTags>enums;c-sharp;dotnet;vb;peyrsharp;leo corp</PackageTags>
<Version>1.6.0.2305</Version>
<Version>1.6.1.2305</Version>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<PackageIcon>logo.png</PackageIcon>
<PackageReadmeFile>NUGET_README.md</PackageReadmeFile>
Expand Down
7 changes: 3 additions & 4 deletions PeyrSharp.Env/PeyrSharp.Env.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFrameworks>net5.0;net6.0;net7.0</TargetFrameworks>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<Title>PeyrSharp.Env</Title>
<Version>1.6.0.2305</Version>
<Version>1.6.1.2305</Version>
<Authors>Devyus</Authors>
<Description>Environment-related methods of PeyrSharp.</Description>
<Copyright>© 2023</Copyright>
Expand All @@ -16,8 +16,7 @@
<PackageReadmeFile>NUGET_README.md</PackageReadmeFile>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<PackageReleaseNotes>- Added the possibility to format the logged message (#89)
- Added the possibility to generate a log message depending on the `LogLevel` (#91)</PackageReleaseNotes>
<PackageReleaseNotes></PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
Expand All @@ -32,6 +31,6 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="PeyrSharp.Enums" Version="1.6.0.2305" />
<PackageReference Include="PeyrSharp.Enums" Version="1.6.1.2305" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion PeyrSharp.Exceptions/PeyrSharp.Exceptions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Nullable>enable</Nullable>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Title>PeyrSharp.Exceptions</Title>
<Version>1.6.0.2305</Version>
<Version>1.6.1.2305</Version>
<Company>Devyus</Company>
<Description>Exceptions of PeyrSharp.</Description>
<Copyright>© 2023</Copyright>
Expand Down
4 changes: 2 additions & 2 deletions PeyrSharp.Extensions/PeyrSharp.Extensions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFrameworks>net5.0;net6.0;net7.0</TargetFrameworks>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<Title>PeyrSharp.Extensions</Title>
<Version>1.6.0.2305</Version>
<Version>1.6.1.2305</Version>
<Authors>Devyus</Authors>
<Description>Extensions methods of PeyrSharp.</Description>
<Copyright>© 2023</Copyright>
Expand All @@ -31,7 +31,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="PeyrSharp.Enums" Version="1.6.0.2305" />
<PackageReference Include="PeyrSharp.Enums" Version="1.6.1.2305" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions PeyrSharp.UiHelpers/PeyrSharp.UiHelpers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<UseWPF>true</UseWPF>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<Title>PeyrSharp.UiHelpers</Title>
<Version>1.6.0.2305</Version>
<Version>1.6.1.2305</Version>
<Authors>Devyus</Authors>
<Description>Useful helpers for Windows Forms and Windows Presentation Framework.</Description>
<Copyright>© 2023</Copyright>
Expand All @@ -35,7 +35,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="PeyrSharp.Enums" Version="1.6.0.2305" />
<PackageReference Include="PeyrSharp.Enums" Version="1.6.1.2305" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion PeyrSharp/PeyrSharp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ public static class PeyrSharp
/// <summary>
/// The current version of PeyrSharp.
/// </summary>
public static string Version => "1.6.0.2305";
public static string Version => "1.6.1.2305";
}
}
21 changes: 8 additions & 13 deletions PeyrSharp/PeyrSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFrameworks>net5.0;net6.0;net5.0-windows;net6.0-windows;net7.0;net7.0-windows</TargetFrameworks>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<Title>PeyrSharp</Title>
<Version>1.6.0.2305</Version>
<Version>1.6.1.2305</Version>
<Authors>Devyus</Authors>
<Copyright>© 2023</Copyright>
<Description>A C# library designed to make developers' job easier.</Description>
Expand All @@ -17,12 +17,7 @@
<PackageReadmeFile>NUGET_README.md</PackageReadmeFile>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<PackageReleaseNotes>- Added a method to convert bits to bytes (#100)
- Added a method to convert bytes to bits (#101)
- Added a method to convert mach to km/h (#102)
- Added a method to convert mach to miles/h (#103)
- Added a StatusInfo class (#104)
- Added a method that gets the status info of a URL (#105)</PackageReleaseNotes>
<PackageReleaseNotes>- Fixed IsAvailableAsync() crashes when no internet connection is available (#112)</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
Expand All @@ -37,12 +32,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="PeyrSharp.Core" Version="1.6.0.2305" />
<PackageReference Include="PeyrSharp.Enums" Version="1.6.0.2305" />
<PackageReference Include="PeyrSharp.Env" Version="1.6.0.2305" />
<PackageReference Include="PeyrSharp.Exceptions" Version="1.6.0.2305" />
<PackageReference Include="PeyrSharp.Extensions" Version="1.6.0.2305" />
<PackageReference Condition="'$(TargetPlatformIdentifier)' == 'Windows'" Include="PeyrSharp.UiHelpers" Version="1.6.0.2305" />
<PackageReference Include="PeyrSharp.Core" Version="1.6.1.2305" />
<PackageReference Include="PeyrSharp.Enums" Version="1.6.1.2305" />
<PackageReference Include="PeyrSharp.Env" Version="1.6.1.2305" />
<PackageReference Include="PeyrSharp.Exceptions" Version="1.6.1.2305" />
<PackageReference Include="PeyrSharp.Extensions" Version="1.6.1.2305" />
<PackageReference Condition="'$(TargetPlatformIdentifier)' == 'Windows'" Include="PeyrSharp.UiHelpers" Version="1.6.1.2305" />
</ItemGroup>

</Project>

0 comments on commit 382b81a

Please sign in to comment.