/// <summary> /// Evaluates the specified visualized expression using our custom evaluator. /// </summary> public void EvaluateVisualizedExpression(DkmVisualizedExpression visualizedExpression, out DkmEvaluationResult resultObject) { VSContext.InitializeInteractiveExecution(); VSCustomVisualizerEvaluator evaluator = new VSCustomVisualizerEvaluator(visualizedExpression); resultObject = evaluator.EvaluationResult; visualizedExpression.SetDataItem(DkmDataCreationDisposition.CreateAlways, evaluator); }
private void LoadDomain() { if (scriptDomain == null && VSContext.CurrentDebugMode == EnvDTE.dbgDebugMode.dbgBreakMode) { try { AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; AppDomainSetup setup = new AppDomainSetup() { ApplicationBase = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), PrivateBinPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), }; scriptDomain = AppDomain.CreateDomain(DomainName, AppDomain.CurrentDomain.Evidence, setup); VSContext.InitializeAppDomain(scriptDomain); #if USE_APP_DOMAIN proxy = (VSInteractiveWindowProxy)scriptDomain.CreateInstanceAndUnwrap(typeof(VSInteractiveWindowProxy).Assembly.FullName, typeof(VSInteractiveWindowProxy).FullName); var interactiveControl = FrameworkElementAdapters.ContractToViewAdapter(proxy.CreateControl(VSContext.InteractiveExecutionInitialization)); #else interactiveControl = new VSInteractiveWindowControl(VSContext.InteractiveExecutionInitialization); #endif grid.Children.Clear(); grid.Children.Add(interactiveControl); } #if DEBUG catch (Exception ex) #else catch #endif { #if DEBUG System.Windows.MessageBox.Show("Loading domain failed:\n" + ex.ToString()); #endif } } }
/// <summary> /// Initializes the <see cref="VSCustomVisualizerEvaluator"/> class. /// </summary> static VSCustomVisualizerEvaluator() { VSContext.InitializeIfNeeded(); }