1- using System ;
2- using System . Collections . Generic ;
3- using System . ComponentModel ;
4- using System . Diagnostics . CodeAnalysis ;
5- using System . Text . Json ;
6- using System . Linq ;
7- using System . Runtime . CompilerServices ;
8- using System . Security . Authentication ;
9- using System . Security . Cryptography ;
10- using System . Security . Policy ;
11- using System . Text ;
1+ using System . ComponentModel ;
122using System . Text . Json ;
133using System . Text . Json . Nodes ;
144using System . Text . Json . Serialization ;
15- using System . Text . Json . Serialization . Metadata ;
16- using System . Threading . Tasks ;
175using Flurl . Http ;
18- using Novus . Streams ;
19- using SmartImage . Lib . Utilities ;
206
217namespace SmartImage . Lib . Clients ;
228
239public class HydrusClient : INotifyPropertyChanged , IDisposable
2410{
25- private const string HDR_HYDRUS_KEY = "Hydrus-Client-API-Access-Key" ;
11+
12+ private const string HDR_HYDRUS_KEY = "Hydrus-Client-API-Access-Key" ;
2613
2714 public FlurlClient Client { get ; }
2815
@@ -147,7 +134,8 @@ public string Key
147134 get => m_key ;
148135 set
149136 {
150- if ( value == m_key ) return ;
137+ if ( value == m_key )
138+ return ;
151139
152140 m_key = value ;
153141 OnPropertyChanged ( ) ;
@@ -162,7 +150,8 @@ public string EndpointUrl
162150 get => m_endpointUrl ;
163151 set
164152 {
165- if ( value == m_endpointUrl ) return ;
153+ if ( value == m_endpointUrl )
154+ return ;
166155
167156 m_endpointUrl = value ;
168157 OnPropertyChanged ( ) ;
@@ -185,7 +174,8 @@ protected virtual void OnPropertyChanged([CMN] string propertyName = null)
185174
186175 protected bool SetField < T > ( ref T field , T value , [ CMN ] string propertyName = null )
187176 {
188- if ( EqualityComparer < T > . Default . Equals ( field , value ) ) return false ;
177+ if ( EqualityComparer < T > . Default . Equals ( field , value ) )
178+ return false ;
189179
190180 field = value ;
191181 OnPropertyChanged ( propertyName ) ;
@@ -194,7 +184,9 @@ protected bool SetField<T>(ref T field, T value, [CMN] string propertyName = nul
194184
195185 public static string HyEncode ( object o )
196186 {
187+ #pragma warning disable IL2026
197188 return Url . Encode ( JsonSerializer . Serialize ( o ) ) ;
189+ #pragma warning restore IL2026
198190 }
199191
200192}
@@ -278,7 +270,7 @@ public static implicit operator HydrusQuery(string[] s)
278270
279271}
280272
281- #pragma warning disable IL2026
273+ // #pragma warning disable IL2026
282274
283275public partial class HydrusFileRelationship
284276{
@@ -311,7 +303,9 @@ public static Dictionary<string, HydrusFileRelationship> Deserialize(JsonNode v)
311303 {
312304 var vs = ( ( JsonNode ) v ) [ "file_relationships" ] ;
313305
306+ #pragma warning disable IL2026
314307 var re = JsonSerializer . Deserialize < Dictionary < string , HydrusFileRelationship > > ( vs . ToString ( ) ) ;
308+ #pragma warning restore IL2026
315309
316310 return re ;
317311 }
0 commit comments