Ejemplo n.º 1
0
        public static List <MD_GuideLineFieldName> GetFieldNamesFromMeta(string _metaStr)
        {
            List <MD_GuideLineFieldName> _ret = new List <MD_GuideLineFieldName>();

            RegexOptions options  = RegexOptions.None;
            Regex        regeMeta = new Regex(@"<FN>[^<]{1,}</FN>", options);

            MatchCollection _mc = regeMeta.Matches(_metaStr);

            foreach (Match _m in _mc)
            {
                string   _s2 = _m.Value.Substring(4, _m.Length - 9);
                string[] _s3 = _s2.Split(':');
                if (_s3.Length > 1)
                {
                    string _fname              = _s3[0].ToUpper();
                    string _title              = _s3[1];
                    int    _order              = (_s3.Length > 2) ? int.Parse((_s3[2] == "") ? "0" : _s3[2]) : 0;
                    int    _width              = (_s3.Length > 3) ? int.Parse((_s3[3] == "") ? "100" : _s3[3]) : 100;
                    string _center             = (_s3.Length > 4) ? _s3[4] : "LEFT";
                    string _display            = (_s3.Length > 5) ? _s3[5] : "";
                    string _group              = (_s3.Length > 6) ? _s3[6] : "DEFAULT";
                    bool   _canHide            = (_s3.Length > 7) ? ((_s3[7] == "0") ? false : true) : false;
                    MD_GuideLineFieldName _gfn = new MD_GuideLineFieldName(_fname, _title, _order, _width, _center, _display, _canHide);
                    _ret.Add(_gfn);
                }
            }
            return(_ret);
        }
Ejemplo n.º 2
0
 private void GetChildData(MD_GuideLineFieldGroup _fg, TreeObj_GuideLineFieldGroup _group)
 {
     _fg.Fields = new List <MD_GuideLineFieldName>();
     foreach (TreeObj_GuidelLineFieldItem _fitem in _group.Children)
     {
         MD_GuideLineFieldName _fn = _fitem.FieldData;
         _fg.Fields.Add(_fn);
     }
 }
