/// <summary> /// Initializes a new instance of the <see cref="OutputToolWindow"/> class. /// </summary> public OutputToolWindow(OutputToolWindowContext context) : base(null) { //to see if OutputToolWindow can be internal ( and thus IScriptManager ) Caption = Vsix.Name; context.ScriptManager.FocusCallback = () => { ThreadHelper.JoinableTaskFactory.Run(async() => { await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); (this.Frame as IVsWindowFrame).Show(); }); }; // This is the user control hosted by the tool window; Note that, even if this class implements IDisposable, // we are not calling Dispose on this object. This is because ToolWindowPane calls Dispose on // the object returned by the Content property. try { AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; Content = new OutputToolWindowControl(context.ScriptManager, context.FccEngine); } finally { AppDomain.CurrentDomain.AssemblyResolve -= CurrentDomain_AssemblyResolve; } }
protected override System.Threading.Tasks.Task <object> InitializeToolWindowAsync(Type toolWindowType, int id, CancellationToken cancellationToken) { var context = new OutputToolWindowContext { FccEngine = componentModel.GetService <IFCCEngine>(), ScriptManager = componentModel.GetService <ScriptManager>() }; return(System.Threading.Tasks.Task.FromResult <object>(context)); }
private void Initialize(OutputToolWindowContext context) { //to see if OutputToolWindow can be internal ( and thus IScriptManager ) Caption = Vsix.Name; context.EventAggregator.AddListener(this); // This is the user control hosted by the tool window; Note that, even if this class implements IDisposable, // we are not calling Dispose on this object. This is because ToolWindowPane calls Dispose on // the object returned by the Content property. try { AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; Content = new OutputToolWindowControl(context.EventAggregator); } finally { AppDomain.CurrentDomain.AssemblyResolve -= CurrentDomain_AssemblyResolve; } }
/// <summary> /// Initializes a new instance of the <see cref="OutputToolWindow"/> class. /// </summary> public OutputToolWindow(OutputToolWindowContext context) : base(null) { Initialize(context); }