diff --git a/VisualCard.Calendar/Parts/Calendar.cs b/VisualCard.Calendar/Parts/Calendar.cs index 89b3d46..61e414e 100644 --- a/VisualCard.Calendar/Parts/Calendar.cs +++ b/VisualCard.Calendar/Parts/Calendar.cs @@ -282,8 +282,7 @@ internal string SaveToString(Version version, Dictionary(partsArrayEnum, version, partsArray); diff --git a/VisualCard/Parts/Card.cs b/VisualCard/Parts/Card.cs index c8c6305..29d6085 100644 --- a/VisualCard/Parts/Card.cs +++ b/VisualCard/Parts/Card.cs @@ -196,8 +196,7 @@ public string SaveToString() cardBuilder.AppendLine($"{VcardConstants._versionSpecifier}:{version}"); // Then, enumerate all the strings - StringsEnum[] stringEnums = (StringsEnum[])Enum.GetValues(typeof(StringsEnum)); - foreach (StringsEnum stringEnum in stringEnums) + foreach (StringsEnum stringEnum in strings.Keys) { // Get the string values var array = GetString(stringEnum); @@ -231,8 +230,7 @@ public string SaveToString() } // Then, enumerate all the arrays - PartsArrayEnum[] partsArrayEnums = (PartsArrayEnum[])Enum.GetValues(typeof(PartsArrayEnum)); - foreach (PartsArrayEnum partsArrayEnum in partsArrayEnums) + foreach (PartsArrayEnum partsArrayEnum in partsArray.Keys) { // Get the array value var array = GetPartsArray(partsArrayEnum);