Amoeba.Windows.DownloadStateToStringConverter.Convert C# (CSharp) Method

Convert() public method

public Convert ( object value, Type targetType, object parameter, CultureInfo culture ) : object
value object
targetType System.Type
parameter object
culture System.Globalization.CultureInfo
return object
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var item = value as DownloadState?;
            if (item == null) return null;

            if (item.Value == DownloadState.Downloading)
            {
                return LanguagesManager.Instance.DownloadState_Downloading;
            }
            else if (item.Value == DownloadState.Decoding)
            {
                return LanguagesManager.Instance.DownloadState_Decoding;
            }
            else if (item.Value == DownloadState.ParityDecoding)
            {
                return LanguagesManager.Instance.DownloadState_ParityDecoding;
            }
            else if (item.Value == DownloadState.Completed)
            {
                return LanguagesManager.Instance.DownloadState_Completed;
            }
            else if (item.Value == DownloadState.Error)
            {
                return LanguagesManager.Instance.DownloadState_Error;
            }

            return "";
        }
DownloadStateToStringConverter