public void JoinRow(IFakeRow row) { row.ForEach(element => { if (!this.Values.ContainsKey(element.Key)) { this.Values.Add(element.Key, element.Value); } }); }
public virtual bool AddRow(IFakeRow row) { bool rowExists = this.Rows.Where(r => r.Index == row.Index).Any(); if (rowExists) { throw new Exception($"There is already Row at index { row.Index }"); } // If there isn't any row at specified index than add Row this.CastRow().Add(row); return(true); }
public virtual IFakeRow AddRow(int rowIndex) { var rows = (from r in this.Rows where r.Index == rowIndex select r).ToList(); if (rows.Count() > 0) { throw new Exception($"There is already a Row at index { rowIndex }"); } IFakeRow row = this.NewRow(rowIndex); this.CastRow().Add(row); return(row); }
/// <summary> /// Converts <see cref="IFakeRow"/> to <see cref="IFakeJoinedRow"/>. /// </summary> /// <param name="source"></param> /// <returns></returns> public static IFakeJoinedRow ToJoinedRow(this IFakeRow source) { return(new FakeJoinedRow(source)); }
public virtual void RemoveRow(int rowIndex) { IFakeRow row = this.GetRow(rowIndex); this.CastRow().Remove(row); }
public bool CanJoinRow(IFakeRow row, string columnName) { return(this.CanJoinRow(row.ToJoinedRow(), columnName)); }
public FakeJoinedRow(IFakeRow row) : this() { JoinRow(row); }