Ancora pulizia codice da warnings x exc non gestite

This commit is contained in:
Samuele E. Locatelli
2020-02-21 21:41:13 +01:00
parent 162d2e3c75
commit db40a7b079
9 changed files with 139 additions and 101 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
</startup>
<appSettings>
<add key="appName" value="IOB-MAN" />
@@ -63,4 +63,4 @@
<probing privatePath="lib;libs" xmlns="" />
</assemblyBinding>
</runtime>
</configuration>
</configuration>
+12
View File
@@ -0,0 +1,12 @@
---------------------------------------------------------------
------- SteamWareLib SDK -------
---------------------------------------------------------------
Libreria di utility base di SteamWare.
Le dipendenze inserite sono necessarie al funzionamento dell'SDK.
Sono inclusi a titolo di esempio vari files di conf:
* example-NLog.config
Attenzione a configurare correttamente il file NLog.xml includendo il rule per la classe, vedere ad esempio il file example-NLog.config allegato.
Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

+12 -1
View File
@@ -8,11 +8,12 @@
<OutputType>WinExe</OutputType>
<RootNamespace>IOB_MAN</RootNamespace>
<AssemblyName>IOB-MAN</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -79,6 +80,12 @@
<Reference Include="StackExchange.Redis, Version=2.0.0.0, Culture=neutral, PublicKeyToken=c219ff1ca8c2ce46, processorArchitecture=MSIL">
<HintPath>..\packages\StackExchange.Redis.2.0.601\lib\net461\StackExchange.Redis.dll</HintPath>
</Reference>
<Reference Include="SteamWare.IO, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SteamWare.IO.4.0.2002.731\lib\net462\SteamWare.IO.dll</HintPath>
</Reference>
<Reference Include="SteamWare.Logger, Version=4.0.2002.727, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SteamWare.Logger.4.0.2002.727\lib\net462\SteamWare.Logger.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.0\lib\netstandard2.0\System.Buffers.dll</HintPath>
@@ -143,7 +150,10 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RedisMan.cs" />
<Compile Include="utils.cs" />
<Content Include="App_Readme\README_SteamWare.txt" />
<Content Include="App_Readme\SteamWare_demo\example-favicon.ico" />
<Content Include="IobManIcon.ico" />
<Content Include="mongocrypt.dll" />
<Content Include="Resources\IobManIcon.ico">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
@@ -158,6 +168,7 @@
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="CONF\.placeholder">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
+30 -38
View File
@@ -1,69 +1,61 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
// Il codice è stato generato da uno strumento.
// Versione runtime:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// Le modifiche apportate a questo file possono provocare un comportamento non corretto e andranno perse se
// il codice viene rigenerato.
// </auto-generated>
//------------------------------------------------------------------------------
namespace IOB_MAN.Properties
{
namespace IOB_MAN.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// Classe di risorse fortemente tipizzata per la ricerca di stringhe localizzate e così via.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
// Questa classe è stata generata automaticamente dalla classe StronglyTypedResourceBuilder.
// tramite uno strumento quale ResGen o Visual Studio.
// Per aggiungere o rimuovere un membro, modificare il file con estensione ResX ed eseguire nuovamente ResGen
// con l'opzione /str oppure ricompilare il progetto VS.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// Restituisce l'istanza di ResourceManager nella cache utilizzata da questa classe.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("IOB_MAN.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// Esegue l'override della proprietà CurrentUICulture del thread corrente per tutte le
/// ricerche di risorse eseguite utilizzando questa classe di risorse fortemente tipizzata.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set
{
set {
resourceCulture = value;
}
}
+13 -17
View File
@@ -1,28 +1,24 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
// Il codice è stato generato da uno strumento.
// Versione runtime:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// Le modifiche apportate a questo file possono provocare un comportamento non corretto e andranno perse se
// il codice viene rigenerato.
// </auto-generated>
//------------------------------------------------------------------------------
namespace IOB_MAN.Properties
{
namespace IOB_MAN.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.4.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
public static Settings Default {
get {
return defaultInstance;
}
}
+68 -41
View File
@@ -1,5 +1,6 @@
using Newtonsoft.Json;
using StackExchange.Redis;
using SteamWare.Logger;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -176,7 +177,7 @@ namespace IOB_MAN
}
catch (Exception exc)
{
//logger.lg.scriviLog(string.Format("{0}", exc), tipoLog.EXCEPTION);
Logging.Instance.Error($"redServInfo:{Environment.NewLine}{exc}");
}
return answ;
}
@@ -194,7 +195,7 @@ namespace IOB_MAN
}
catch (Exception exc)
{
//logger.lg.scriviLog(string.Format("Errore in getRSV:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
Logging.Instance.Error($"getRSV:{Environment.NewLine}{exc}");
}
return answ;
}
@@ -214,7 +215,7 @@ namespace IOB_MAN
}
catch (Exception exc)
{
//logger.lg.scriviLog(string.Format("Errore in setRSV:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
Logging.Instance.Error($"setRSV:{Environment.NewLine}{exc}");
}
return answ;
}
@@ -237,7 +238,7 @@ namespace IOB_MAN
}
catch (Exception exc)
{
//logger.lg.scriviLog(string.Format("Errore in setRSV:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
Logging.Instance.Error($"setRSV + ttl:{Environment.NewLine}{exc}");
}
return answ;
}
@@ -255,7 +256,7 @@ namespace IOB_MAN
}
catch (Exception exc)
{
//logger.lg.scriviLog(string.Format("Errore in setRCI:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
Logging.Instance.Error($"setRCntI:{Environment.NewLine}{exc}");
}
return answ;
}
@@ -273,7 +274,7 @@ namespace IOB_MAN
}
catch (Exception exc)
{
//logger.lg.scriviLog(string.Format("Errore in setRCD:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
Logging.Instance.Error($"setRCntD:{Environment.NewLine}{exc}");
}
return answ;
}
@@ -293,7 +294,7 @@ namespace IOB_MAN
}
catch (Exception exc)
{
//logger.lg.scriviLog(string.Format("Errore in getRSV:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
Logging.Instance.Error($"getRCnt:{Environment.NewLine}{exc}");
}
return answInt;
}
@@ -311,7 +312,7 @@ namespace IOB_MAN
}
catch (Exception exc)
{
//logger.lg.scriviLog(string.Format("Errore in resetRCnt:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
Logging.Instance.Error($"resetRCnt:{Environment.NewLine}{exc}");
}
return answ;
}
@@ -329,7 +330,7 @@ namespace IOB_MAN
}
catch (Exception exc)
{
//logger.lg.scriviLog(string.Format("Errore in getRKeys:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
Logging.Instance.Error($"getRKeys:{Environment.NewLine}{exc}");
}
return answ;
}
@@ -348,7 +349,7 @@ namespace IOB_MAN
}
catch (Exception exc)
{
//logger.lg.scriviLog(string.Format("Errore in setRKeys:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
Logging.Instance.Error($"setRKeys:{Environment.NewLine}{exc}");
}
return answ;
}
@@ -367,7 +368,7 @@ namespace IOB_MAN
}
catch (Exception exc)
{
//logger.lg.scriviLog(string.Format("Errore in redKeyPresent per la key {2}:{0}{1}", Environment.NewLine, exc, key), tipoLog.EXCEPTION);
Logging.Instance.Error($"redKeyPresent:{Environment.NewLine}{exc}");
}
return answ;
}
@@ -384,8 +385,10 @@ namespace IOB_MAN
RedisKey chiave = key;
answ = redKeyPresent(chiave);
}
catch
{ }
catch(Exception exc)
{
Logging.Instance.Error($"redKeyPresentSz:{Environment.NewLine}{exc}");
}
return answ;
}
/// <summary>
@@ -403,7 +406,7 @@ namespace IOB_MAN
}
catch (Exception exc)
{
//logger.lg.scriviLog(string.Format("Errore in redHashPresent per la key {2}{0}{1}", Environment.NewLine, exc, key), tipoLog.EXCEPTION);
Logging.Instance.Error($"redHashPresent:{Environment.NewLine}{exc}");
}
return answ;
}
@@ -420,8 +423,10 @@ namespace IOB_MAN
RedisKey chiave = key;
answ = redHashPresent(chiave);
}
catch
{ }
catch(Exception exc)
{
Logging.Instance.Error($"redHashPresentSz:{Environment.NewLine}{exc}");
}
return answ;
}
/// <summary>
@@ -445,8 +450,10 @@ namespace IOB_MAN
i++;
}
}
catch
{ }
catch(Exception exc)
{
Logging.Instance.Error($"redGetHash:{Environment.NewLine}{exc}");
}
return answ;
}
/// <summary>
@@ -467,8 +474,10 @@ namespace IOB_MAN
answ.Add(item.Name, item.Value);
}
}
catch
{ }
catch(Exception exc)
{
Logging.Instance.Error($"redGetHashDict:{Environment.NewLine}{exc}");
}
return answ;
}
/// <summary>
@@ -488,8 +497,10 @@ namespace IOB_MAN
RedisValue valOut = cache.HashGet(chiave, campo);
answ = valOut.ToString();
}
catch
{ }
catch(Exception exc)
{
Logging.Instance.Error($"redGetHashField:{Environment.NewLine}{exc}");
}
return answ;
}
/// <summary>
@@ -515,8 +526,10 @@ namespace IOB_MAN
cache.HashSet(chiave, valori);
answ = true;
}
catch
{ }
catch(Exception exc)
{
Logging.Instance.Error($"redSaveHash:{Environment.NewLine}{exc}");
}
return answ;
}
/// <summary>
@@ -542,8 +555,10 @@ namespace IOB_MAN
cache.HashSet(chiave, valori);
answ = true;
}
catch
{ }
catch(Exception exc)
{
Logging.Instance.Error($"redSaveHashDict:{Environment.NewLine}{exc}");
}
return answ;
}
@@ -573,8 +588,10 @@ namespace IOB_MAN
cache.HashSet(chiave, valori);
answ = true;
}
catch
{ }
catch(Exception exc)
{
Logging.Instance.Error($"redSaveHashList:{Environment.NewLine}{exc}");
}
}
return answ;
}
@@ -599,8 +616,10 @@ namespace IOB_MAN
}
//answ = true;
}
catch
{ }
catch (Exception exc)
{
Logging.Instance.Error($"redSaveHash:{Environment.NewLine}{exc}");
}
return answ;
}
/// <summary>
@@ -624,8 +643,10 @@ namespace IOB_MAN
}
//answ = true;
}
catch
{ }
catch(Exception exc)
{
Logging.Instance.Error($"redSaveHashDict:{Environment.NewLine}{exc}");
}
return answ;
}
/// <summary>
@@ -643,8 +664,10 @@ namespace IOB_MAN
cache.KeyDelete(chiave);
answ = true;
}
catch
{ }
catch(Exception exc)
{
Logging.Instance.Error($"redDelKey:{Environment.NewLine}{exc}");
}
return answ;
}
/// <summary>
@@ -673,7 +696,7 @@ namespace IOB_MAN
}
catch (Exception exc)
{
//logger.lg.scriviLog(string.Format("{0}", exc), tipoLog.EXCEPTION);
Logging.Instance.Error($"redFlushKey:{Environment.NewLine}{exc}");
}
return answ;
}
@@ -701,7 +724,7 @@ namespace IOB_MAN
}
catch (Exception exc)
{
//logger.lg.scriviLog(string.Format("{0}", exc), tipoLog.EXCEPTION);
Logging.Instance.Error($"redCountKey:{Environment.NewLine}{exc}");
}
return answ;
}
@@ -722,8 +745,10 @@ namespace IOB_MAN
answ += server.DatabaseSize();
}
}
catch
{ }
catch (Exception exc)
{
Logging.Instance.Error($"numRecRedis:{Environment.NewLine}{exc}");
}
return answ;
}
}
@@ -757,7 +782,7 @@ namespace IOB_MAN
}
catch (Exception exc)
{
//logger.lg.scriviLog(string.Format("{0}", exc), tipoLog.EXCEPTION);
Logging.Instance.Error($"redGetCounterByKey 01:{Environment.NewLine}{exc}");
}
// ora recupero valori!
var valori = getRKeys(chiavi);
@@ -771,8 +796,10 @@ namespace IOB_MAN
answ.Add(new KeyValuePair<string, int>(chiavi[i], currVal));
}
}
catch
{ }
catch (Exception exc)
{
Logging.Instance.Error($"redGetCounterByKey 02:{Environment.NewLine}{exc}");
}
// se richiesto riordino...
switch (orderBy)
{
Binary file not shown.
+2 -2
View File
@@ -17,8 +17,8 @@
<package id="SharpZipLib" version="1.2.0" targetFramework="net461" />
<package id="Snappy.NET" version="1.1.1.8" targetFramework="net461" />
<package id="StackExchange.Redis" version="2.0.601" targetFramework="net461" />
<package id="SteamWare.IO" version="4.0.2002.731" targetFramework="net461" />
<package id="SteamWare.Logger" version="4.0.2002.731" targetFramework="net461" />
<package id="SteamWare.IO" version="4.0.2002.731" targetFramework="net462" />
<package id="SteamWare.Logger" version="4.0.2002.727" targetFramework="net462" />
<package id="System.Buffers" version="4.5.0" targetFramework="net461" />
<package id="System.Diagnostics.PerformanceCounter" version="4.7.0" targetFramework="net461" />
<package id="System.IO.Pipelines" version="4.7.0" targetFramework="net461" />