Beispiel #1
0
        protected override async Task ExecuteAsync(OleMenuCmdEventArgs e)
        {
            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            OutputWindowPane pane = await VS.Windows.CreateOutputWindowPaneAsync("References");

            await pane.ActivateAsync();

            foreach (Project project in await VS.Solutions.GetAllProjectsAsync())
            {
                await pane.WriteLineAsync(project.Name);

                foreach (Reference reference in project.References.OrderBy(x => x.Name))
                {
                    if (reference is AssemblyReference assemblyRef)
                    {
                        await pane.WriteLineAsync($"  * {reference.Name} (Assembly: {assemblyRef.FullPath})");
                    }
                    else if (reference is ProjectReference projectRef)
                    {
                        await pane.WriteLineAsync($"  * {reference.Name} (Project: {(await projectRef.GetProjectAsync())?.Name ?? "?"})");
                    }
                    else
                    {
                        await pane.WriteLineAsync($"  * {reference.Name} (Unknown)");
                    }
                }
            }
        }
Beispiel #2
0
        internal async static Task DisplayOutputMessageAsync(string message)
        {
            if (!XSharpModel.XSettings.EnableOutputWindowLogging)
            {
                return;
            }
            if (!busy && pane == null)
            {
                busy = true;
                pane = await VS.Windows.CreateOutputWindowPaneAsync("XSharp - Debug Window", false);

                busy = false;
            }
            if (pane != null)
            {
                await pane.WriteLineAsync(message);
            }
        }
Beispiel #3
0
 public async Task LogAsync(string message)
 {
     await _pane.WriteLineAsync(message);
 }