/*unsafe static void WriteDecimal(decimal d, byte[] buffer, int bufferOffset) * { * * }*/ private static OperationType MapType(TableUpdateAction action) { switch (action) { case TableUpdateAction.Add: return(OperationType.Add); case TableUpdateAction.Update: return(OperationType.Update); case TableUpdateAction.Delete: return(OperationType.Delete); default: throw new ArgumentOutOfRangeException("action"); } }
/// <summary> /// Create new table update /// </summary> /// <param name="action"></param> /// <param name="rowIndex"></param> /// <param name="column"></param> public TableUpdate(TableUpdateAction action, int rowIndex, IReactiveColumn column = (IReactiveColumn)null) { _action = action; _rowIndex = rowIndex; _column = column; }
/// <summary> /// Whether this change only affects one or more columns, but not the whole row. /// </summary> /// <param name="action"></param> /// <returns></returns> public static bool IsColumnUpdate(TableUpdateAction action) { return(action == TableUpdateAction.Update); }
/// <summary> /// Whether this change affects the whole row /// </summary> /// <param name="action"></param> /// <returns></returns> public static bool IsRowUpdate(TableUpdateAction action) { return(action == TableUpdateAction.Add || action == TableUpdateAction.Delete); }
private static void CheckRowUpdate(RowUpdateHandler rowUpdates, int rowIndex, int updateIndex, TableUpdateAction updateType) { Assert.AreEqual(rowIndex, rowUpdates.RowUpdates[updateIndex].RowIndex); Assert.AreEqual(updateType, rowUpdates.RowUpdates[updateIndex].Action); }