/// <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);
        }
        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.PythonEngine);

            return(wrapper);
        }
        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.PythonEngine);

            return wrapper;
        }
        /// <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;
        }