Typo FIX
This commit is contained in:
@@ -615,7 +615,7 @@ namespace SCMA
|
||||
lg.Info("Avvio preliminare AdapterGeneric");
|
||||
|
||||
currGateway = gatewayObj;
|
||||
lg.Info(string.Format("Impostato protocollo di comunicazione {0)", currGateway.protocollo));
|
||||
lg.Info(string.Format("Impostato protocollo di comunicazione {0}", currGateway.protocollo));
|
||||
|
||||
procIotMem = utils.CRB("procIotMem");
|
||||
|
||||
|
||||
@@ -3,92 +3,92 @@
|
||||
namespace SCMA
|
||||
{
|
||||
|
||||
public static class EnumerationExtensions
|
||||
public static class EnumerationExtensions
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// checks if the value contains the provided type
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="type"></param>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public static bool Has<T>(this System.Enum type, T value)
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// checks if the value contains the provided type
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="type"></param>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public static bool Has<T>(this System.Enum type, T value)
|
||||
{
|
||||
try
|
||||
{
|
||||
return (((int)(object)type & (int)(object)value) == (int)(object)value);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// checks if the value is only the provided type
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="type"></param>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public static bool Is<T>(this System.Enum type, T value)
|
||||
{
|
||||
try
|
||||
{
|
||||
return (int)(object)type == (int)(object)value;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// appends a value
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="type"></param>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public static T Add<T>(this System.Enum type, T value)
|
||||
{
|
||||
try
|
||||
{
|
||||
return (T)(object)(((int)(object)type | (int)(object)value));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ArgumentException(
|
||||
string.Format(
|
||||
"Could not append value from enumerated type '{0}'.",
|
||||
typeof(T).Name
|
||||
), ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// completely removes the value
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="type"></param>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public static T Remove<T>(this System.Enum type, T value)
|
||||
{
|
||||
try
|
||||
{
|
||||
return (T)(object)(((int)(object)type & ~(int)(object)value));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ArgumentException(
|
||||
string.Format(
|
||||
"Could not remove value from enumerated type '{0}'.",
|
||||
typeof(T).Name
|
||||
), ex);
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
return (((int)(object)type & (int)(object)value) == (int)(object)value);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// checks if the value is only the provided type
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="type"></param>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public static bool Is<T>(this System.Enum type, T value)
|
||||
{
|
||||
try
|
||||
{
|
||||
return (int)(object)type == (int)(object)value;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// appends a value
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="type"></param>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public static T Add<T>(this System.Enum type, T value)
|
||||
{
|
||||
try
|
||||
{
|
||||
return (T)(object)(((int)(object)type | (int)(object)value));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ArgumentException(
|
||||
string.Format(
|
||||
"Could not append value from enumerated type '{0}'.",
|
||||
typeof(T).Name
|
||||
), ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// completely removes the value
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="type"></param>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public static T Remove<T>(this System.Enum type, T value)
|
||||
{
|
||||
try
|
||||
{
|
||||
return (T)(object)(((int)(object)type & ~(int)(object)value));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ArgumentException(
|
||||
string.Format(
|
||||
"Could not remove value from enumerated type '{0}'.",
|
||||
typeof(T).Name
|
||||
), ex);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,7 +149,6 @@
|
||||
<Compile Include="MainForm.Designer.cs">
|
||||
<DependentUpon>MainForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="EnumExtensions.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SetupAdapter.cs">
|
||||
|
||||
Reference in New Issue
Block a user