Saxonite v1.1.3

This commit is contained in:
2021-07-23 14:06:11 +01:00
parent 169a4921cd
commit 57d4ca92e7
4 changed files with 67 additions and 6 deletions
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using Sarand.Net.Standard.Base.App;
using Sarand.Net.Standard.Base.Core;
@@ -109,6 +110,7 @@ namespace Sarand.Net.Standard.Base.Bus
{
get { return SacsSystem.GetStatusDesc(Status); }
}
public bool IsStatusAwaiting { get { return Status == SaStatus.Awaiting; } }
public bool IsStatusCurrent { get { return Status == SaStatus.Current; } }
public bool IsStatusActive { get { return Status == SaStatus.Active; } }
public bool IsStatusEnabled { get { return Status == SaStatus.Enabled; } }
@@ -326,6 +328,7 @@ namespace Sarand.Net.Standard.Base.Bus
{
get { return data.StatusDesc; }
}
public bool IsStatusAwaiting { get { return data.IsStatusAwaiting; } }
public bool IsStatusCurrent { get { return data.IsStatusCurrent; } }
public bool IsStatusActive { get { return data.IsStatusActive; } }
public bool IsStatusEnabled { get { return data.IsStatusEnabled; } }
+2 -1
View File
@@ -123,8 +123,9 @@ namespace Sarand.Net.Standard.Base.Bus
try
{
// Convert the integer value to a SysId.
if (reader.Value == null) return new SysId();
JValue jValue = new JValue(reader.Value);
return new SysId() { Id = (long)jValue };
return new SysId((long)jValue);
}
catch (Exception exc)
{
@@ -0,0 +1,57 @@
using Sarand.Net.Standard.Base.App;
using Sarand.Net.Standard.Base.Utils;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Text;
namespace Sarand.Net.Standard.Base.Core
{
//=======================================================================
public sealed class DisposableCollection<T> : Collection<T>, IDisposable
where T : IDisposable
{
//-------------------------------------------------------------------
// Construction.
public DisposableCollection() : base() { }
public DisposableCollection(IList<T> items) : base(items) { }
public void Dispose()
{
while (this.Count > 0)
{
// Extract the first item from the list.
T item = this[0];
RemoveAt(0);
try
{
if (item != null)
item.Dispose();
}
catch (Exception exc)
{
// Ignore exception.
if (SacsSystem.DebugMode)
{
SaLogger.Debug(GetType().Name + ".Dispose " + ExceptionUtil.GetErrorStateMessage(exc));
Debugger.Break();
}
}
}
}
//-------------------------------------------------------------------
/// <summary>
/// Add item to the list.
/// <para>Null items are ignored.</para>
/// </summary>
public new void Add (T item)
{
if (item != null)
base.Add(item);
}
//-------------------------------------------------------------------
}
//=======================================================================
}