From 7cd639c330e5079c22d73340101a98cda1e91ced Mon Sep 17 00:00:00 2001 From: Aptivi Date: Tue, 10 Sep 2024 15:04:11 +0300 Subject: [PATCH] imp - Take out built-in types --- 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 --- VisualCard.Calendar/Parsers/VCalendarParser.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/VisualCard.Calendar/Parsers/VCalendarParser.cs b/VisualCard.Calendar/Parsers/VCalendarParser.cs index ead5ebf..06e1a29 100644 --- a/VisualCard.Calendar/Parsers/VCalendarParser.cs +++ b/VisualCard.Calendar/Parsers/VCalendarParser.cs @@ -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++) { @@ -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 ?? ""} 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 ?? ""} doesn't support property type {elementTypeUpper} because the following types are supported: [{string.Join(", ", extraAllowedTypes)}]"); } // Handle the part type