Achamenes.ID3.Frames.TrackTextFrame.Validate C# (CSharp) Метод

Validate() защищенный Метод

Parses the given string value and throws exceptions if it is an invalid text value for a track frame.
protected Validate ( string value ) : void
value string
Результат void
        protected override void Validate(string value)
        {
            if(value.Length<=0)
            {
                throw new InvalidFrameValueException(value,"Invalid value specified for Track frame.");
            }
            string []parts=value.Split('/');
            if(parts.Length>2)
            {
                throw new InvalidFrameValueException(value,"Only one '/' character should be present in a Track frame.");
            }
            try
            {
                int.Parse(parts[0]);
                if(parts.Length==2)
                {
                    int.Parse(parts[1]);
                }
            }
            catch(FormatException)
            {
                throw new InvalidFrameValueException(value,"Invalid value for Track frame.");
            }
        }