コード例 #1
0
        private void ImgRadioButton_CheckedChanged(object sender, EventArgs e)
        {
            if (imgRadioButton.Checked && imgRadioButton.Enabled)
            {
                if ((bool)UserConfigManager.GetConfigValueByKey(ConfigKey.IsImgInfoRemind))
                {
                    FirstForm_ImgCheckInfo firstForm_ImgCheckInfo = new FirstForm_ImgCheckInfo();

                    firstForm_ImgCheckInfo.StartPosition = FormStartPosition.Manual;                                                                 //手動設定跳窗初始位置
                    firstForm_ImgCheckInfo.Location      = new Point(this.Location.X + this.Size.Width / 4, this.Location.Y + this.Size.Height / 4); //跳窗位置
                    DialogResult dontRemindImgInto = firstForm_ImgCheckInfo.ShowDialog();

                    bool NoNeedToRemind;
                    if (dontRemindImgInto == DialogResult.Yes)
                    {
                        NoNeedToRemind = true;
                    }
                    else
                    {
                        NoNeedToRemind = false;
                    }

                    UserConfigManager.SetAndWriteConfig(ConfigKey.IsImgInfoRemind, !NoNeedToRemind);
                }
            }
        }
コード例 #2
0
        private void ZoomComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            string tempString        = zoomComboBox.Text;
            int    zoomPercentageInt = Convert.ToInt32(tempString.Split('%')[0]);

            UserConfigManager.SetAndWriteConfig(ConfigKey.ZoomPercentage, zoomPercentageInt);
        }
コード例 #3
0
        public FirstForm()
        {
            InitializeComponent();

            //委派設定預設值
            UserConfigManager.SetDefaultValueToConfigHandler = new UserConfigManager.SetDefaultValueToConfigEvent(SetDefaultValueToConfig);
            //初始化設定預設值
            UserConfigManager.InitConfigDictionary();
        }
コード例 #4
0
        private void UrlCheckBox_CheckedChanged(object sender, EventArgs e)
        {
            bool isChecked = urlCheckBox.Checked;

            urlRichTextBox.Enabled        = isChecked;
            SourceHTMLRichTextBox.Enabled = !isChecked;
            youtubeRadioButton.Enabled    = isChecked;
            imgRadioButton.Enabled        = isChecked;

            UserConfigManager.SetAndWriteConfig(ConfigKey.UseUrl, isChecked);
        }
コード例 #5
0
 //設定預設值
 private static void SetDefaultValueToConfig()
 {
     UserConfigManager.SetConfig(ConfigKey.IsImgInfoRemind, true);
     UserConfigManager.SetConfig(ConfigKey.UseUrl, false);
     UserConfigManager.SetConfig(ConfigKey.IsYouTubeChecked, true);
     UserConfigManager.SetConfig(ConfigKey.IsPreViewAtRight, true);
     UserConfigManager.SetConfig(ConfigKey.UpOffet, 0);
     UserConfigManager.SetConfig(ConfigKey.ZoomPercentage, 100);
     UserConfigManager.SetConfig(ConfigKey.IsBeforePreviewChecked, true);
     UserConfigManager.SetConfig(ConfigKey.IsAfterPreviewChecked, true);
     UserConfigManager.SetConfig(ConfigKey.IsCenterChecked, false);
 }
コード例 #6
0
        //依照使用者設定初始化整個版面
        private void SettingFirstFormByConfig()
        {
            urlCheckBox.Checked = (bool)UserConfigManager.GetConfigValueByKey(ConfigKey.UseUrl);
            //根據有沒有check來變換其他控制項之Enable
            UrlCheckBox_CheckedChanged(this, new EventArgs());

            youtubeRadioButton.Checked = (bool)UserConfigManager.GetConfigValueByKey(ConfigKey.IsYouTubeChecked);
            imgRadioButton.Checked     = !(bool)UserConfigManager.GetConfigValueByKey(ConfigKey.IsYouTubeChecked);

            rightSideRadioButton.Checked = (bool)UserConfigManager.GetConfigValueByKey(ConfigKey.IsPreViewAtRight);
            downRadioButton.Checked      = !(bool)UserConfigManager.GetConfigValueByKey(ConfigKey.IsPreViewAtRight);

            //Proview向上偏移
            UpDownOffsetUp.Value = (int)UserConfigManager.GetConfigValueByKey(ConfigKey.UpOffet);

            zoomComboBox.Text = UserConfigManager.GetConfigValueByKey(ConfigKey.ZoomPercentage).ToString() + "%";

            sourcePreviewCheckBox.Checked = (bool)UserConfigManager.GetConfigValueByKey(ConfigKey.IsBeforePreviewChecked);
            resultPreviewCheckBox.Checked = (bool)UserConfigManager.GetConfigValueByKey(ConfigKey.IsAfterPreviewChecked);
            centerCheckBox.Checked        = (bool)UserConfigManager.GetConfigValueByKey(ConfigKey.IsCenterChecked);
        }
コード例 #7
0
 private void YoutubeRadioButton_CheckedChanged(object sender, EventArgs e)
 {
     UserConfigManager.SetAndWriteConfig(ConfigKey.IsYouTubeChecked, youtubeRadioButton.Checked);
 }
コード例 #8
0
 private void RightSideRadioButton_CheckedChanged(object sender, EventArgs e)
 {
     UserConfigManager.SetAndWriteConfig(ConfigKey.IsPreViewAtRight, rightSideRadioButton.Checked);
 }
コード例 #9
0
 private void CenterCheckBox_CheckedChanged(object sender, EventArgs e)
 {
     UserConfigManager.SetAndWriteConfig(ConfigKey.IsCenterChecked, centerCheckBox.Checked);
 }
コード例 #10
0
 private void resultPreviewCheckBox_CheckedChanged(object sender, EventArgs e)
 {
     UserConfigManager.SetAndWriteConfig(ConfigKey.IsAfterPreviewChecked, resultPreviewCheckBox.Checked);
 }
コード例 #11
0
 private void sourcePreviewCheckBox_CheckedChanged(object sender, EventArgs e)
 {
     UserConfigManager.SetAndWriteConfig(ConfigKey.IsBeforePreviewChecked, sourcePreviewCheckBox.Checked);
 }
コード例 #12
0
 private void UpDownOffsetUp_ValueChanged(object sender, EventArgs e)
 {
     UserConfigManager.SetAndWriteConfig(ConfigKey.UpOffet, (int)UpDownOffsetUp.Value);
 }