public virtual void Initialize() { this.serviceProvider = new Mock<IServiceProvider>(); this.outputPane = new Mock<IVsOutputWindowPane>(); this.outputWindow = new Mock<IVsOutputWindow>(); this.shellEvents = new Mock<IShellEvents>(); var pane = this.outputPane.Object; this.serviceProvider.Setup(x => x.GetService(typeof(SVsOutputWindow))).Returns(this.outputWindow.Object); this.outputWindow.Setup(x => x.GetPane(ref this.paneId, out pane)).Returns(0); this.traceManager = new TraceOutputWindowPane(this.serviceProvider.Object, this.shellEvents.Object, this.paneId, PaneTitle, SourceName); }
/// <summary> /// Creates a new trace pane. /// </summary> /// <param name="traceId">The identifier of the trace pane</param> /// <param name="title">The title to display for the trace pane</param> /// <param name="traceSourceNames">The names of the sources to display in this trace window</param> public ITracePane CreateTracePane(Guid traceId, string title, IEnumerable<string> traceSourceNames) { Guard.NotNullOrEmpty(() => title, title); Guard.NotNull(() => traceSourceNames, traceSourceNames); if (this.tracePanes.Any(tp => tp.TracePaneId == traceId)) { throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, Resources.TraceOutputWindowManager_ErrorDuplicateTraceId, traceId)); } // Add tracer pane var tracePane = new TraceOutputWindowPane(this.serviceProvider, this.shellEvents, traceId, title, traceSourceNames.ToArray()); this.tracePanes.Add(tracePane); return tracePane; }
/// <summary> /// Creates a new trace pane. /// </summary> /// <param name="traceId">The identifier of the trace pane</param> /// <param name="title">The title to display for the trace pane</param> /// <param name="traceSourceNames">The names of the sources to display in this trace window</param> public ITracePane CreateTracePane(Guid traceId, string title, IEnumerable <string> traceSourceNames) { Guard.NotNullOrEmpty(() => title, title); Guard.NotNull(() => traceSourceNames, traceSourceNames); if (this.tracePanes.Any(tp => tp.TracePaneId == traceId)) { throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, Resources.TraceOutputWindowManager_ErrorDuplicateTraceId, traceId)); } // Add tracer pane var tracePane = new TraceOutputWindowPane(this.serviceProvider, this.shellEvents, traceId, title, traceSourceNames.ToArray()); this.tracePanes.Add(tracePane); return(tracePane); }