using Valg.EVA.Skanning.Contracts.CommonEnums;
using Valg.EVA.Skanning.Resources.Language;

namespace Valg.EVA.Skanning.UserInterfaceElements.Counting
{
    public static class CountingDescriptionCreator
    {
        public static string GetCountingDescription(this CountingType countingType, int countingNumber, bool shortDescription = false)
        {
            string template = "{0} {1}";
            string countingFriendlyName = CountingType.Undefined.ToString(); 
            
            if (countingType == CountingType.Final)
            {
                countingFriendlyName = shortDescription ? LanguageString.CountingType_Short_Final : LanguageString.CountingType_Final;
            }
            else if (countingType == CountingType.Preliminary)
            {
                countingFriendlyName = shortDescription ? LanguageString.CountingType_Short_Preliminary : LanguageString.CountingType_Preliminary;                
            }

            return string.Format(template, countingFriendlyName, countingNumber);
        }
    }
}
