public object Clone() { GroupSchemaItem gsi = new GroupSchemaItem(); gsi.Level = this.Level; gsi.bSummary = this.bSummary; gsi.Items = this.Items.Clone() as SimpleArrayList; return(gsi); }
private void AddSchemaItemItem( GroupSchemaItem item, XmlDocument doc, XmlElement parent) { for (int i = 0; i < item.Items.Count; i++) { XmlElement xeSii = this.AddSubElement(doc, parent, GroupSchemas._xmlKeyItem); xeSii.SetAttribute(GroupSchemas._xmlKeyName, item.Items[i].ToString()); } }
public void AddByLevel(GroupSchemaItem value) { int count = Count; for (int i = 0; i < count; i++) { if (this[i].Level > value.Level) { Insert(i, value); return; } } Add(value); }
public bool Contains(string name) { bool b = false; for (int i = 0; i < _schemaitems.Count; i++) { GroupSchemaItem gsi = _schemaitems[i]; b = gsi.Contains(name); if (b) { return(b); } } return(b); }
public bool Contains(Cell cell) { bool b = false; for (int i = 0; i < _schemaitems.Count; i++) { GroupSchemaItem gsi = _schemaitems[i]; b = gsi.Contains(cell.Name) || (cell is IMapName && gsi.Contains((cell as IMapName).MapName)); if (b) { return(b); } } return(b); }
public GroupSchemaItem this[int level] { get { // GroupSchemaItem.Level起始值为1 for (int i = 0; i < _schemaitems.Count; i++) { GroupSchemaItem gsi = _schemaitems[i]; if (gsi.Level == level) { return(gsi); } } return(null); } }
private void InitSort(GroupSchema gs) { QuickSortSchema sortSchema = new QuickSortSchema(); int Priority = 1; if (gs.SchemaItems.Count < 1) { return; } if (gs.SchemaItems.Count < 3) { foreach (GroupSchemaItem group in gs.SchemaItems) { foreach (string name in group.Items) { QuickSortItem item = new QuickSortItem(); item.Level = group.Level; item.Priority = Priority; Priority++; item.Name = name; item.SortDirection = SortDirection.Descend; sortSchema.QuickSortItems.Add(item); } } } else { gs.SortSchema = sortSchema; GroupSchemaItem column = gs.SchemaItems[1]; foreach (string name in column.Items) { QuickSortItem item = new QuickSortItem(); item.Level = 2; item.Priority = Priority; Priority++; item.Name = name; item.SortDirection = SortDirection.Descend; sortSchema.QuickSortItems.Add(item); } gs.ColumnSortSchema = sortSchema; } }
public bool FromCrossItem(GroupSchemaItem gsi) { bool b = false; foreach (string name in gsi.Items) { string[] ss = System.Text.RegularExpressions.Regex.Split(name, "____"); int level = Convert.ToInt32(ss[0]); if (level > 0) { b = true; } GroupSchemaItem g = this[level]; if (g == null) { g = new GroupSchemaItem(level); this.SchemaItems.AddByLevel(g); } g.Items.Add(ss[1]); } return(b); }
private static GroupSchemaItem GetGroupSchemaItem( XmlElement ele, int groupLevel) { GroupSchemaItem gsi = new GroupSchemaItem(); gsi.Level = groupLevel; foreach (XmlElement n in ele.ChildNodes) { switch (n.Name) { case GroupSchemas._xmlKeyItem: string cellName = n.GetAttribute(GroupSchemas._xmlKeyName); gsi.Items.Add(cellName); break; default: break; } } return(gsi); }
public bool Contains(GroupSchemaItem value) { return(List.Contains(value)); }
public void Remove(GroupSchemaItem value) { List.Remove(value); }
public void Insert(int index, GroupSchemaItem value) { List.Insert(index, value); }
public int IndexOf(GroupSchemaItem value) { return(List.IndexOf(value)); }
public int Add(GroupSchemaItem value) { return(List.Add(value)); }