Esempio n. 1
0
 private HDef(string val)
 {
     if (val == null || !val.StartsWith("^") || !HDict.isTagName(val))
     {
         throw new ArgumentException("Invalid def val: \"" + val + "\"");
     }
     m_val = val;
 }
 // Add tag name and value.  Return this.
 public HDictBuilder add(string name, HVal val)
 {
     if (!HDict.isTagName(name))
     {
         throw new InvalidOperationException("Invalid tag name: " + name);
     }
     if (m_map == null)
     {
         m_map = new Dictionary <string, HVal>();
     }
     m_map.Add(name, val);
     return(this);
 }
Esempio n. 3
0
        //////////////////////////////////////////////////////////////////////////
        // Building
        //////////////////////////////////////////////////////////////////////////

        // Add new column and return builder for column metadata.
        //    Columns cannot be added after adding the first row.
        public HDictBuilder addCol(string name)
        {
            if (m_rows.Count > 0)
            {
                throw new InvalidOperationException("Cannot add cols after rows have been added");
            }
            if (!HDict.isTagName(name))
            {
                throw new ArgumentException("Invalid column name: " + name, "name");
            }
            BCol col = new BCol(name);

            m_cols.Add(col);
            return(col.Meta);
        }