Ejemplo n.º 3
0
        private static void GetFieldNamesFromMeta(string metaStr, Dictionary <string, MD_GuideLineFieldGroup> dict, List <MD_GuideLineFieldGroup> ret)
        {
            RegexOptions options  = RegexOptions.None;
            Regex        regeMeta = new Regex(@"<FN>[^<]{1,}</FN>", options);

            MatchCollection _mc = regeMeta.Matches(metaStr);

            foreach (Match _m in _mc)
            {
                string   _s2 = _m.Value.Substring(4, _m.Length - 9);
                string[] _s3 = _s2.Split(':');
                if (_s3.Length > 1)
                {
                    string _fname    = _s3[0].ToUpper();
                    string _orifname = _s3[0];
                    string _title    = _s3[1];
                    int    _order    = (_s3.Length > 2) ? int.Parse((_s3[2] == "") ? "0" : _s3[2]) : 0;
                    int    _width    = (_s3.Length > 3) ? int.Parse((_s3[3] == "") ? "100" : _s3[3]) : 100;
                    string _center   = (_s3.Length > 4) ? _s3[4] : "LEFT";
                    if (_center == "1")
                    {
                        _center = "CENTER";
                    }
                    if (_center == "0")
                    {
                        _center = "LEFT";
                    }
                    string _display            = (_s3.Length > 5) ? _s3[5] : "";
                    string _group              = (_s3.Length > 6) ? _s3[6] : "DEFAULT";
                    bool   _canHide            = (_s3.Length > 7) ? ((_s3[7] == "0") ? false : true) : false;
                    MD_GuideLineFieldName _gfn = new MD_GuideLineFieldName(_orifname, _fname, _title, _order, _width, _center, _display, _canHide);
                    if (dict.ContainsKey(_group))
                    {
                        MD_GuideLineFieldGroup _glg = dict[_group];
                        if (_glg.Fields == null)
                        {
                            _glg.Fields = new List <MD_GuideLineFieldName>();
                        }
                        _glg.Fields.Add(_gfn);
                    }
                    else
                    {
                        MD_GuideLineFieldGroup _glg = new MD_GuideLineFieldGroup(_group, "(默认组)", "CENTER", 1, false, "SHOW");
                        ret.Add(_glg);
                        dict.Add(_group, _glg);
                        _glg.Fields = new List <MD_GuideLineFieldName>();
                        _glg.Fields.Add(_gfn);
                    }
                }
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 设置对齐格式
        /// </summary>
        /// <param name="_col"></param>
        /// <param name="_fn"></param>
        protected void SetColumnTextAlign(GridColumn _col, MD_GuideLineFieldName _fn)
        {
            switch (_fn.TextAlign)
            {
            case "CENTER":
                _col.AppearanceCell.TextOptions.HAlignment = HorzAlignment.Center;
                break;

            case "RIGHT":
                _col.AppearanceCell.TextOptions.HAlignment = HorzAlignment.Far;
                break;

            default:
                _col.AppearanceCell.TextOptions.HAlignment = HorzAlignment.Near;
                break;
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 设置显示格式
        /// </summary>
        /// <param name="_col"></param>
        /// <param name="_fn"></param>
        protected void SetColumnDisplayFormat(GridColumn _col, MD_GuideLineFieldName _fn)
        {
            _col.OptionsColumn.AllowFocus             = true;
            _col.OptionsColumn.AllowGroup             = DefaultBoolean.True;
            _col.OptionsColumn.AllowIncrementalSearch = true;
            _col.OptionsColumn.AllowMerge             = DefaultBoolean.True;
            _col.OptionsColumn.AllowMove                 = true;
            _col.OptionsColumn.AllowSize                 = true;
            _col.OptionsColumn.AllowSort                 = DefaultBoolean.True;
            _col.OptionsColumn.ReadOnly                  = true;
            _col.OptionsColumn.ShowCaption               = true;
            _col.OptionsColumn.ShowInCustomizationForm   = true;
            _col.AppearanceHeader.TextOptions.HAlignment = HorzAlignment.Center;


            if (_fn.DisplayFormat.Trim().Length > 0)
            {
                string[] _fs = _fn.DisplayFormat.Split(',');
                switch (_fs[0])
                {
                case "D":
                    _col.DisplayFormat.FormatType   = FormatType.DateTime;
                    _col.DisplayFormat.FormatString = _fs[1];
                    break;

                case "N":
                    _col.DisplayFormat.FormatType   = FormatType.Numeric;
                    _col.DisplayFormat.FormatString = _fs[1];
                    break;
                }
            }

            if (_detailDict.ContainsKey(_fn.FieldName))
            {
                //_col.AppearanceCell.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                _col.AppearanceCell.ForeColor       = Color.Blue;
                _col.AppearanceCell.Options.UseFont = true;
                _col.OptionsColumn.AllowEdit        = false;
                _LinkColumnList.Add(_fn.FieldName);
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 添加字段定义
        /// </summary>
        private void AddFieldDefine()
        {
            if (!this.IsFieldGroupFocused())
            {
                return;
            }
            TreeListNode _tn = this.treeList1.FocusedNode;

            if (_tn == null)
            {
                return;
            }
            MD_GuideLineFieldName _gf = new MD_GuideLineFieldName();

            _gf.FieldName = "字段";
            TreeObj_GuidelLineFieldItem _fi = new TreeObj_GuidelLineFieldItem(_gf);
            TreeObj_GuideLineFieldGroup _fg = this.treeList1.GetDataRecordByNode(_tn) as TreeObj_GuideLineFieldGroup;

            _fg.Children.Add(_fi);
            this._haveChange = true;
            RaiseDataChanged();
        }
 public TreeObj_GuidelLineFieldItem(MD_GuideLineFieldName data)
 {
     _data = data;
     _type = "FIELD";
 }
Ejemplo n.º 8
0
        private void ChangeBandStatus(GridBand _band)
        {
            if (_band.ImageIndex == -1)
            {
                return;
            }
            MD_GuideLineFieldGroup _group = _band.Tag as MD_GuideLineFieldGroup;
            int _fullWidth = 0;
            int _hideWidth = 0;

            foreach (MD_GuideLineFieldName _fn in _group.Fields)
            {
                _fullWidth += _fn.DisplayWidth;
                if (!_fn.CanHide)
                {
                    _hideWidth += _fn.DisplayWidth;
                }
            }
            if (_hideWidth < 30)
            {
                _hideWidth = 30;
            }
            if (_band.ImageIndex == 1)
            {
                //展开
                _band.Caption = _group.DisplayTitle;

                _band.ImageIndex     = 0;
                _band.ImageAlignment = StringAlignment.Far;
                foreach (BandedGridColumn _bgc in _band.Columns)
                {
                    if (_bgc.FieldName == "_BlankData")
                    {
                        _bgc.Visible = false;
                    }
                    else
                    {
                        _bgc.Visible = true;
                    }
                }
                _band.Width = _fullWidth;
            }
            else
            {
                foreach (BandedGridColumn _bgc in _band.Columns)
                {
                    if (_bgc.FieldName == "_BlankData")
                    {
                        _bgc.Visible = true;
                    }
                    else
                    {
                        MD_GuideLineFieldName _fn = _bgc.Tag as MD_GuideLineFieldName;
                        if (_fn.CanHide)
                        {
                            _bgc.Visible = false;
                        }
                        else
                        {
                            _bgc.Visible = true;
                        }
                    }
                }
                if (_hideWidth > 30)
                {
                    _band.Caption        = _group.DisplayTitle;
                    _band.ImageAlignment = StringAlignment.Far;
                }
                else
                {
                    _band.Caption        = "";
                    _band.ImageAlignment = StringAlignment.Center;
                }
                _band.Width      = _hideWidth;
                _band.ImageIndex = 1;
            }
        }