LoadFromConfiguration() public méthode

public LoadFromConfiguration ( ) : void
Résultat void
Exemple #1
0
        private void RestoreSettings()
        {
            tbServer.Text  = Properties.Settings.Default.QueueServerHost;
            tbPort.Text    = Properties.Settings.Default.QueueServerPort.ToString();
            tbStation.Text = Properties.Settings.Default.StationName;
            cbPost.Text    = Properties.Settings.Default.StationPost;

            chkStartFullScreen.Checked = Properties.Settings.Default.StartDisplayFullScreen;
            chkPrintTicket.Checked     = Properties.Settings.Default.PrintTicket;

            txtRuntext0.Text    = Properties.Settings.Default.RunningText0;
            txtRuntext1.Text    = Properties.Settings.Default.RunningText1;
            txtPrintFooter.Text = Properties.Settings.Default.PrintFooter;

            tbImgLogo.Text   = Properties.Settings.Default.DisplayLogoImg;
            tbImgHeader.Text = Properties.Settings.Default.DisplayHeaderImg;
            tbImgBG.Text     = Properties.Settings.Default.DisplayHeaderBg;

            chkButtonsWithLabel.Checked = Properties.Settings.Default.DrawLabelOnButtons;
            btnFontSizeChanger.Value    = Properties.Settings.Default.ButtonLabelFontSize;
            labelFontSizeChanger.Value  = Properties.Settings.Default.MainMenuLabelFontSize;

            chkShowLeftMenu.Checked  = Properties.Settings.Default.ShowLeftMenu;
            chkShowRightMenu.Checked = Properties.Settings.Default.ShowRightMenu;

            // Setup post options
            postProperties.LoadFromConfiguration();
            cbSelectPost.Text = "POST0";
            var postId = cbSelectPost.Text;

            SetPostPropertiesControl(postId);

            SetRadioButtonMainMenuLabelState();
        }
        private void RestoreSettings()
        {
            // Restore last used video device
            if (_settings.VideoInputDevicePath != String.Empty)
            {
                cbDevice.SelectedValue = _settings.VideoInputDevicePath;
            }

            // Restore last used video input device source
            if (_settings.VideoSource == "VideoInputDevice")
            {
                radVideoDevice.Checked = true;
            }
            else if (_settings.VideoSource == "VideoCLip")
            {
                radVideoClip.Checked = true;
            }

            if (_settings.VideoCLipMode == "PlayFromFolder")
            {
                rbPlayFromFolder.Checked = true;
            }
            else if (_settings.VideoCLipMode == "PlayBySelectManually")
            {
                rbOpenClip.Checked = true;
            }

            tbClipFolder.Text = _settings.VideoClipLocation;

            tbServer.Text  = _settings.QueueServerHost;
            tbPort.Text    = _settings.QueueServerPort.ToString();
            tbStation.Text = _settings.StationName;
            cbPost.Text    = _settings.StationPost;

            tbClipFolder.Text                 = _settings.VideoClipLocation;
            tbAudioFolder.Text                = _settings.NumberAudioLocation;
            chkSpellNumber.Checked            = _settings.AudioSpellNumber;
            chkPlaySimpleNotification.Checked = _settings.PlaySimpleSoundNotification;
            chkShowLogo.Checked               = _settings.ShowLogo;
            chkShowInfoTextTop0.Checked       = _settings.ShowInfoTextTop0;
            chkShowInfoTextTop1.Checked       = _settings.ShowInfoTextTop1;
            chkShowCenterMiddleDiv.Checked    = _settings.ShowCenterMiddleDiv;
            chkShowLeftPosts.Checked          = _settings.ShowLeftPosts;
            chkShowRightPosts.Checked         = _settings.ShowRightPosts;

            btnAnimationColor.BackColor = _settings.NumberAnimationColor;
            numericUpDown.Value         = (decimal)_settings.QueueAnimationTimeInSecond;

            // DSEngine volume related settings
            volSlider.Value = _settings.DSEngineVolumeLevel / 1000;
            mDisplay.DSEngine.SetVolume(_settings.DSEngineVolumeLevel);
            lastVolume        = _settings.DSEngineVolumeLevel;
            chkMute.Checked   = (lastVolume == -10000);
            volSlider.Enabled = (lastVolume > -10000);

            chkSetUnderscore.Checked    = _settings.StartNumberWithUnderscore;
            chkPlayVideoStartup.Checked = _settings.PlayVideoAtStartup;

            // Check sound folder
            string _soundDir = _settings.NumberAudioLocation;

            if (!Directory.Exists(_soundDir))
            {
                _soundDir = Util.ProcessDir + "\\wav";
                _settings.NumberAudioLocation = _soundDir;
            }

            if (Directory.Exists(_soundDir))
            {
                tbAudioFolder.Text = _soundDir;
            }

            chkAudioLoketIDUseAlphabet.Checked = _settings.AudioLoketIDUseAlphabet;

            txtRuntext0.Text = _settings.RunningText0;
            txtRuntext1.Text = _settings.RunningText1;

            tbImgLogo.Text  = _settings.DisplayLogoImg;
            tbTextLogo.Text = _settings.DisplayLogoText;

            // setup POST Options
            _postProperties.LoadFromConfiguration();
            cbSelectPost.Text = "POST0";
            var postId = cbSelectPost.Text;

            SetPostPropertiesControl(postId);
        }