Ejemplo n.º 1
0
        internal CellColumn Add(SRC src, string name)
        {
            if (this.coltype == CellColumnType.CellIndex)
            {
                throw new AutomationException("Can't add an SRC if Columns contains CellIndexes");
            }
            this.coltype = CellColumnType.SRC;

            name = this.fixup_name(name);

            if (this.dic_columns.ContainsKey(name))
            {
                throw new AutomationException("Duplicate Column Name");
            }

            if (this.hs_src == null)
            {
                this.hs_src = new HashSet <SRC>();
            }

            if (this.hs_src.Contains(src))
            {
                string msg = "Duplicate SRC";
                throw new AutomationException(msg);
            }

            int ordinal = this.items.Count;
            var col     = new CellColumn(ordinal, src, name);

            this.items.Add(col);

            this.dic_columns[name] = col;
            this.hs_src.Add(src);
            return(col);
        }
Ejemplo n.º 2
0
        public CellColumn Add(short cell, string name)
        {
            if (this.coltype == CellColumnType.SRC)
            {
                throw new AutomationException("Can't add a CellIndex if Columns contains SRCs");
            }

            this.coltype = CellColumnType.CellIndex;

            if (this.hs_cellindex == null)
            {
                this.hs_cellindex = new HashSet <short>();
            }

            if (this.hs_cellindex.Contains(cell))
            {
                string msg = "Duplicate Cell Index";
                throw new AutomationException(msg);
            }

            name = this.fixup_name(name);
            int ordinal = this.items.Count;
            var col     = new CellColumn(ordinal, cell, name);

            this.items.Add(col);
            this.hs_cellindex.Add(cell);
            return(col);
        }
Ejemplo n.º 3
0
 internal CellColumnList(int capacity)
 {
     this.items       = new List <CellColumn>(capacity);
     this.dic_columns = new Dictionary <string, CellColumn>(capacity);
     this.coltype     = CellColumnType.Unknown;
 }