File tree Expand file tree Collapse file tree
RGB.NET.Devices.Corsair/Native Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : RGB.NET-CI
22
33on :
4- push :
5- branches : [ Development ]
6- paths :
7- - ' **.cs'
8- - ' **.csproj'
9- - ' **.yml'
4+ workflow_dispatch :
5+ inputs :
6+ version :
7+ description : ' version'
8+ required : true
9+ type : string
10+ increment :
11+ required : true
12+ type : string
1013
1114jobs :
1215 build :
@@ -24,16 +27,10 @@ jobs:
2427 8.0.x
2528 7.0.x
2629 6.0.x
27- - name : Git Semantic Version
28- id : versioning
29- uses : PaulHatch/semantic-version@v4.0.3
30- with :
31- short_tags : false
32- format : " ${major}.${minor}.${patch}-prerelease.${increment}"
3330 - name : Restore dependencies
3431 run : dotnet restore
3532 - name : Build
36- run : dotnet build --no-restore --configuration Release /p:Version=${{ steps.versioning.outputs .version }}
33+ run : dotnet build --no-restore --configuration Release /p:Version=${{ github.event.inputs .version }}-prerelease.${{ github.event.inputs.increment }}
3734 - name : Test
3835 run : dotnet test --no-build --verbosity normal --configuration Release
3936 - name : Upload a Build Artifact NET6
Original file line number Diff line number Diff line change 11name : RGB.NET-Release
22
33on :
4- push :
5- branches : [ master ]
6- paths :
7- - ' **.cs '
8- - ' **.csproj '
9- - ' **.yml '
4+ workflow_dispatch :
5+ inputs :
6+ version :
7+ description : ' version '
8+ required : true
9+ type : string
1010
1111jobs :
1212 build :
@@ -23,16 +23,10 @@ jobs:
2323 8.0.x
2424 7.0.x
2525 6.0.x
26- - name : Git Semantic Version
27- id : versioning
28- uses : PaulHatch/semantic-version@v4.0.3
29- with :
30- short_tags : false
31- format : " ${major}.${minor}.${patch}"
3226 - name : Restore dependencies
3327 run : dotnet restore
3428 - name : Build
35- run : dotnet build --no-restore --configuration Release /p:Version=${{ steps.versioning.outputs .version }}
29+ run : dotnet build --no-restore --configuration Release /p:Version=${{ github.event.inputs .version }}
3630 - name : Test
3731 run : dotnet test --no-build --verbosity normal --configuration Release
3832 - name : Upload a Build Artifact NET6
6256 - name : Release
6357 uses : softprops/action-gh-release@v1
6458 with :
65- tag_name : ${{ steps.versioning.outputs.version_tag }}
59+ tag_name : v ${{ github.event.inputs.version }}
6660 generate_release_notes : true
6761 files : bin/net8.0/RGB.NET.*.dll
6862 - name : Nuget Push
Original file line number Diff line number Diff line change @@ -47,6 +47,9 @@ internal static unsafe class _CUESDK
4747
4848 #region Properties & Fields
4949
50+ // ReSharper disable once NotAccessedField.Local - This is important, the delegate can be collected if it's not stored!
51+ private static readonly CorsairSessionStateChangedHandler SESSION_STATE_CHANGED_CALLBACK ;
52+
5053 internal static bool IsConnected => SesionState == CorsairSessionState . Connected ;
5154 internal static CorsairSessionState SesionState { get ; private set ; }
5255
@@ -58,6 +61,15 @@ internal static unsafe class _CUESDK
5861
5962 #endregion
6063
64+ #region Constructors
65+
66+ static _CUESDK ( )
67+ {
68+ SESSION_STATE_CHANGED_CALLBACK = CorsairSessionStateChangedCallback ;
69+ }
70+
71+ #endregion
72+
6173 #region Methods
6274
6375 private static void CorsairSessionStateChangedCallback ( nint context , _CorsairSessionStateChanged eventdata )
@@ -174,7 +186,7 @@ internal static CorsairError CorsairConnect()
174186 {
175187 if ( _corsairConnectPtr == null ) throw new RGBDeviceException ( "The Corsair-SDK is not initialized." ) ;
176188 if ( IsConnected ) throw new RGBDeviceException ( "The Corsair-SDK is already connected." ) ;
177- return _corsairConnectPtr ( CorsairSessionStateChangedCallback , 0 ) ;
189+ return _corsairConnectPtr ( SESSION_STATE_CHANGED_CALLBACK , 0 ) ;
178190 }
179191
180192 internal static CorsairError CorsairGetSessionDetails ( out _CorsairSessionDetails ? details )
You can’t perform that action at this time.
0 commit comments