예제 #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());
     }
 }
예제 #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);
        }
예제 #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);
        }
예제 #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);
        }
예제 #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;
            }
        }
예제 #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);
        }
예제 #10
0
 public bool Contains(GroupSchemaItem value)
 {
     return(List.Contains(value));
 }
예제 #11
0
 public void Remove(GroupSchemaItem value)
 {
     List.Remove(value);
 }
예제 #12
0
 public void Insert(int index, GroupSchemaItem value)
 {
     List.Insert(index, value);
 }
예제 #13
0
 public int IndexOf(GroupSchemaItem value)
 {
     return(List.IndexOf(value));
 }
예제 #14
0
 public int Add(GroupSchemaItem value)
 {
     return(List.Add(value));
 }