/// <summary>
 /// Initializes a new instance of the <see cref="ProjectColoredFramePackage"/> class.
 /// </summary>
 public ProjectColoredFramePackage()
 {
     // Inside this method you can place any initialization code that does not require
     // any Visual Studio service because at this point the package object is created but
     // not sited yet inside Visual Studio environment. The place to do all the other
     // initialization is the Initialize method.
     current = this;
 }
        /// <summary>
        /// Initialization of the package; this method is called right after the package is sited, so this is the place
        /// where you can put all the initialization code that rely on services provided by VisualStudio.
        /// </summary>
        protected override void Initialize()
        {
            var grid = (ProjectColoredFrameOptionsGrid)GetDialogPage(typeof(ProjectColoredFrameOptionsGrid));
            Debug.Write(grid.Opacity);
            base.Initialize();

            var serviceContainer = (IServiceContainer)this.GetService(typeof(IServiceContainer));
            serviceContainer.AddService(typeof(SettingsChangedEventDispatcher), new SettingsChangedEventDispatcher());

            current = this.GetService(typeof(Package)) as ProjectColoredFramePackage;

            // Ensure LoadSettingsFromStorage is called (it won't be called automatically due to bug in VS).
            //Current.OptionsGrid.LoadSettingsFromStorage();
        }
示例#3
0
        //private static DTE2 Dte => (DTE2)Microsoft.VisualStudio.Shell.Package.GetGlobalService(typeof(DTE));

        /// <summary>
        /// Wait for (already happening) initialization and get this extension's package.
        /// </summary>
        public static Task <ProjectColoredFramePackage> GetPackageAsync() => ProjectColoredFramePackage.GetCurrentAsync();