Esempio n. 1
0
        public override bool Equals(object obj)
        {
            ITabularData other = obj as ITabularData;

            return(other != null &&
                   TabularType.Equals(other.TabularType) &&
                   ContainsSameValues(other.Values));
        }
Esempio n. 2
0
 /// <summary>
 /// Creates new TabularDataSupport object.
 /// </summary>
 /// <param name="tabularType">The tabular type describing this ITabularData instance; cannot be null.</param>
 public TabularDataSupport(TabularType tabularType)
 {
     if (tabularType == null)
     {
         throw new ArgumentNullException("tabularType");
     }
     _rows        = new Dictionary <IEnumerable <object>, ICompositeData>();
     _tabularType = tabularType;
 }
Esempio n. 3
0
        public sealed override bool Equals(object obj)
        {
            TabularType other = obj as TabularType;

            if (other != null && TypeName.Equals(other.TypeName) && _rowType.Equals(other._rowType) &&
                _indexNames.Count == other._indexNames.Count)
            {
                for (int i = 0; i < _indexNames.Count; i++)
                {
                    if (_indexNames[i] != other._indexNames[i])
                    {
                        return(false);
                    }
                }
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 4
0
        public ICompositeDataBuilder Table(string name, Action <ITabularData> nestedTabularBuilder)
        {
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }
            if (nestedTabularBuilder == null)
            {
                throw new ArgumentNullException("nestedTabularBuilder");
            }
            TabularType nestedTabularType = _type.GetOpenType(name) as TabularType;

            if (nestedTabularType == null)
            {
                throw new InvalidOperationException(string.Format("Item {0} is not of TabularType", name));
            }
            TabularDataSupport nestedTable = new TabularDataSupport(nestedTabularType);

            nestedTabularBuilder(nestedTable);
            _items.Add(name, nestedTable);
            return(this);
        }
Esempio n. 5
0
 /// <summary>
 /// Creates new TabularDataSupport object.
 /// </summary>
 /// <param name="tabularType">The tabular type describing this TabularData instance; cannot be null.</param>
 /// <param name="initialCapacity">The initial capacity of the underlying dictionary.</param>
 public TabularDataSupport(TabularType tabularType, int initialCapacity)
 {
     _rows        = new Dictionary <IEnumerable <object>, ICompositeData>(initialCapacity);
     _tabularType = tabularType;
 }