Ejemplo n.º 1
0
        static IEngine loadEngine(EngineLoadingMode _engineLoadingMode, out IEngineLoader engineLoader)
        {
            engineLoadingMode = _engineLoadingMode;
            switch (engineLoadingMode)
            {
            case EngineLoadingMode.LoadDirectlyUseNakedInterfaces:
            {
                engineLoader = null;                         // Not used
                IEngine engine  = null;
                int     hresult = InitializeEngine(FceConfig.GetDeveloperSN(), null, null, out engine);
                Marshal.ThrowExceptionForHR(hresult);
                assert(engine != null);
                return(engine);
            }

            case EngineLoadingMode.LoadAsInprocServer:
            {
                engineLoader = new FCEngine.InprocLoader();
                IEngine engine = engineLoader.Load(FceConfig.GetDeveloperSN(), "");
                assert(engine != null);
                return(engine);
            }

            case EngineLoadingMode.LoadAsWorkprocess:
            {
                engineLoader = new FCEngine.OutprocLoader();
                IEngine engine = engineLoader.Load(FceConfig.GetDeveloperSN(), "");
                assert(engine != null);
                return(engine);
            }
            }
            assert(false);
            engineLoader = null;
            return(null);
        }
Ejemplo n.º 2
0
        private static IEngine loadEngine()
        {
            IEngine engine  = null;
            int     hresult = InitializeEngine(FceConfig.GetDeveloperSN(), out engine);

            Marshal.ThrowExceptionForHR(hresult);
            return(engine);
        }