Esempio n. 1
0
 private static IEnumerable<string> Formatiere(Zeile header, IEnumerable<Zeile> daten, int[] fieldWidth, int seitennummer, int seitenanzahl) {
     yield return "No.|" + string.Join("|", header.Values.Select((x, i) => Format(fieldWidth, i, x))) + "|";
     yield return "---+" +string.Join("+", fieldWidth.Select(w => new string('-', w))) + "+";
     foreach (var zeile in daten) {
         yield return string.Format("{0,-3}", zeile.No + ".") + "|" + string.Join("|", zeile.Values.Select((x, i) => Format(fieldWidth, i, x))) + "|";
     }
     yield return string.Format("Page {0} of {1}", seitennummer, seitenanzahl);
     yield return "";
     yield return "N(ext page, P(revious page, F(irst page, L(ast page, J(ump to page, eX(it";
 }
Esempio n. 2
0
 public void Setzen(Tuple<Zeile, IEnumerable<Zeile>> message) {
     header = message.Item1;
     daten = message.Item2;
 }
Esempio n. 3
0
 internal static IEnumerable<int> FeldBreiten(Zeile header, IEnumerable<Zeile> daten) {
     for (var i = 0; i < header.Values.Count(); i++) {
         var index = i;
         yield return daten.Select(x => x.Values.ElementAt(index)).Union(new []{header.Values.ElementAt(index)}).Max(x => x.Length);
     }
 }
Esempio n. 4
0
        public void Process(Tuple<string, IEnumerable<string>> message) {
            var header = new Zeile {Values = message.Item1.Split(';')};
            var data = message.Item2.Select((line, i) => new Zeile {Values = line.Split(';'), No = i + 1});

            Result(new Tuple<Zeile, IEnumerable<Zeile>>(header, data));
        }