private void butSure_Click(object sender, EventArgs e)
        {
            try
            {
                if (_formats == null)
                {
                    _formats = new DesignLabelFormats();
                }

                _formats.数据项名称 = cbxDbName.Text;

                _formats.文本格式.Clear();

                foreach (ListViewItem lvi in listView1.Items)
                {
                    _formats.文本格式.Add(lvi.Tag as DesignLabelFormatItem);
                }

                _formatContext = JsonHelper.SerializeObject(_formats);

                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        public string ShowDataNameEditor(string format, IWin32Window owner)
        {
            _formatContext = format;
            _formats       = JsonHelper.DeserializeObject <DesignLabelFormats>(format);

            this.ShowDialog(owner);

            return(_formatContext);
        }
        public DesignLabel()
        {
            Formats = new DesignLabelFormats();

            SizeConstraintsType = SizeConstraintsType.Custom;

            TextVisible = true;
            AppearanceItemCaption.Options.UseBackColor = true;
            AppearanceItemCaption.Options.UseForeColor = true;
            AppearanceItemCaption.Options.UseFont      = true;

            Formats.默认背景色 = this.AppearanceItemCaption.BackColor;
            Formats.默认前景色 = this.AppearanceItemCaption.ForeColor;
        }
        private void LoadDesign(DesignLabelFormats formats)
        {
            if (formats == null)
            {
                return;
            }

            cbxDbName.Text = formats.数据项名称;

            foreach (DesignLabelFormatItem fi in formats.文本格式)
            {
                AddItemToList(fi);
            }

            listView1.View = View.Details;
        }
Exemple #5
0
 public ItemFormat()
 {
     Formats = new DesignLabelFormats();
 }
        public frmSelectField()
        {
            InitializeComponent();

            _formats = new DesignLabelFormats();
        }