Achamenes.ID3.Frames.PartOfSetTextFrame.Validate C# (CSharp) Method

Validate() protected method

protected Validate ( string value ) : void
value string
return void
        protected override void Validate(string value)
        {
            if(value.Length<=0)
            {
                throw new InvalidFrameValueException(value,"Invalid value specified for PartOfSet frame.");
            }
            string[] parts=value.Split('/');
            if(parts.Length>2)
            {
                throw new InvalidFrameValueException(value, "Only one '/' character should be present in a PartOfSet frame.");
            }
            try
            {
                int.Parse(parts[0]);
                if(parts.Length==2)
                {
                    int.Parse(parts[1]);
                }
            }
            catch(FormatException)
            {
                throw new InvalidFrameValueException(value, "Invalid value for PartOfSet frame.");
            }
        }