<commit_before>﻿/*
The MIT License(MIT)

Copyright(c) 2015 <NAME>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Windows.Media;
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.OLE.Interop;
using Microsoft.VisualStudio.Settings;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.Shell.Settings;
using Microsoft.Win32;

namespace PowerMode
{
    public class OptionPageGrid : DialogPage
    {
        [Category("Power Mode")]
        [DisplayName("Alpha Decrement Amount")]
        [Description("The amount of alpha removed every frame.")]
        public double AlphaRemoveAmount { get; set; } = 0.045;

        [Category("Power Mode")]
        [DisplayName("Explosion Particle Color")]
        [Description("The color of the explosion particle")]
        public Color Color { get; set; } = Colors.Black;

        [Category("Power Mode")]
        [Description("Delay between Frames (milliseconds)")]
        [DisplayName("Frame Delay")]
        public int FrameDelay { get; set; } = 17;

        [Category("Power Mode")]
        [DisplayName("Gravity")]
        [Description("The strength of the gravity")]
        public double Gravity { get; set; } = 0.3;

        [Category("Power Mode")]
        [DisplayName("Max Particle Count")]
        [Description("The maximum amount of particles at one time")]
        public int MaxParticleCount { get; set; } = int.MaxValue;

        [Category("Power Mode")]
        [DisplayName("Max Side Velocity")]
        [Description("The maximum sideward velocity of the particles")]
        public double MaxSideVelocity { get; set; } = 2;

        [Category("Power Mode")]
        [DisplayName("Max Upwards Velocity")]
        [Description("The maximum upward velocity of the particles")]
        public double MaxUpVelocity { get; set; } = 10;

        [Category("Power Mode")]
        [DisplayName("Particles Enabled")]
        [Description("Sets whether the particles are enabled")]
        public bool ParticlesEnabled { get; set; } = true;

        [Category("Power Mode")]
        [DisplayName("Screen Shake")]
        [Description("Sets whether the screen shakes")]
        public bool ShakeEnabled { get; set; } = true;

        [Category("Power Mode")]
        [DisplayName("Start Alpha")]
        [Description("The starting opacity of the particle. Affects lifetime.")]
        public double StartAlpha { get; set; } = 0.9;

        public override void LoadSettingsFromStorage()
        {
            base.LoadSettingsFromStorage();
            ExplosionParticle.AlphaRemoveAmount = AlphaRemoveAmount;
            ExplosionParticle.Color = Color;
            ExplosionParticle.FrameDelay = FrameDelay;
            ExplosionParticle.Gravity = Gravity;
            ExplosionParticle.MaxParticleCount = MaxParticleCount;
            ExplosionParticle.MaxSideVelocity = MaxSideVelocity;
            ExplosionParticle.MaxUpVelocity = MaxUpVelocity;
            ExplosionParticle.StartAlpha = StartAlpha;
            ExplosionViewportAdornment.ShakeEnabled = ShakeEnabled;
            ExplosionViewportAdornment.ParticlesEnabled = ParticlesEnabled;
        }

        public override void SaveSettingsToStorage()
        {
            base.SaveSettingsToStorage();
            AlphaRemoveAmount = ExplosionParticle.AlphaRemoveAmount;
            Color = ExplosionParticle.Color;
            FrameDelay = ExplosionParticle.FrameDelay;
            Gravity = ExplosionParticle.Gravity;
            MaxParticleCount = ExplosionParticle.MaxParticleCount;
            MaxSideVelocity = ExplosionParticle.MaxSideVelocity;
            MaxUpVelocity = ExplosionParticle.MaxUpVelocity;
            StartAlpha = ExplosionParticle.StartAlpha;
            ShakeEnabled = ExplosionViewportAdornment.ShakeEnabled;
            ParticlesEnabled = ExplosionViewportAdornment.ParticlesEnabled;
        }
    }

    /// <summary>
    /// This is the class that implements the package exposed by this assembly.
    /// </summary>
    /// <remarks><commit_msg>fix save settings<commit_after>﻿/*
The MIT License(MIT)

Copyright(c) 2015 <NAME>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Windows.Media;
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.OLE.Interop;
using Microsoft.VisualStudio.Settings;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.Shell.Settings;
using Microsoft.Win32;

namespace PowerMode
{
    public class OptionPageGrid : DialogPage
    {
        [Category("Power Mode")]
        [DisplayName("Alpha Decrement Amount")]
        [Description("The amount of alpha removed every frame.")]
        public double AlphaRemoveAmount { get; set; } = 0.045;

        [Category("Power Mode")]
        [DisplayName("Explosion Particle Color")]
        [Description("The color of the explosion particle")]
        public Color Color { get; set; } = Colors.Black;

        [Category("Power Mode")]
        [Description("Delay between Frames (milliseconds)")]
        [DisplayName("Frame Delay")]
        public int FrameDelay { get; set; } = 17;

        [Category("Power Mode")]
        [DisplayName("Gravity")]
        [Description("The strength of the gravity")]
        public double Gravity { get; set; } = 0.3;

        [Category("Power Mode")]
        [DisplayName("Max Particle Count")]
        [Description("The maximum amount of particles at one time")]
        public int MaxParticleCount { get; set; } = int.MaxValue;

        [Category("Power Mode")]
        [DisplayName("Max Side Velocity")]
        [Description("The maximum sideward velocity of the particles")]
        public double MaxSideVelocity { get; set; } = 2;

        [Category("Power Mode")]
        [DisplayName("Max Upwards Velocity")]
        [Description("The maximum upward velocity of the particles")]
        public double MaxUpVelocity { get; set; } = 10;

        [Category("Power Mode")]
        [DisplayName("Particles Enabled")]
        [Description("Sets whether the particles are enabled")]
        public bool ParticlesEnabled { get; set; } = true;

        [Category("Power Mode")]
        [DisplayName("Screen Shake")]
        [Description("Sets whether the screen shakes")]
        public bool ShakeEnabled { get; set; } = true;

        [Category("Power Mode")]
        [DisplayName("Start Alpha")]
        [Description("The starting opacity of the particle. Affects lifetime.")]
        public double StartAlpha { get; set; } = 0.9;

        public override void LoadSettingsFromStorage()
        {
            base.LoadSettingsFromStorage();
            ExplosionParticle.AlphaRemoveAmount = AlphaRemoveAmount;
            ExplosionParticle.Color = Color;
            ExplosionParticle.FrameDelay = FrameDelay;
            ExplosionParticle.Gravity = Gravity;
            ExplosionParticle.MaxParticleCount = MaxParticleCount;
            ExplosionParticle.MaxSideVelocity = MaxSideVelocity;
            ExplosionParticle.MaxUpVelocity = MaxUpVelocity;
            ExplosionParticle.StartAlpha = StartAlpha;
            ExplosionViewportAdornment.ShakeEnabled = ShakeEnabled;
            ExplosionViewportAdornment.ParticlesEnabled = ParticlesEnabled;
        }

        public override void SaveSettingsToStorage()
        {
            base.SaveSettingsToStorage();

            ExplosionParticle.AlphaRemoveAmount = AlphaRemoveAmount;
            ExplosionParticle.Color = Color;
            ExplosionParticle.FrameDelay = FrameDelay;
            ExplosionParticle.Gravity = Gravity;
            ExplosionParticle.MaxParticleCount = MaxParticleCount;
            ExplosionParticle.MaxSideVelocity = MaxSideVelocity;
            ExplosionParticle.MaxUpVelocity = MaxUpVelocity;
            ExplosionParticle.StartAlpha = StartAlpha;
            ExplosionViewportAdornment.ShakeEnabled = ShakeEnabled;
            ExplosionViewportAdornment.ParticlesEnabled = ParticlesEnabled;
        }
    }

    /// <summary>
    /// This is the class that implements the package exposed by this assembly.
    /// </summary>
    /// <remarks>
{'fraction_non_alphanumeric': 0.0833412615355342, 'fraction_numerical': 0.0036152602035962327, 'mean_word_length': 3.1880478087649404, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6701802', 'n_tokens_mistral': 2715, 'n_tokens_neox': 2581, 'n_words': 875}