Esempio n. 1
0
        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());
     }
 }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
 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;
            }
        }
Esempio n. 8
0
        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);
        }
Esempio n. 10
0
 public bool Contains(GroupSchemaItem value)
 {
     return(List.Contains(value));
 }
Esempio n. 11
0
 public void Remove(GroupSchemaItem value)
 {
     List.Remove(value);
 }
Esempio n. 12
0
 public void Insert(int index, GroupSchemaItem value)
 {
     List.Insert(index, value);
 }
Esempio n. 13
0
 public int IndexOf(GroupSchemaItem value)
 {
     return(List.IndexOf(value));
 }
Esempio n. 14
0
 public int Add(GroupSchemaItem value)
 {
     return(List.Add(value));
 }