Пример #1
0
 public void JoinRow(IFakeRow row)
 {
     row.ForEach(element =>
     {
         if (!this.Values.ContainsKey(element.Key))
         {
             this.Values.Add(element.Key, element.Value);
         }
     });
 }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }
Пример #4
0
 /// <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));
 }
Пример #5
0
        public virtual void RemoveRow(int rowIndex)
        {
            IFakeRow row = this.GetRow(rowIndex);

            this.CastRow().Remove(row);
        }
Пример #6
0
 public bool CanJoinRow(IFakeRow row, string columnName)
 {
     return(this.CanJoinRow(row.ToJoinedRow(), columnName));
 }
Пример #7
0
 public FakeJoinedRow(IFakeRow row)
     : this()
 {
     JoinRow(row);
 }