Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions iCalNET/Model/vEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,31 @@ public class vEvent
private const string ContentLinePattern = "(.+?):(.+?)(?=\\r\\n[A-Z]|$)";
private const RegexOptions ContentLineTRegexOptions = RegexOptions.Singleline;

public Dictionary<string, ContentLine> ContentLines { get; set; }
public Dictionary<string, List<ContentLine>> 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<string, ContentLine>();
ContentLines = new Dictionary<string, List<ContentLine>>();
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>()
{
contentLine
}
);
}
}

}
Expand Down