using Sarand.BusinessMgr.Net.Standard.Base.App; using Sarand.Net.Standard.Base.Core; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr.Control { //======================================================================= public class SbmInternals_Control : SacsDisposable { //------------------------------------------------------------------- // Data members. private readonly SbmSystem system = SbmGlobals.System; private class MgrData { public SbmcAccountMgr controlAccountMgr; public SbmcInstanceMgr controlInstanceMgr; public SbmcItemMgr controlItemMgr; } private MgrData mgr { get; } = new MgrData(); //------------------------------------------------------------------- // Construction. public SbmInternals_Control() { } protected override void Dispose(bool disposing) { if (disposing) { if (mgr.controlAccountMgr != null) mgr.controlAccountMgr.Dispose(); if (mgr.controlInstanceMgr != null) mgr.controlInstanceMgr.Dispose(); if (mgr.controlItemMgr != null) mgr.controlItemMgr.Dispose(); } } //------------------------------------------------------------------- // Properties. //------------------------------------------------------------------- // Control managers. public SbmcAccountMgr ControlAccountMgr { get { if (mgr.controlAccountMgr == null) mgr.controlAccountMgr = system.CreateControlAccountMgr(); return mgr.controlAccountMgr; } } public SbmcInstanceMgr ControlInstanceMgr { get { if (mgr.controlInstanceMgr == null) mgr.controlInstanceMgr = system.CreateControlInstanceMgr(); return mgr.controlInstanceMgr; } } public SbmcItemMgr ControlItemMgr { get { if (mgr.controlItemMgr == null) mgr.controlItemMgr = system.CreateControlItemMgr(); return mgr.controlItemMgr; } } //------------------------------------------------------------------- } //======================================================================= }