Example #1
0
        /// <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 async System.Threading.Tasks.Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress)
        {
            progress.Report(new ServiceProgressData("Starting Power Mode", "Initializing...", 0, 2));
            await base.InitializeAsync(cancellationToken, progress);

            progress.Report(new ServiceProgressData("Starting Power Mode", "Initializing...", 1, 2));
            cancellationToken.ThrowIfCancellationRequested();

            await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);

            cancellationToken.ThrowIfCancellationRequested();
            await TogglePowerModeCommand.InitializeAsync(this);

            cancellationToken.ThrowIfCancellationRequested();
            await ToggleComboModeCommand.InitializeAsync(this);

            cancellationToken.ThrowIfCancellationRequested();
            await ToggleParticlesCommand.InitializeAsync(this);

            cancellationToken.ThrowIfCancellationRequested();
            await ToggleScreenShakeCommand.InitializeAsync(this);

            cancellationToken.ThrowIfCancellationRequested();
            await ToggleAudioCommand.InitializeAsync(this);

            cancellationToken.ThrowIfCancellationRequested();
            progress.Report(new ServiceProgressData("Starting Power Mode", "Initializing...", 2, 2));
        }
Example #2
0
 /// <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()
 {
     base.Initialize();
     TogglePowerModeCommand.Initialize(this);
     ToggleComboModeCommand.Initialize(this);
     ToggleParticlesCommand.Initialize(this);
     ToggleScreenShakeCommand.Initialize(this);
     ToggleAudioCommand.Initialize(this);
 }