예제 #1
0
        /// <summary>
        ///     Determines whether the specified QKeyedTable is equal to the current QKeyedTable.
        /// </summary>
        /// <param name="kt">The QKeyedTable to compare with the current QKeyedTable.</param>
        /// <returns>true if the specified QKeyedTable is equal to the current QKeyedTable; otherwise, false</returns>
        public bool Equals(QKeyedTable kt)
        {
            if (kt == null)
            {
                return(false);
            }

            return(Keys.Equals(kt.Keys) && Values.Equals(kt.Values));
        }
예제 #2
0
 //-------------------------------------------------------------------//
 private static object[,] QKeyedTable2Excel(QKeyedTable table)
 {
     var res = new object[table.Values.RowsCount + 1, table.Values.ColumnsCount + table.Keys.ColumnsCount];
     for (var i = 0; i < table.Keys.ColumnsCount + table.Values.ColumnsCount; i++)
         for (var j = 0; j < table.Values.RowsCount + 1; j++)
         {
             if (j == 0) //write colnames
             {
                 res[j, i] = (i < table.Keys.ColumnsCount)
                     ? table.Keys.Columns.GetValue(i).ToString()
                     : table.Values.Columns.GetValue(i - table.Keys.ColumnsCount).ToString();
             }
             else //write data
             {
                 res[j, i] = (i < table.Keys.ColumnsCount)
                     ? Convert2Excel(((Array) table.Keys.Data.GetValue(i)).GetValue(j - 1))
                     : Convert2Excel(
                         ((Array) table.Values.Data.GetValue(i - table.Keys.ColumnsCount)).GetValue(
                             j - 1));
             }
         }
     return res;
 }
예제 #3
0
 public QKeyedTableEnumerator(QKeyedTable table)
 {
     _kt = table;
 }
예제 #4
0
 /// <summary>
 ///     Initializes a new instance of the KeyValuePair.
 /// </summary>
 public KeyValuePair(QKeyedTable table, int index)
 {
     _kt = table;
     _index = index;
 }
예제 #5
0
        /// <summary>
        ///     Determines whether the specified QKeyedTable is equal to the current QKeyedTable.
        /// </summary>
        /// <param name="kt">The QKeyedTable to compare with the current QKeyedTable.</param>
        /// <returns>true if the specified QKeyedTable is equal to the current QKeyedTable; otherwise, false</returns>
        public bool Equals(QKeyedTable kt)
        {
            if (kt == null)
            {
                return false;
            }

            return Keys.Equals(kt.Keys) && Values.Equals(kt.Values);
        }
예제 #6
0
 private void WriteKeyedTable(QKeyedTable kt)
 {
     _writer.Write((sbyte)QType.KeyedTable);
     WriteObject(kt.Keys);
     WriteObject(kt.Values);
 }
예제 #7
0
 private void WriteKeyedTable(QKeyedTable kt)
 {
     writer.Write((sbyte)QType.KeyedTable);
     WriteObject(kt.Keys);
     WriteObject(kt.Values);
 }
예제 #8
0
 public QKeyedTableEnumerator(QKeyedTable table)
 {
     _kt      = table;
     _current = new KeyValuePair(_kt, _index);
 }
예제 #9
0
 /// <summary>
 ///     Initializes a new instance of the KeyValuePair.
 /// </summary>
 public KeyValuePair(QKeyedTable table, int index) : this()
 {
     _kt   = table;
     Index = index;
 }