Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ButtonModel"/> class.
 /// </summary>
 /// <param name="baseControl">Enum describing a default button</param>
 /// <param name="row">Row in the control panel where the control positioned</param>
 /// <param name="col">Column in the control panel where the control positioned</param>
 public ButtonModel(PresetControl baseControl, int row, int col)
 {
     X = col;
     Y = row;
     //// BaseControlPreset = baseControl; TODO uncomment when new field added to ButtonModel
 }
Esempio n. 2
0
        public void PopulizeSettings()
        {
            /*
             *          Controls to Bind:
             *          Main Tab ---------------------------
             *          mdPlylistPathTextBox +
             *          moscowPlaylistPathTextBox+
             *          PresetsComboBox
             *          PresetDescriptionLabel
             *          Settings Tab------------------------
             *          MskHourStringPattern;
             *          MskHourTimePattern;
             *          MskSongStringPattern;
             *          MskSongZcodePattern;
             *          MdHourSymbolTextBox+
             *
             * Presets Controls
             *
             */

            //__________________________________________________________________________
            //mdPlylistPathTextBox
            //Выполняется в SetOutputFilename
            Set_MdRusPlaylistPathTextBox.Text = _currentSettings.Settings.MdRusPlaylistPath;
            Set_MdRumPlaylistPathTextBox.Text = _currentSettings.Settings.MdRumPlaylistPath;


            //____________________________________________________________________________
            Set_MskHourStringPatternTextBox.Text = _currentSettings.Settings.MskHourStringPattern;
            Set_MskHourTimePatternTextBox.Text   = _currentSettings.Settings.MskHourTimePattern;
            Set_MskSongStringPatternTextBox.Text = _currentSettings.Settings.MskSongStringPattern;
            Set_MskSongZcodePatternTextBox.Text  = _currentSettings.Settings.MskSongZcodePattern;

            Set_MdHourBeginStringTextBox.Text = _currentSettings.Settings.MdHourBeginString;


            //___________________________________________________________________________
            mskPlaylistPathTextBox.Text     = _currentSettings.Settings.MskPlaylistPath;
            Set_MskPlaylistPathTextBox.Text = _currentSettings.Settings.MskPlaylistPath;

            //Alias______________________________________________________________________
            aliasNameTextBox.Text     = _currentSettings.Settings.AliasName;
            aliasPathTextBox.Text     = _currentSettings.Settings.AliasPath;
            aliasPathPartTextBox.Text = _currentSettings.Settings.AliasPathPart;

            //___________________________________________________________________________
            //Presets

            //ComboBox
            if (UpdateComboBox)
            {
                presetsComboBox.Items.Clear();
                foreach (TimePreset t in _currentSettings.Settings.TimePresetCollection)
                {
                    presetsComboBox.Items.Add(t.PresetName);
                }

                presetsComboBox.SelectedIndex = _currentSettings.Settings.ActivePresetIndex;
            }


            //Groupbox
            PresetsGroupBox.Controls.Clear();
            PresetsGroupBox.Height = 0;

            PresetControl presetItem;

            for (int i = 0; i < _currentSettings.Settings.TimePresetCollection.Count; i++)
            {
                presetItem = new PresetControl(i, _currentSettings.Settings.TimePresetCollection[i],
                                               (_currentSettings.Settings.ActivePresetIndex != i))
                {
                    Top = i * 80
                };
                if (i == 0)
                {
                    presetItem.Top += 18;
                }

                presetItem.Left         = 6;
                PresetsGroupBox.Height += presetItem.Height + 7;
                PresetsGroupBox.Controls.Add(presetItem);
            }

            PresetsGroupBox.Height += 30;
            AddPresetBtn.Location   = new System.Drawing.Point(656, (PresetsGroupBox.Height - 28));
            PresetsGroupBox.Controls.Add(AddPresetBtn);


            PresetDescriptionLabel.Text = _currentSettings.Settings
                                          .TimePresetCollection[_currentSettings.Settings.ActivePresetIndex].PresetDescription;


            //___________________________________________________________________________


            //___________________________________________________________________________
            //CheckBoxes
            foreach (var item in _currentSettings.Settings.CheckBoxesValues)
            {
                var checkBox = this.Controls.Find(item.Name, true)[0] as CheckBox;
                if (checkBox != null)
                {
                    checkBox.Checked = item.Checked;
                }
            }

            //___________________________________________________________________________
        }