ADBaseLibrary.FormatExtensions.ToText C# (CSharp) Method

ToText() public static method

public static ToText ( this f ) : string
f this
return string
        public static string ToText(this Format f)
        {
            StringBuilder bld = new StringBuilder();
            foreach (Format ff in Enum.GetValues(typeof(Format)))
            {
                if ((ff & f) == ff)
                {
                    switch (f)
                    {
                        case Format.Mkv:
                            bld.Append("Matroska, ");
                            break;
                        case Format.Mp4:
                            bld.Append("MP4, ");
                            break;
                    }
                }
            }
            string b = bld.ToString();
            if (b.Length > 0)
            {
                b = b.Substring(0, b.Length - 2);
                return b;
            }
            return String.Empty;
        }
FormatExtensions