예제 #1
0
 public ManagerAPI(CManagerFactory factory)
 {
     m_factory = factory ?? throw new ArgumentNullException(nameof(factory));
     if (m_factory.IsValid() == false ||
         (m_PumpMgr = m_factory.Create()) == null ||
         (m_Mgr = m_factory.Create()) == null ||
         (m_PumpMgrEx = m_factory.Create()) == null)
     {
         m_isValid = false;
         return;
     }
     m_isValid = true;
     Debug.Assert(m_isValid);
 }
예제 #2
0
        public CManagerInterface CreateApi()
        {
            CheckFactory();
            var api = _factory.Create();

            Debug.Assert(api != null);

            if (api == null)
            {
                throw new InvalidOperationException("Could not create MT4 API instance");
            }

            return(api);
        }
예제 #3
0
 public void createDBMT4Manager()
 {
     Debug.Assert(m_DBMgr == null);
     m_DBMgr = m_factory.Create();
 }