Esempio n. 1
0
        /// <summary>
        /// Returns a reference to a shared instance of the engine. This instance is the
        /// same that is used by the console window.
        /// </summary>
        public IEngine GetSharedEngine()
        {
            if (null == engine)
            {
                engine = CreateSharedEngine();
            }

            return(engine);
        }
Esempio n. 2
0
        private EngineWrapper CreateSharedEngine()
        {
            // Create the engine wrapper.
            EngineWrapper wrapper = new EngineWrapper();

            // Set the default variables for the shared engine.
            if (null != serviceProvider)
            {
                EnvDTE._DTE dte = (EnvDTE._DTE)serviceProvider.GetService(typeof(EnvDTE.DTE));
                wrapper.SetVariable("dte", dte);
            }
            wrapper.SetVariable("engine", wrapper.FoxProEngine);

            return(wrapper);
        }