Esempio n. 1
0
        /// <summary>
        /// Shows (or creates if needed) the specified tool window.
        /// </summary>
        public static void ShowToolWindow(Type toolWindowType, PackageAssist assist, bool transient, bool multiInstances)
        {
            // Get the instance number 0 of given tool window. Silent assumption is that this window
            // is single instance so this instance is actually the only one.
            // The last flag is set to true so that if the tool window does not exists it will be created.
            ToolWindowPane window = assist.FindToolWindow(toolWindowType, 0, true, transient, multiInstances);

            if (window == null || window.Frame == null || !(window.Frame is IVsWindowFrame))
            {
                throw new COMException("Can not create IVsWindowFrame object");
            }

            ErrorHandler.ThrowOnFailure(((IVsWindowFrame)window.Frame).Show());
        }
Esempio n. 2
0
        /// <summary>
        /// Init constructor.
        /// </summary>
        public CustomAddInManager(DTE2 applicationObject, AddIn addInInst, IMenuCustomizator menuCustomizator, Assembly assemblyForSatellites)
        {
            appObject     = applicationObject;
            addInInstance = addInInst;
            actions       = new CustomAddInActionDictionary();
            menuManager   = new CustomAddInMenuManager(applicationObject, addInInst, menuCustomizator);
            assist        = new PackageAssist(this);
            mainAssembly  = assemblyForSatellites;

            selectionContainer = new Microsoft.VisualStudio.Shell.SelectionContainer();
            selectedItems      = new System.Collections.ArrayList();
            selectedElements   = new object[1];

            // all settings read/writes will be pefrom according current version of Visual Studio IDE:
            PersistentStorageHelper.Attach(applicationObject);
            BaseOptionPage.ConfigProvider = this;
        }