using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Windows;
using System.Windows.Media;

namespace Aitex.UI.RecipeEditor
{
    class RecipeHeadStringConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            try
            {
                if (value == null) return " (Empty)";
                var recipeHead = value as RecipeHead;
                if (recipeHead == null) return " (Empty)";
                return string.Format("Recipe Version:{0}\r\n\r\nLast Modified By:{2}\r\nLast Modified Time:{3}\r\nDescription:{1}",
                    recipeHead.RecipeVariation, recipeHead.Description, /*recipeHead.CreationTime, recipeHead.CreatedBy, */recipeHead.LastModifiedBy, recipeHead.LastRevisionTime);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.Message);
            }
            return " (Empty)";
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            return null;
        }
    }
}