//method preparing default recomendations public static List<Recomendation> SetToDefault() { //string path = HttpContext.Current.Server.MapPath("~/v4/docs/Aldunin_dimensions_clasters.xls"); string[] allStrings = File.ReadAllLines(HttpContext.Current.Server.MapPath("~/docs/default_en.txt"), Encoding.Default); //string[] allStrings = File.ReadAllLines(@"\\docs\\default_ru.txt", Encoding.Default); List<Recomendation> l = new List<Recomendation>(); for (int i = 0; i < numberOfUIfeatures * numberOfDimensions * numberOfLevels; i += 3 * numberOfUIfeatures + 1) { int k = i; Recomendation s = new Recomendation(allStrings[k++], allStrings[k++], allStrings[k++], allStrings[k++], allStrings[k++], allStrings[k++], allStrings[k++], allStrings[k++], allStrings[k++], allStrings[k++]); l.Add(s); for (int j = 0; j < numberOfLevels - 1; j++) { k++; s = new Recomendation(allStrings[i], allStrings[k++], allStrings[k++], allStrings[k++], allStrings[k++], allStrings[k++], allStrings[k++], allStrings[k++], allStrings[k++], allStrings[k++]); l.Add(s); } } return l; }
public static List<Recomendation> SetToDefault() { string[] allStrings = File.ReadAllLines("default_ru.txt", Encoding.Default); List<Recomendation> l = new List<Recomendation>(); for (int i = 0; i < numberOfUIfeatures * numberOfDimensions * numberOfLevels; i += 3 * numberOfUIfeatures + 1) { int k = i; Recomendation s = new Recomendation(allStrings[k++], allStrings[k++], allStrings[k++], allStrings[k++], allStrings[k++], allStrings[k++], allStrings[k++], allStrings[k++], allStrings[k++], allStrings[k++]); l.Add(s); for (int j = 0; j < numberOfLevels - 1; j++) { k++; s = new Recomendation(allStrings[i], allStrings[k++], allStrings[k++], allStrings[k++], allStrings[k++], allStrings[k++], allStrings[k++], allStrings[k++], allStrings[k++], allStrings[k++]); l.Add(s); } } return l; }