Пример #1
0
        public void SettingSync(Setting.Setting setting)
        {
            if (keys == null)
            {
                keys = new Shortcut[] {               //CurrentSetting.AutoCaptureKey,
                    CurrentSetting.AllCaptureKey,
                    CurrentSetting.SelectCaptureKey, CurrentSetting.OpenSettingKey, CurrentSetting.ChangeEditorModeKey
                }
            }
            ;

            #region [ 캡처 설정 ]
            foreach (RadioButton rb in auCaRingTypeRB)
            {
                if (int.Parse(rb.Tag.ToString()) + 1 == (int)setting.AutoCaptureEnableSelection)
                {
                    rb.IsChecked = true;
                }
            }

            foreach (RadioButton rb in popCountDownRB)
            {
                if (int.Parse(rb.Tag.ToString()) == setting.PopupCountSecond)
                {
                    rb.IsChecked = true;
                }
            }

            foreach (RadioButton rb in allCaCountDownRB)
            {
                if (int.Parse(rb.Tag.ToString()) == setting.AllCaptureCountDown)
                {
                    rb.IsChecked = true;
                }
            }

            foreach (RadioButton rb in new RadioButton[] { getURLImage1, getURLImage2, getURLImage3 })
            {
                if (int.Parse(rb.Tag.ToString()) + 1 == (int)setting.ImageFromURLSave)
                {
                    rb.IsChecked = true;
                }
            }

            #endregion

            #region [ 환경 설정 ]
            RecoHeight = CurrentSetting.RecoHeight;
            RecoWidth  = CurrentSetting.RecoWidth;



            Shortcut[] shortcuts = { setting.AllCaptureKey,
                                     setting.AutoCaptureKey,
                                     setting.ChangeEditorModeKey,
                                     setting.SelectCaptureKey,
                                     setting.OpenSettingKey };

            int i = 0;
            foreach (ShortcutKey scKey in new ShortcutKey[] { scAll, scAuto, scEditMode, scSelect, scSetting })
            {
                scKey.InitalizeData(shortcuts[i].WPFKey, shortcuts[i].Control, shortcuts[i].Alt, shortcuts[i].Shift);
                i++;
            }

            swStartupProgram.IsChecked = setting.IsStartupProgram;

            #endregion

            #region [ 패턴 관리 ]
            listView.Items.Clear();
            int ctr = 0;
            foreach (SavePattern ptn in CurrentSetting.Patterns)
            {
                listView.Items.Add(new PatternItem(ptn.SaveLocation, ptn.PatternName, ptn));
                if (CurrentSetting.DefaultPattern == ptn)
                {
                    int innerctr = 0;
                    foreach (PatternItem itm in listView.Items)
                    {
                        if (innerctr == ctr)
                        {
                            itm.IsDefaultPattern = true;
                        }
                        else
                        {
                            itm.IsDefaultPattern = false;
                        }
                        innerctr++;
                    }
                }
                ctr++;
            }
            TBPtnCount.Text = $"등록된 패턴 ({listView.Items.Count}개)";
            #endregion
        }

        #endregion
    }
Пример #2
0
 public new void ShowDialog()
 {
     TempSetting = (Setting.Setting)CurrentSetting.Clone();
     SettingSync(TempSetting);
     base.ShowDialog();
 }