Skip to content

Commit

Permalink
Add .NET6.0 support, add WPF with embedded window example, update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sambertrdk committed Oct 20, 2023
1 parent 925364a commit 4074afd
Show file tree
Hide file tree
Showing 28 changed files with 545 additions and 67 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/RoboDK-API.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: RoboDK-API

on:
pull_request:
push:
workflow_dispatch: # Run workflow manually
branches: [master]
paths:
- "Python/**"
- "!Python/Examples/**"
- "!Python/setup.py"
- "**.py"

env:
BUILD_TYPE: Release

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [windows-latest]
python-version: ["3.7"]

steps:
- name: Setup Python (x64)
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
architecture: x64

- name: Display Python version (x64)
run: python -c "import sys; print(sys.version)"

- uses: actions/checkout@v2

- name: Tests the Python API
run: |
cd ${{ github.workspace }}
python _Compile_Posts.py
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ doxygen_output
_site
packages
/C#/API/log.txt
/C#/API/api/*.yml
/C#/API/api/.manifest
*.bak
Python/unit_tests/report.html

Expand Down
6 changes: 3 additions & 3 deletions C#/API/IItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@

using System;
using System.Collections.Generic;
#if NETCORE
using System.Drawing;
#else
#if NET45
using System.Windows.Media;
#else
using System.Drawing;
#endif
using RoboDk.API.Model;

Expand Down
6 changes: 3 additions & 3 deletions C#/API/IRoboDk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
#if NETCORE
using System.Drawing;
#else
#if NET45
using System.Windows.Media;
#else
using System.Drawing;
#endif
using RoboDk.API.Model;

Expand Down
6 changes: 3 additions & 3 deletions C#/API/Item.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
#if NETCORE
using System.Drawing;
#else
#if NET45
using System.Windows.Media;
#else
using System.Drawing;
#endif
using RoboDk.API.Exceptions;
using RoboDk.API.Model;
Expand Down
6 changes: 3 additions & 3 deletions C#/API/Model/RDKColorExtension.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#region Namespaces

using System.Diagnostics;
#if NETCORE
using System.Drawing;
#else
#if NET45
using System.Windows.Media;
#else
using System.Drawing;
#endif

#endregion
Expand Down
7 changes: 3 additions & 4 deletions C#/API/RoboDK.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@
using System.Net.NetworkInformation;
using System.Net.Sockets;
using System.Text;
#if NETCORE
using System.Drawing;
#else
#if NET45
using System.Windows.Media;
#else
using System.Drawing;
#endif
using Microsoft.Win32;
using RoboDk.API.Exceptions;
Expand Down Expand Up @@ -2808,7 +2808,6 @@ internal bool VerifyConnection()
case ConnectionType.None:
default:
throw new RdkException($"unknown ConnectionType: {_connectionType}");
return false;
}
}
catch (SocketException socketException)
Expand Down
Binary file added C#/API/RoboDkApi.5.6.5.nupkg
Binary file not shown.
34 changes: 33 additions & 1 deletion C#/API/RoboDkApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<PropertyGroup>
<TargetFrameworks>net45;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net45;netcoreapp3.1;net6.0-windows</TargetFrameworks>
<RootNamespace>RoboDk.API</RootNamespace>
</PropertyGroup>
<!--<PropertyGroup>
Expand Down Expand Up @@ -65,4 +65,36 @@
<DefineConstants>NET472;NETFULL</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net45|AnyCPU'">
<NoWarn>1701;1702;CS0168</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net45|AnyCPU'">
<NoWarn>1701;1702;CS0168</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netcoreapp3.1|AnyCPU'">
<NoWarn>1701;1702;CS0168</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netcoreapp3.1|AnyCPU'">
<NoWarn>1701;1702;CS0168</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net6.0|AnyCPU'">
<NoWarn>1701;1702;CS0168</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net6.0|AnyCPU'">
<NoWarn>1701;1702;CS0168</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net6.0-windows|AnyCPU'">
<NoWarn>1701;1702;CS0168</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net6.0-windows|AnyCPU'">
<NoWarn>1701;1702;CS0168</NoWarn>
</PropertyGroup>

