public override void Load(string str) { this.commands = new List <MMLCommand>(); MatchCollection matches = Regex.Matches(str.Replace("\n", "").Replace("\r", ""), this.mmlPatterns); for (int i = 0; i < matches.Count; i++) { this.commands.Add(MMLCommand.Parse(matches[i].Value)); } this.CalculateDuration(); this.SetDefaultValues(); }
public override void Load(string str) { //if (str.Length > settings.MaxSize) { // throw new SongSizeException("Song exceeded maximum length of " + settings.MaxSize); //} commands = new List <MMLCommand>(); string code = str.Replace("\n", "").Replace("\r", ""); MatchCollection matches = Regex.Matches(code, mmlPatterns); for (int i = 0; i < matches.Count; ++i) { commands.Add(MMLCommand.Parse(matches[i].Value)); } CalculateDuration(); SetDefaultValues(); }