Example #1
0
        /// <summary>
        /// Get FileName according to specific formula
        /// </summary>
        /// <param name="Formula">Formula to make FileName</param>
        /// <returns>System.String contain FileName according to formula or String.Empty</returns>
        public string MakeFileName(string Formula)
        {
            string FileName = "";

            Formula = Formula.Replace("<", "<;");
            string ID;

            foreach (string St in Formula.Split('>', '<'))
            {
                if (St.StartsWith(";"))
                {
                    ID = St.Remove(0, 1).ToUpper();
                    if (ID.StartsWith("TRCK"))
                    {
                        string TRCK = TrackNumber;
                        if (ID.Length == 5)
                        {
                            int Digits = int.Parse(ID[4].ToString());

                            while (Digits-- > TrackNumber.Length)
                            {
                                FileName += "0";
                            }
                        }
                        FileName += TRCK;
                    }
                    else
                    {
                        FileName += GetTextFrame(ID);
                    }
                }
                else
                {
                    FileName += St;
                }
            }

            return(FileName + ".mp3");
        }