-
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The code changes primarily involve updates to the .NET framework and …
…C# version, renaming of classes, replacement of the JSON library, and updates to package versions. 1. The `openHAB.Core.Client.csproj` file has been updated to target the .NET Standard 2.0 framework and use C# version 11.0. It also includes additional project sources for package restoration and adds package references for `Azure.Core` and `Microsoft.Azure.AutoRest.CSharp`. 2. The `openHAB.Common.csproj` file has been updated to use newer versions of the `Microsoft.WindowsAppSDK` and `Microsoft.Windows.SDK.BuildTools` packages. 3. Several classes have been renamed, such as `OpenHABSitemap` to `Sitemap`, `OpenHABItem` to `Item`, and `OpenHABWidget` to `WidgetViewModel`. This suggests a simplification or standardization of class names. 4. The JSON library used for serialization and deserialization has been changed from `Newtonsoft.Json` to `System.Text.Json.Serialization`. 5. The versions of several package references, such as `Microsoft.WindowsAppSDK`, `Microsoft.Windows.SDK.BuildTools`, and `Microsoft.Extensions.Logging.Abstractions`, have been updated. 6. The namespace `openHAB.Core.Services` was changed to `openHAB.Windows.Services` in `WidgetNavigationService.cs`, `MainPage.xaml.cs`, and `SitemapPage.xaml.cs`. 7. The `Page` class was replaced with `Microsoft.UI.Xaml.Controls.Page` in `MainPage.xaml.cs` and `SitemapPage.xaml.cs`. 8. The `WigetNavigation` class was replaced with `WidgetNavigationMessage` in `MainViewModel.cs` and `SitemapViewModel.cs`. 9. The `ObservableCollection<OpenHABWidget>` was replaced with `ObservableCollection<WidgetViewModel>` in `MainViewModel.cs`. 10. The `ObservableCollection<OpenHABSitemap>` was replaced with `ObservableCollection<Sitemap>` in `MainViewModel.cs`. 11. The `List<OpenHABSitemap>` was replaced with `List<Sitemap>` in `MainViewModel.cs`. 12. The `ICollection<OpenHABWidget>` was replaced with `ICollection<Widget>` in `SitemapViewModel.cs`. 13. The `ICollection<OpenHABWidgetMapping>` was replaced with `ICollection<WidgetMapping>` in `SitemapViewModel.cs`. 14. The `OpenHABItem` class was replaced with `Item` in `WidgetViewModel.cs`. 15. The `ObservableCollection<WidgetViewModel>` was added to `WidgetViewModel.cs`. 16. The `Encoding` property was added to `WidgetViewModel.cs`. 17. The `Parent` property was added to `WidgetViewModel.cs`. 18. The `Visibility` property was added to `WidgetViewModel.cs`. 19. The `CreateAsync` method was added to `WidgetViewModel.cs`. 20. The `LoadData` method was added to `WidgetViewModel.cs`. 21. The `CacheAndRetrieveLocalIconPath` method was added to `WidgetViewModel.cs`. 22. The `ConvertColorCodeToColor` method was added to `WidgetViewModel.cs`. 23. The version of the `Mapsui` and `Mapsui.WinUI` packages in the `openHAB.Windows.csproj` file have been updated from `4.1.3` to `4.1.4`. 24. The version of the `Microsoft.WindowsAppSDK` package in the `openHAB.Windows.csproj` file has been updated from `1.4.231219000` to `1.5.240311000`.
- Loading branch information
Showing
47 changed files
with
10,986 additions
and
569 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,19 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<LangVersion>11.0</LangVersion> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
<Nullable>annotations</Nullable> | ||
<IncludeGeneratorSharedCode>true</IncludeGeneratorSharedCode> | ||
<DefineConstants>$(DefineConstants);EXPERIMENTAL</DefineConstants> | ||
<RestoreAdditionalProjectSources>https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json</RestoreAdditionalProjectSources> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Azure.Core" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Azure.AutoRest.CSharp" Version="3.0.0-beta.20240322.2" PrivateAssets="All" /> | ||
</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
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,43 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Text.Json.Serialization; | ||
using System.Text.Json; | ||
using System.Threading.Tasks; | ||
|
||
namespace openHAB.Core.Client | ||
{ | ||
public class AutoNumberToStringConverter : JsonConverter<object> | ||
{ | ||
public override bool CanConvert(Type typeToConvert) | ||
{ | ||
return typeof(string) == typeToConvert; | ||
} | ||
|
||
public override object Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) | ||
{ | ||
if (reader.TokenType == JsonTokenType.Number) | ||
{ | ||
return reader.TryGetInt64(out long l) ? | ||
l.ToString() : | ||
reader.GetDouble().ToString(); | ||
} | ||
|
||
if (reader.TokenType == JsonTokenType.String) | ||
{ | ||
return reader.GetString(); | ||
} | ||
|
||
using (JsonDocument document = JsonDocument.ParseValue(ref reader)) | ||
{ | ||
return document.RootElement.Clone().ToString(); | ||
} | ||
} | ||
|
||
public override void Write(Utf8JsonWriter writer, object value, JsonSerializerOptions options) | ||
{ | ||
writer.WriteStringValue(value.ToString()); | ||
} | ||
} | ||
} |
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.