diff --git a/iCalNET/Model/vEvent.cs b/iCalNET/Model/vEvent.cs index 12ce5d4..6fce6c5 100644 --- a/iCalNET/Model/vEvent.cs +++ b/iCalNET/Model/vEvent.cs @@ -14,19 +14,31 @@ public class vEvent private const string ContentLinePattern = "(.+?):(.+?)(?=\\r\\n[A-Z]|$)"; private const RegexOptions ContentLineTRegexOptions = RegexOptions.Singleline; - public Dictionary ContentLines { get; set; } + public Dictionary> ContentLines { get; set; } public vEvent(string source) { Match contentMatch = Regex.Match(source, vEventContentPattern, vEventContentRegexOptions); string content = contentMatch.Groups[1].ToString(); MatchCollection matches = Regex.Matches(content, ContentLinePattern, ContentLineTRegexOptions); - ContentLines = new Dictionary(); + ContentLines = new Dictionary>(); foreach (Match match in matches) { - string contentLineString = match.Groups[0].ToString(); + string contentLineString = match.Groups[0].ToString(); ContentLine contentLine = new ContentLine(contentLineString); - ContentLines[contentLine.Name] = contentLine; + if (ContentLines.ContainsKey(ContentLine.name)) + { + ContentLines[contentLine.Name].Add(contentLine); + d[i.ToString()].Add(i.ToString()); + } + else + { + ContentLines.Add(contentLine.name, new List() + { + contentLine + } + ); + } } }