internal void PutDdeData(byte[] data) { DataReceived = DateTime.UtcNow; using (XlTable xt = new XlTable(data)) ProcessTable(xt); }
protected override void ProcessTable(XlTable xt) { Rows.Clear(); for (int row = 0; row < xt.Rows; row++) { T item = new T(); for (int col = 0; col < xt.Columns; col++) { xt.ReadValue(); switch (xt.ValueType) { case XlTable.BlockType.Float: _properties[col].SetValue(item, (decimal)xt.FloatValue); break; case XlTable.BlockType.String: if (xt.StringValue != string.Empty) { _properties[col].SetValue(item, xt.StringValue); } break; default: break; } } Rows.Add(item); } OnUpdated(this, Rows); }
protected abstract void ProcessTable(XlTable xt);