using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using FLY.Thick.Base.Common;
using System.Windows;

namespace ThickTcpUiInWindow.Converter
{
    public class ControllerStateConverter:IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            CTRL_STATE state = (CTRL_STATE)value;
            switch (state)
            {
                case CTRL_STATE.FIX:
                    return Application.Current.FindResource("strCSFix");
                case CTRL_STATE.ORG:
                    return Application.Current.FindResource("strCSOrg");
                case CTRL_STATE.SCAN:
                    return Application.Current.FindResource("strCSScan");
                case CTRL_STATE.FORW:
                    return Application.Current.FindResource("strCSForw");
                case CTRL_STATE.BACKW:
                    return Application.Current.FindResource("strCSBackw");
                case CTRL_STATE.STOP:
                    return Application.Current.FindResource("strCSStop");
                case CTRL_STATE.EMGS:
                    return Application.Current.FindResource("strCSEmgs");
                case CTRL_STATE.CORR:
                    return Application.Current.FindResource("strCSCorr");
                case CTRL_STATE.GETSAMPLE:
                    return Application.Current.FindResource("strCSGetSample");
                case CTRL_STATE.RUNNING:
                    return Application.Current.FindResource("strCSRunning");
                case CTRL_STATE.DISCONNECTED:
                    return Application.Current.FindResource("strCSDisconnected");
                case CTRL_STATE.GAGEINFO:
                    return Application.Current.FindResource("strCSGageInfo");
                case CTRL_STATE.PAUSE:
                    return Application.Current.FindResource("strCSPause");
                case CTRL_STATE.AUTOSCAN:
                    return Application.Current.FindResource("strCSAutoScan");
                case CTRL_STATE.SYNC:
                    return Application.Current.FindResource("strCSSync");
                default:
                    return Application.Current.FindResource("strCSUnknown");
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
