Beispiel #1
0
        public static MapperConfiguration CreateConfig(IEnumerable <string> assemblyPaths = null)
        {
            var config = new MapperConfiguration(cfg =>
            {
                var manualProfile = new ManualProfile();
                cfg.AddProfile(manualProfile);

                foreach (var configuratorType in ReflectionExtensions.FindTypeInAssemblies(t => t.GetInterfaces().Any(i => i == typeof(IAutoMapperConfigurator)), assemblyPaths))
                {
                    var configuratorInstance = (IAutoMapperConfigurator)Activator.CreateInstance(configuratorType);
                    configuratorInstance.ManualConfiguration(manualProfile);
                }
            });

            config.CompileMappings();
            return(config);
        }
        private void OnOkButtonClick(object sender, EventArgs e)
        {
            _presenter.SetMixDuration(_mixDuration.Value);
            _presenter.SetTransitionDuration(_transitionDuration.Value);
            _presenter.SetMP3Quality(int.Parse(_MP3Quality.SelectedItem.ToString()));

            ManualProfile toSave = new ManualProfile();

            toSave.UpdateBpmPriority(_bpmBar.Value);
            toSave.UpdateDanceabilityPriority(_danceabilityBar.Value);
            toSave.UpdateKeyNumberPriority(_keyNumberBar.Value);
            toSave.UpdateKeyTonalityPriority(_keyTonalityBar.Value);

            _presenter.SetProfile(toSave);

            _presenter.SaveParameters();
            OnApplyButtonClick(sender, e);
            Hide();
        }