コード例 #1
0
        public InfoControl()
        {
            InitializeComponent();
            _infoDesign = new InfoModuleDesign();

            _ic = new InfoConfig();

            _ic.ZoomFactor = 1;
        }
コード例 #2
0
        public bool ShowImageConfig(InfoConfig ic, string sectionName, IWin32Window owner)
        {
            IsOk = false;

            _ic          = ic;
            _sectionName = sectionName;

            this.ShowDialog(owner);

            return(IsOk);
        }
コード例 #3
0
        public override void ModuleLoaded()
        {
            _ic = InfoConfig.GetConfig(_moduleName);

            if (_ic.ZoomFactor <= 0)
            {
                _ic.ZoomFactor = 1;
            }

            richTextBox1.ZoomFactor = _ic.ZoomFactor;

            base.ModuleLoaded();
        }
コード例 #4
0
        private void butSure_Click(object sender, EventArgs e)
        {
            try
            {
                _ic.ZoomFactor = (float)Convert.ToDouble(txtZoomFactor.Text);

                InfoConfig.SetConfig(_ic, _sectionName);

                IsOk = true;

                this.Close();
            }
            catch (Exception Ex)
            {
                MessageBox.Show(Ex.Message);
            }
        }
コード例 #5
0
        static public void SetConfig(InfoConfig ic, string sectionName)
        {
            SettingItem imageSetting = AppSettingHelper.GetSpecifySection(sectionName);

            imageSetting.BatchBegin();
            try
            {
                imageSetting.WriteDouble("ZoomFactor", ic.ZoomFactor);

                imageSetting.BatchCommit();
            }
            catch (Exception ex)
            {
                imageSetting.BatchCancel();
                MsgBox.ShowException(ex);
            }
        }
コード例 #6
0
        static public InfoConfig GetConfig(string sectionName)
        {
            InfoConfig ic = new InfoConfig();

            try
            {
                SettingItem imageSetting = AppSettingHelper.GetSpecifySection(sectionName);

                ic.ZoomFactor = (float)imageSetting.ReadDouble("ZoomFactor");
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex);
            }

            return(ic);
        }