</Project>
10 changes: 6 additions & 4 deletions C#/API/RoboDkApi.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
<package >
<metadata>
<id>RoboDkApi</id>
<version>5.6.2</version>
<version>5.6.5</version>
<title>RoboDK API</title>
<authors>RoboDK</authors>
<projectUrl>https://robodk.com/</projectUrl>
<icon>RoboDK.png</icon>
<repository type="git" url="https://github.com/RoboDK/RoboDK-API" />
<license type="file">license.txt</license>
<dependencies>
<group targetFramework="net45" />
<group targetFramework="netcoreapp3.1" />
<group targetFramework="net45" />
<group targetFramework="netcoreapp3.1" />
<group targetFramework="net6.0" />
</dependencies>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<copyright>Copyright RoboDK 2023</copyright>
Expand All @@ -22,9 +23,10 @@
<files>
<file src="bin\Release\net45\*.*" target="lib/net45" />
<file src="bin\Release\netcoreapp3.1\*.*" target="lib/netcoreapp3.1" />
<file src="bin\Release\net6.0-windows\*.*" target="lib/net6.0" />
<file src="license.txt" target="" />
<file src="RoboDK.png" target="" />
<file src="RoboDK.ico" target="" />
<file src="RoboDK-API-Documentation.url" target="" />
<file src="RoboDK-API-Documentation.url" target="" />
</files>
</package>
1 change: 0 additions & 1 deletion C#/API/articles/toc.md

This file was deleted.

2 changes: 2 additions & 0 deletions C#/API/articles/toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- name: Introduction
href: intro.md
34 changes: 27 additions & 7 deletions C#/API/docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,31 @@
]
}
],
"dest": "obj/api"
"dest": "api",
"outputFormat": "mref",
"includePrivateMembers": false,
"disableGitFeatures": true,
"disableDefaultFilter": false,
"noRestore": false,
"namespaceLayout": "flattened",
"memberLayout": "samePage",
"enumSortOrder": "alphabetic",
"allowCompilationErrors": false
}
],
"build": {
"content": [
{
"files": [
"api/**.yml"
],
"cwd": "obj"
"api/**.yml",
"api/index.md"
]
},
{
"files": [
"api/*.md",
"articles/**.md",
"articles/**/toc.yml",
"toc.yml",
"*.md"
],
Expand Down Expand Up @@ -60,9 +70,19 @@
]
}
],
"dest": "_site",
"output": "_site",
"globalMetadata": {
"_appLogoPath": "images/logo.svg",
"_appFaviconPath": "images/favicon.ico"
},
"globalMetadataFiles": [],
"fileMetadataFiles": [],
"template": [
"default"
]
"default",
"modern"
],
"postProcessors": [],
"keepFileLink": false,
"disableGitFeatures": true
}
}
Binary file added C#/API/images/favicon.ico
Binary file not shown.
101 changes: 101 additions & 0 deletions C#/API/images/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified C#/API/nuget.exe
Binary file not shown.
3 changes: 1 addition & 2 deletions C#/API/toc.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

- name: Articles
href: articles/
- name: API Documentation
href: obj/api/
href: api/
homepage: api/index.md
9 changes: 9 additions & 0 deletions C#/APIExamples/RoboDKApiWPFApplication/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Application x:Class="RoboDKApiWPFApplication.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:RoboDKApiWPFApplication"
StartupUri="MainWindow.xaml">
<Application.Resources>

</Application.Resources>
</Application>
17 changes: 17 additions & 0 deletions C#/APIExamples/RoboDKApiWPFApplication/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;

namespace RoboDKApiWPFApplication
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}
10 changes: 10 additions & 0 deletions C#/APIExamples/RoboDKApiWPFApplication/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System.Windows;

[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
15 changes: 15 additions & 0 deletions C#/APIExamples/RoboDKApiWPFApplication/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Window x:Class="RoboDKApiWPFApplication.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:RoboDKApiWPFApplication"
mc:Ignorable="d"
Title="RoboDK WPF Example" Height="800" Width="1200"
Loaded="Window_Loaded" Closing="Window_Closing"
Icon="Resources/IconRoboDK.ico">
<Grid>
<Border Name="border1" Background="LightGray" BorderBrush="Black" BorderThickness="1" Margin="10" SizeChanged="border1_SizeChanged">
</Border>
</Grid>
</Window>
Loading

0 comments on commit 4074afd

Please sign in to comment.