public override IEnumerable <INodeFactory> GetNodeChildren(IContext context)
        {
            var windows   = new List <Window2>();
            var factories = new List <INodeFactory>();

            foreach (string name in VSWindowKinds.All)
            {
                try
                {
                    if (name != VSWindowKinds.WebBrowser)
                    {
                        var w = _windows.Item(name) as Window2;
                        windows.Add(w);
                    }
                }
                catch
                {
                }
            }

            windows.AddRange(from Window2 w in _windows select w);

            factories.AddRange(windows.Distinct().ToList().ConvertAll(w => (INodeFactory) new WindowNodeFactory(w)));
            factories.OrderBy(a => a.Name);
            return(factories);
        }
        private DataPaneControl GetDataPaneControl()
        {
            if (null == _dataPaneControl)
            {
                object window = null;
                var    asm    = typeof(DataGridControl).Assembly;
                DTE2   dte2   = Locator.Get <DTE2>();
                AddIn  addIn  = Locator.Get <AddIn>();

                Windows2 w = (Windows2)dte2.Windows;

                if (null == _toolWindow)
                {
                    try
                    {
                        _toolWindow = w.Item(DataPaneControl.Guid);
                        window      = _toolWindow.Object;
                    }
                    catch
                    {
                    }

                    if (null == _toolWindow)
                    {
                        _toolWindow = w.CreateToolWindow2(
                            addIn,
                            asm.Location,
                            typeof(DataPaneControl).FullName,
                            "StudioShell Data Panes",
                            DataPaneControl.Guid,
                            ref window);
                    }
                    if (null == _toolWindow || null == window)
                    {
                        Debug.Assert(false, "unable to locate data pane tool window");
                    }
                }

                _dataPaneControl = (DataPaneControl)window;
            }
            return(_dataPaneControl);
        }