Esempio n. 1
0
 // The variable_value_resolver is used only to find the unused variables, the variable values aren't used.
 // variable_value_resolver can be null, in that case unused variables aren't explored.
 // cache can be null.
 public ExpressionCompilerJob(Parser parser, IEvalContext eval_ctx, bool collect_unresolved_variables, CompiledExpressionCache cache)
 {
     m_Parser      = parser;
     m_EvalContext = eval_ctx;
     m_CollectUnresolvedVariables = collect_unresolved_variables;
     m_Cache = cache;
 }
Esempio n. 2
0
        private void DelayedInit()
        {
            DTE dte = (DTE)GetService(typeof(DTE));

            if (dte == null)
            {
                // Usually this branch never executes but I want to make sure...
                PackageGlobals.BeginInvokeOnUIThread(DelayedInit);
                return;
            }

            m_VSMainWindow = new VSMainWindow();
            m_VSMainWindow.Initialize((IntPtr)dte.MainWindow.HWnd);
            m_VSMainWindow.OnWindowTitleUpdateNeeded += m_VSMainWindow_OnWindowTitleUpdateNeeded;

            m_UpdateTimer          = new System.Windows.Forms.Timer();
            m_UpdateTimer.Tick    += UpdateTimer_Tick;
            m_UpdateTimer.Interval = UPDATE_PERIOD_MILLISECS;
            m_UpdateTimer.Start();

            IVsSolution vs_solution = (IVsSolution)GetService(typeof(IVsSolution));

            vs_solution.AdviseSolutionEvents(this, out m_SolutionEventsCookie);

            IVsDebugger debugger = (IVsDebugger)GetService(typeof(IVsDebugger));

            debugger.AdviseDebuggerEvents(this, out m_DebuggerEventsCookie);

            PackageGlobals.InitInstance(this);

            m_PrevVariableValues = PackageGlobals.Instance().CreateFreshEvalContext().VariableValues;

            m_ExpressionCompilerThread = new ExpressionCompilerThread();
            // During normal use the expression doesn't change except when configuring so a cache size of 1 does the job quite well.
            // Usually what changes is the variables.
            m_CompiledExpressionCache = new CompiledExpressionCache(PackageGlobals.Instance().ExecFuncEvaluator, PackageGlobals.Instance().CompileTimeConstants, 1);

            UpdateWindowTitle();
        }
		private void DelayedInit()
		{
			DTE dte = (DTE)GetService(typeof(DTE));
			if (dte == null)
			{
				// Usually this branch never executes but I want to make sure...
				PackageGlobals.BeginInvokeOnUIThread(DelayedInit);
				return;
			}

			m_VSMainWindow = new VSMainWindow();
			m_VSMainWindow.Initialize((IntPtr)dte.MainWindow.HWnd);
			m_VSMainWindow.OnWindowTitleUpdateNeeded += m_VSMainWindow_OnWindowTitleUpdateNeeded;

			m_UpdateTimer = new System.Windows.Forms.Timer();
			m_UpdateTimer.Tick += UpdateTimer_Tick;
			m_UpdateTimer.Interval = UPDATE_PERIOD_MILLISECS;
			m_UpdateTimer.Start();

			IVsSolution vs_solution = (IVsSolution)GetService(typeof(IVsSolution));
			vs_solution.AdviseSolutionEvents(this, out m_SolutionEventsCookie);

			IVsDebugger debugger = (IVsDebugger)GetService(typeof(IVsDebugger));
			debugger.AdviseDebuggerEvents(this, out m_DebuggerEventsCookie);

			PackageGlobals.InitInstance(this);

			m_PrevVariableValues = PackageGlobals.Instance().CreateFreshEvalContext().VariableValues;

			m_ExpressionCompilerThread = new ExpressionCompilerThread();
			// During normal use the expression doesn't change except when configuring so a cache size of 1 does the job quite well.
			// Usually what changes is the variables.
			m_CompiledExpressionCache = new CompiledExpressionCache(PackageGlobals.Instance().ExecFuncEvaluator, PackageGlobals.Instance().CompileTimeConstants, 1);

			UpdateWindowTitle();
		}