<commit_before>﻿using System;
using YAPA.Shared.Contracts;

namespace YAPA.WPF.Specifics
{
    public class ShowSettingsCommand : IShowSettingsCommand
    {
        private readonly ISettings _settings;
        private readonly ISettingManager _mananger;
        private readonly IPluginManager _pluginManager;
        private readonly IDependencyInjector _container;
        private readonly IEnvironment _environment;

        public ShowSettingsCommand(ISettings settings, ISettingManager mananger, IPluginManager pluginManager, IDependencyInjector container, IEnvironment environment)
        {
            _settings = settings;
            _mananger = mananger;
            _pluginManager = pluginManager;
            _container = container;
            _environment = environment;
        }

        public bool CanExecute(object parameter)
        {
            return true;
        }

        public void Execute(object parameter)
        {
            var settingWindow = new SettingsMananger.Settings(_settings, _mananger, _pluginManager, _container, _environment);

            settingWindow.ShowDialog();
        }<commit_msg>Center settings window over application<commit_after>﻿using System;
using System.Windows;
using YAPA.Shared.Contracts;

namespace YAPA.WPF.Specifics
{
    public class ShowSettingsCommand : IShowSettingsCommand
    {
        private readonly ISettings _settings;
        private readonly ISettingManager _mananger;
        private readonly IPluginManager _pluginManager;
        private readonly IDependencyInjector _container;
        private readonly IEnvironment _environment;

        public ShowSettingsCommand(ISettings settings, ISettingManager mananger, IPluginManager pluginManager, IDependencyInjector container, IEnvironment environment)
        {
            _settings = settings;
            _mananger = mananger;
            _pluginManager = pluginManager;
            _container = container;
            _environment = environment;
        }

        public bool CanExecute(object parameter)
        {
            return true;
        }

        public void Execute(object parameter)
        {
            var settingWindow = new SettingsMananger.Settings(_settings, _mananger, _pluginManager, _container, _environment);
            settingWindow.Owner = (Window)_container.Resolve(typeof(IApplication)); 
            settingWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            settingWindow.ShowDialog();
        }
{'fraction_non_alphanumeric': 0.052948255114320095, 'fraction_numerical': 0.0, 'mean_word_length': 2.7560240963855422, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7236676', 'n_tokens_mistral': 576, 'n_tokens_neox': 565, 'n_words': 150}