Skip to content

Commit

Permalink
imp - Take out built-in types
Browse files Browse the repository at this point in the history
---

We've taken out built-in types for the calendar parser because it doesn't have "PREF", "HOME", and "WORK".

---

Type: imp
Breaking: False
Doc Required: False
Backport Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Sep 10, 2024
1 parent 19b8be1 commit 7cd639c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions VisualCard.Calendar/Parsers/VCalendarParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ public Parts.Calendar Parse()
// Iterate through all the lines
bool constructing = false;
StringBuilder valueBuilder = new();
string[] allowedTypes = ["HOME", "WORK", "PREF"];
List<(string, Parts.Calendar)> begins = [];
for (int i = 0; i < CalendarContent.Length; i++)
{
Expand Down Expand Up @@ -164,8 +163,8 @@ public Parts.Calendar Parse()
foreach (string elementType in elementTypes)
{
string elementTypeUpper = elementType.ToUpper();
if (!allowedTypes.Contains(elementTypeUpper) && !extraAllowedTypes.Contains(elementTypeUpper) && !elementTypeUpper.StartsWith("X-"))
throw new InvalidDataException($"Part info type {classType?.Name ?? "<null>"} doesn't support property type {elementTypeUpper} because the following base types are supported: [{string.Join(", ", allowedTypes)}] and the extra types are supported: [{string.Join(", ", extraAllowedTypes)}]");
if (!extraAllowedTypes.Contains(elementTypeUpper) && !elementTypeUpper.StartsWith("X-"))
throw new InvalidDataException($"Part info type {classType?.Name ?? "<null>"} doesn't support property type {elementTypeUpper} because the following types are supported: [{string.Join(", ", extraAllowedTypes)}]");
}

// Handle the part type
Expand Down

0 comments on commit 7cd639c

Please sign in to comment.