| 123456789101112131415161718192021222324252627282930313233343536373839 | using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Windows.Data;namespace Aitex.UI.RecipeEditor{    public class ErrItemDisplayConverter : IValueConverter    {        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)        {            try            {                if (value == null)                    return "";                var list1 = value as List<Tuple<int, int, string, string>>;                var list2 = new List<string>();                int no = 1;                foreach (var item in list1)                {                    list2.Add(string.Format("{0}. Step {1}, line {2}, variable name: {3}, reason: {4}", no++, item.Item2 + 1, item.Item1 + 1, item.Item3, item.Item4));                }                return list2;            }            catch (Exception ex)            {                System.Diagnostics.Debug.WriteLine(ex.Message);            }            return null;        }        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)        {            return value.ToString();        }    }}
 |