private static List <CakeRowsCollections> UpdateCakeGridRows(List <string> collection_rows) { List <CakeRowsCollections> newCollection = new List <CakeRowsCollections>(); string last_filled_collection = string.Empty; string toform0 = string.Empty; string toform1 = string.Empty; for (int cnt = 0; cnt < collection_rows.Count; cnt++) { string recent = collection_rows[cnt]; if (-1 == recent.IndexOf('?')) { continue; } string result = SuperImposeImageRows(recent); if (-1 == result.IndexOf('?')) { CakeRowsCollections cakerow1 = new CakeRowsCollections(); cakerow1.rowid = cnt; cakerow1.original = collection_rows[cnt];; cakerow1.modified = result; newCollection.Add(cakerow1); } } return(newCollection); }
/// <summary> /// Cake grids super impose remove invalid initials e.g. /// A B ? ? ======src /// ? A ? C ====== /// =============Output for /// A B ? C /// </summary> /// <param name="collection_rows"></param> /// <returns></returns> public static List <CakeRowsCollections> UpdateCakeGridColumns(List <string> collection_rows) { List <CakeRowsCollections> newCollection = new List <CakeRowsCollections>(); string last_filled_collection = string.Empty; string toform0 = string.Empty; string toform1 = string.Empty; for (int loop = 0; loop < collection_rows.Count; loop++) { string last = collection_rows[loop]; string result = string.Empty; for (int cnt = loop >= 1?loop - 1:loop; cnt < collection_rows.Count; cnt++) { string recent = collection_rows[cnt]; CakeRowsCollections rc = newCollection.Find(x => x.rowid == cnt); if (null != rc) { recent = rc.modified; } result = SuperImposeImageOnSource(last, recent); if (-1 == result.IndexOf('?')) { break; } last = result; } CakeRowsCollections cakerow1 = new CakeRowsCollections(); cakerow1.rowid = loop; cakerow1.original = collection_rows[loop];; cakerow1.modified = result; newCollection.Add(cakerow1); } return(newCollection); }