Skip to content

Commit

Permalink
Update to 1.0.7
Browse files Browse the repository at this point in the history
- Added: Global interface for RestApiClients
- Added: StackToPath converter
  • Loading branch information
AndreasReitberger committed Jan 4, 2022
1 parent def7a07 commit eb6bb95
Show file tree
Hide file tree
Showing 13 changed files with 78 additions and 4 deletions.
Binary file modified source/.vs/RCoreSharp/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
11 changes: 11 additions & 0 deletions source/.vs/RCoreSharp/project-colors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"Version": 1,
"ProjectMap": {
"4cecc30f-e3f9-4f56-a435-b4523542338b": {
"ProjectGuid": "4cecc30f-e3f9-4f56-a435-b4523542338b",
"DisplayName": "RCoreSharp",
"ColorIndex": 0
}
},
"NextColorIndex": 1
}
Binary file modified source/.vs/RCoreSharp/v16/.suo
Binary file not shown.
Binary file added source/.vs/RCoreSharp/v16/TestStore/0/000.testlog
Binary file not shown.
Binary file not shown.
Binary file added source/.vs/RCoreSharp/v17/.futdcache.v1
Binary file not shown.
Binary file added source/.vs/RCoreSharp/v17/.suo
Binary file not shown.
Binary file added source/.vs/RCoreSharp/v17/TestStore/0/000.testlog
Binary file not shown.
Binary file not shown.
10 changes: 10 additions & 0 deletions source/CoreSharp/Enums/SslProtocolsHack.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace AndreasReitberger.Core.Enums
{
// https://github.com/sta/websocket-sharp/issues/219#issuecomment-453535816
public enum SslProtocolsHack
{
Tls = 192,
Tls11 = 768,
Tls12 = 3072
}
}
35 changes: 35 additions & 0 deletions source/CoreSharp/Interfaces/IRestApiClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System;
using System.ComponentModel;
using System.Threading;
using System.Threading.Tasks;

namespace AndreasReitberger.Core.Interfaces
{
public interface IRestApiClient : INotifyPropertyChanged, IDisposable
{
#region Properties

public Guid Id { get; set; }

#region Connection
public string ServerAddress { get; set; }
public bool IsSecure { get; set; }
public bool LoginRequired { get; set; }
public string API { get; set; }
public int Port { get; set; }
public bool IsOnline { get; set; }
public bool IsConnecting { get; set; }
public bool AuthenticationFailed { get; set; }
public bool IsRefreshing { get; set; }
#endregion

#endregion

#region Methods
public Task CheckOnlineAsync(int Timeout = 10000);
public Task CheckOnlineAsync(CancellationTokenSource cts);
public bool CheckIfConfigurationHasChanged(object temp);
public void CancelCurrentRequests();
#endregion
}
}
10 changes: 6 additions & 4 deletions source/CoreSharp/RCoreSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,23 @@
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Description>A simple library holding useful and recurring functions.</Description>
<RootNamespace>AndreasReitberger.Core</RootNamespace>
<Version>1.0.6</Version>
<AssemblyVersion>1.0.6.0</AssemblyVersion>
<FileVersion>1.0.6.0</FileVersion>
<Version>1.0.7</Version>
<AssemblyVersion>1.0.7.0</AssemblyVersion>
<FileVersion>1.0.7.0</FileVersion>
<RepositoryUrl>https://github.com/AndreasReitberger/CoreSharp</RepositoryUrl>
<PackageTags>Core, Library, Sharp</PackageTags>
<RepositoryType>GitHub</RepositoryType>
<PackageProjectUrl>https://github.com/AndreasReitberger/CoreSharp</PackageProjectUrl>
<LangVersion>9.0</LangVersion>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="System.Threading.Channels" Version="5.0.0" />
<PackageReference Include="System.Threading.Channels" Version="6.0.0" />
<None Include="..\..\README.md" Pack="true" PackagePath="\" />
</ItemGroup>

</Project>
16 changes: 16 additions & 0 deletions source/CoreSharp/Utilities/CommonConverters.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AndreasReitberger.Core.Utilities
{
Expand All @@ -14,5 +16,19 @@ public static List<string> DictionaryToStringList(Dictionary<string, List<string
}
return list;
}

public static string StackToPath(Stack<string> stack, string separator)
{
StringBuilder sb = new();
for (int i = stack.Count - 1; i >= 0; i--)
{
sb.Append(stack.ElementAt(i));
if (i > 0)
{
sb.Append(separator);
}
}
return sb.ToString();
}
}
}

0 comments on commit eb6bb95

Please sign in to comment.