/// <summary> /// 构造函数 /// </summary> /// <param name="itemList">Group里的Item</param> internal protected GroupBoxEx(GroupAttsData data, AutoLayoutPanel ownerAutoPanel) { this.OwnerAutoPanel = ownerAutoPanel; this.TabStop = false; this._itemList = data; this._autoAttribute = data.AutoAttributeDatas[0].Attribute; this._PaintBorder = data.AutoAttributeDatas[0].Attribute.GroupBoxPaintBorder; ///这里是根据是否使用groupBox的属性来区别,当前是要创建 groupBox this._isGroupBox = data.AutoAttributeDatas[0].Attribute.GroupBoxUseWinStyle; if (_isGroupBox) { _innerGroupBox = new GroupBox(); _innerGroupBox.TabStop = false; } this.LayoutOwnControl(); }
/// <summary> /// 将AutoAttributeData的集合整理成GroupAttsData的集合 by lisuye on 2008年5月28日 /// </summary> protected virtual SortedDictionary <int, GroupAttsData> ToGroupDatas(List <AutoAttributeData> objectKeyList) { SortedDictionary <int, GroupAttsData> dicGroupAttsData = new SortedDictionary <int, GroupAttsData>(); foreach (var item in objectKeyList) { int groupBoxIndex = item.Attribute.GroupBoxIndex; GroupAttsData groupData; ///找此groupBoxIndex对应的Data是否在dic里已存在 if (!dicGroupAttsData.TryGetValue(groupBoxIndex, out groupData)) { ///没有找到,则构造并添加 groupData = new GroupAttsData(groupBoxIndex); dicGroupAttsData.Add(groupBoxIndex, groupData); } groupData.AutoAttributeDatas.Add(item); } return(dicGroupAttsData); }
protected virtual GroupBoxEx CreateGroup(GroupAttsData data) { return(new GroupBoxEx(data, this)); }