Esempio n. 1
0
        public override void ModuleLoaded()
        {
            try
            {
                if (this.DesignMode == false)
                {
                    imageView1.IsDesignModel = this.DesignMode;

                    splitPage1.OnPageChanged -= splitPage1_OnPageChanged;
                    splitPage1.OnPageChanged += splitPage1_OnPageChanged;

                    _ic = ImageConfig.GetConfig(_moduleName);

                    _imgViewCount = _ic.RecordCount;

                    if (_imgViewCount <= 0)
                    {
                        _imgViewCount = 8;
                    }
                }

                base.ModuleLoaded();
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex, this);
            }
        }
        public bool ShowImageConfig(ImageConfig ic, string sectionName, IWin32Window owner)
        {
            IsOk = false;

            _ic          = ic;
            _sectionName = sectionName;

            this.ShowDialog(owner);

            return(IsOk);
        }
        private void butSure_Click(object sender, EventArgs e)
        {
            try
            {
                _ic.RecordCount = Convert.ToInt32(txtPageRecord.Text);

                ImageConfig.SetConfig(_ic, _sectionName);

                IsOk = true;

                this.Close();
            }
            catch (Exception Ex)
            {
                MessageBox.Show(Ex.Message);
            }
        }
Esempio n. 4
0
        static public void SetConfig(ImageConfig ic, string sectionName)
        {
            SettingItem imageSetting = AppSettingHelper.GetSpecifySection(sectionName);

            imageSetting.BatchBegin();
            try
            {
                imageSetting.WriteInt("RecordCount", ic.RecordCount);

                imageSetting.BatchCommit();
            }
            catch (Exception ex)
            {
                imageSetting.BatchCancel();
                MsgBox.ShowException(ex);
            }
        }
Esempio n. 5
0
        static public ImageConfig GetConfig(string sectionName)
        {
            ImageConfig ic = new ImageConfig();

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

                ic.RecordCount = imageSetting.ReadInt("RecordCount");
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex);
            }

            return(ic);
        }