Ejemplo n.º 1
0
        public ConfigurationView()
        {
            InitializeComponent();

            foreach (var language in Enum.GetValues(typeof(Language)).OfType <Language>())
            {
                ComboLanguage.Items.Add(language.DisplayName());
            }
            ComboLanguage.SelectedIndex = Configuration.DefaultLanguage;

            var currentAvatarId = Configuration.DefaultIdAvatar;
            var avatarIndex     = Avatars.GetAll().ToList().IndexOf(Avatars.GetById(currentAvatarId));

            DefaultAvatarSelector.CurrentIndex = avatarIndex;

            var color = (PlayingColor)Configuration.DefaultColor;

            DefaultColorSelector.CurrentColor = color;

            DefaultColorSelector.OnColorChanged   += ColorChanged;
            DefaultAvatarSelector.OnAvatarChanged += AvatarChanged;

            var waitTimes = Enum.GetValues(typeof(WaitTimes)).OfType <WaitTimes>().ToList();

            WaitTimeTrackBar.Maximum = waitTimes.Count() - 1;
            WaitTimeTrackBar.Value   = waitTimes.IndexOf(Configuration.DefaultWaitTime);
            ToolTipAyuda.SetToolTip(WaitTimeTrackBar, Configuration.DefaultWaitTime.DisplayName());
        }