src/Misc/EFTools/EntityDesign/VisualStudio/VsUtils.cs
// <summary>
//     Returns an output window pane for ModelGen output (creates it if necessary)
// </summary>
Returns an output window pane for ModelGen output (creates it if necessary)
Returns an output window pane for ModelGen output ( creates it if necessary )
private static OutputWindowPane GetOutputWindowPane(Project project, bool activate)
        {
            Debug.Assert(null != project, "project should not be null");
            Debug.Assert(null != project.DTE, "project.DTE should not be null");
            if (null == project.DTE)
            {
                return null;
            }
            var window = project.DTE.Windows.Item(Constants.vsWindowKindOutput);
            if (null == window)
            {
                return null;
            }
            if (activate)
            {
                window.Activate();
                window.Visible = true;
            }
            var outputWindow = window.Object as OutputWindow;
            if (null == outputWindow)
            {
                return null;
            }
            OutputWindowPane outputWindowPane = null;
            try
            {
                outputWindowPane = outputWindow.OutputWindowPanes.Item(OutputWindowPaneTitle);
            }
            catch (Exception ex)
            {
                if (ex is ArgumentException
                    || ex is NullReferenceException
                    || ex is NotImplementedException)
                {
                    outputWindowPane = outputWindow.OutputWindowPanes.Add(OutputWindowPaneTitle);
                }
                else
                {
                    throw;
                }
            }
            Debug.Assert(null != outputWindowPane, "outputWindowPane should not be null");
            if (activate && outputWindowPane != null)
            {
                outputWindowPane.Activate();
            }
            return outputWindowPane;
        }
private static OutputWindowPane GetOutputWindowPane ( Project project , bool activate ) { Debug . Assert ( null != project , " " ) ; Debug . Assert ( null != project . DTE , " " ) ; if ( null == project . DTE ) { return null ; } var window = project . DTE . Windows . Item ( Constants . vsWindowKindOutput ) ; if ( null == window ) { return null ; } if ( activate ) { window . Activate ( ) ; window . Visible = true ; } var outputWindow = window . Object as OutputWindow ; if ( null == outputWindow ) { return null ; } OutputWindowPane outputWindowPane = null ; try { outputWindowPane = outputWindow . OutputWindowPanes . Item ( OutputWindowPaneTitle ) ; } catch ( Exception ex ) { if ( ex is ArgumentException || ex is NullReferenceException || ex is NotImplementedException ) { outputWindowPane = outputWindow . OutputWindowPanes . Add ( OutputWindowPaneTitle ) ; } else { throw ; } } Debug . Assert ( null != outputWindowPane , " " ) ; if ( activate && outputWindowPane != null ) { outputWindowPane . Activate ( ) ; } return outputWindowPane ; }
Returns an output window pane for ModelGen output (creates it if necessary)
Returns an output window pane for ModelGen output ( creates it if necessary )
// Get an existing pane // Spec says that OutputWindowPanes.Item() can throw ArgumentException,  // but actually it throws NullReferenceException and NotImplementedException (WCF projects) // Doesn't exist, so create it
project
Project
activate
bool