diff --git a/VisualCard.Calendar/Parts/Calendar.cs b/VisualCard.Calendar/Parts/Calendar.cs index d671fd1..d47583e 100644 --- a/VisualCard.Calendar/Parts/Calendar.cs +++ b/VisualCard.Calendar/Parts/Calendar.cs @@ -253,9 +253,9 @@ internal int GetInteger(CalendarIntegersEnum key, Version version, Dictionary public string SaveToString() => - SaveToString(version, partsArray, strings, VCalendarConstants._objectVCalendarSpecifier); + SaveToString(version, partsArray, strings, integers, VCalendarConstants._objectVCalendarSpecifier); - internal string SaveToString(Version version, Dictionary> partsArray, Dictionary strings, string objectType) + internal string SaveToString(Version version, Dictionary> partsArray, Dictionary strings, Dictionary integers, string objectType) { // Initialize the card builder var cardBuilder = new StringBuilder(); @@ -323,9 +323,37 @@ internal string SaveToString(Version version, Dictionary { private readonly Dictionary> partsArray = []; private readonly Dictionary strings = []; + private readonly Dictionary integers = []; /// /// Gets a part array from a specified key @@ -68,7 +69,7 @@ public class CalendarAlarm : Calendar, IEquatable /// Saves this parsed card to the string /// public new string SaveToString() => - SaveToString(CalendarVersion, partsArray, strings, VCalendarConstants._objectVAlarmSpecifier); + SaveToString(CalendarVersion, partsArray, strings, integers, VCalendarConstants._objectVAlarmSpecifier); /// /// Saves the contact to the returned string @@ -103,16 +104,19 @@ public bool Equals(CalendarAlarm source, CalendarAlarm target) // Check all the properties return PartComparison.PartsArrayEnumEqual(source.partsArray, target.partsArray) && - PartComparison.StringsEqual(source.strings, target.strings) + PartComparison.StringsEqual(source.strings, target.strings) && + PartComparison.IntegersEqual(source.integers, target.integers) ; } /// public override int GetHashCode() { - int hashCode = 1047895655; + int hashCode = 1333672311; + hashCode = hashCode * -1521134295 + base.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer>>.Default.GetHashCode(partsArray); hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(strings); + hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(integers); return hashCode; } @@ -130,6 +134,9 @@ public override int GetHashCode() internal new void SetString(CalendarStringsEnum key, string value) => SetString(key, value, strings); + internal new void SetInteger(CalendarIntegersEnum key, int value) => + SetInteger(key, value, integers); + internal CalendarAlarm(Version version) : base(version) { } diff --git a/VisualCard.Calendar/Parts/CalendarDaylight.cs b/VisualCard.Calendar/Parts/CalendarDaylight.cs index 1c36926..37ab283 100644 --- a/VisualCard.Calendar/Parts/CalendarDaylight.cs +++ b/VisualCard.Calendar/Parts/CalendarDaylight.cs @@ -34,6 +34,7 @@ public class CalendarDaylight : Calendar, IEquatable { private readonly Dictionary> partsArray = []; private readonly Dictionary strings = []; + private readonly Dictionary integers = []; /// /// Gets a part array from a specified key @@ -68,7 +69,7 @@ public class CalendarDaylight : Calendar, IEquatable /// Saves this parsed card to the string /// public new string SaveToString() => - SaveToString(CalendarVersion, partsArray, strings, VCalendarConstants._objectVDaylightSpecifier); + SaveToString(CalendarVersion, partsArray, strings, integers, VCalendarConstants._objectVDaylightSpecifier); /// /// Saves the contact to the returned string @@ -103,16 +104,19 @@ public bool Equals(CalendarDaylight source, CalendarDaylight target) // Check all the properties return PartComparison.PartsArrayEnumEqual(source.partsArray, target.partsArray) && - PartComparison.StringsEqual(source.strings, target.strings) + PartComparison.StringsEqual(source.strings, target.strings) && + PartComparison.IntegersEqual(source.integers, target.integers) ; } /// public override int GetHashCode() { - int hashCode = 1047895655; + int hashCode = 1333672311; + hashCode = hashCode * -1521134295 + base.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer>>.Default.GetHashCode(partsArray); hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(strings); + hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(integers); return hashCode; } @@ -130,6 +134,9 @@ public override int GetHashCode() internal new void SetString(CalendarStringsEnum key, string value) => SetString(key, value, strings); + internal new void SetInteger(CalendarIntegersEnum key, int value) => + SetInteger(key, value, integers); + internal CalendarDaylight(Version version) : base(version) { } diff --git a/VisualCard.Calendar/Parts/CalendarEvent.cs b/VisualCard.Calendar/Parts/CalendarEvent.cs index cbe0392..fa37fa1 100644 --- a/VisualCard.Calendar/Parts/CalendarEvent.cs +++ b/VisualCard.Calendar/Parts/CalendarEvent.cs @@ -35,6 +35,7 @@ public class CalendarEvent : Calendar, IEquatable internal readonly List alarms = []; private readonly Dictionary> partsArray = []; private readonly Dictionary strings = []; + private readonly Dictionary integers = []; /// /// Alarm list @@ -75,7 +76,7 @@ public class CalendarEvent : Calendar, IEquatable /// Saves this parsed card to the string /// public new string SaveToString() => - SaveToString(CalendarVersion, partsArray, strings, VCalendarConstants._objectVEventSpecifier); + SaveToString(CalendarVersion, partsArray, strings, integers, VCalendarConstants._objectVEventSpecifier); /// /// Saves the contact to the returned string @@ -110,16 +111,19 @@ public bool Equals(CalendarEvent source, CalendarEvent target) // Check all the properties return PartComparison.PartsArrayEnumEqual(source.partsArray, target.partsArray) && - PartComparison.StringsEqual(source.strings, target.strings) + PartComparison.StringsEqual(source.strings, target.strings) && + PartComparison.IntegersEqual(source.integers, target.integers) ; } /// public override int GetHashCode() { - int hashCode = 1047895655; + int hashCode = 1333672311; + hashCode = hashCode * -1521134295 + base.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer>>.Default.GetHashCode(partsArray); hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(strings); + hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(integers); return hashCode; } @@ -137,6 +141,9 @@ public override int GetHashCode() internal new void SetString(CalendarStringsEnum key, string value) => SetString(key, value, strings); + internal new void SetInteger(CalendarIntegersEnum key, int value) => + SetInteger(key, value, integers); + internal CalendarEvent(Version version) : base(version) { } diff --git a/VisualCard.Calendar/Parts/CalendarFreeBusy.cs b/VisualCard.Calendar/Parts/CalendarFreeBusy.cs index f7eb03b..3b4e8c0 100644 --- a/VisualCard.Calendar/Parts/CalendarFreeBusy.cs +++ b/VisualCard.Calendar/Parts/CalendarFreeBusy.cs @@ -34,6 +34,7 @@ public class CalendarFreeBusy : Calendar, IEquatable { private readonly Dictionary> partsArray = []; private readonly Dictionary strings = []; + private readonly Dictionary integers = []; /// /// Gets a part array from a specified key @@ -68,7 +69,7 @@ public class CalendarFreeBusy : Calendar, IEquatable /// Saves this parsed card to the string /// public new string SaveToString() => - SaveToString(CalendarVersion, partsArray, strings, VCalendarConstants._objectVFreeBusySpecifier); + SaveToString(CalendarVersion, partsArray, strings, integers, VCalendarConstants._objectVFreeBusySpecifier); /// /// Saves the contact to the returned string @@ -103,16 +104,19 @@ public bool Equals(CalendarFreeBusy source, CalendarFreeBusy target) // Check all the properties return PartComparison.PartsArrayEnumEqual(source.partsArray, target.partsArray) && - PartComparison.StringsEqual(source.strings, target.strings) + PartComparison.StringsEqual(source.strings, target.strings) && + PartComparison.IntegersEqual(source.integers, target.integers) ; } /// public override int GetHashCode() { - int hashCode = 1047895655; + int hashCode = 1333672311; + hashCode = hashCode * -1521134295 + base.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer>>.Default.GetHashCode(partsArray); hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(strings); + hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(integers); return hashCode; } @@ -130,6 +134,9 @@ public override int GetHashCode() internal new void SetString(CalendarStringsEnum key, string value) => SetString(key, value, strings); + internal new void SetInteger(CalendarIntegersEnum key, int value) => + SetInteger(key, value, integers); + internal CalendarFreeBusy(Version version) : base(version) { } diff --git a/VisualCard.Calendar/Parts/CalendarJournal.cs b/VisualCard.Calendar/Parts/CalendarJournal.cs index b4a649e..82cb8c1 100644 --- a/VisualCard.Calendar/Parts/CalendarJournal.cs +++ b/VisualCard.Calendar/Parts/CalendarJournal.cs @@ -34,6 +34,7 @@ public class CalendarJournal : Calendar, IEquatable { private readonly Dictionary> partsArray = []; private readonly Dictionary strings = []; + private readonly Dictionary integers = []; /// /// Gets a part array from a specified key @@ -68,7 +69,7 @@ public class CalendarJournal : Calendar, IEquatable /// Saves this parsed card to the string /// public new string SaveToString() => - SaveToString(CalendarVersion, partsArray, strings, VCalendarConstants._objectVJournalSpecifier); + SaveToString(CalendarVersion, partsArray, strings, integers, VCalendarConstants._objectVJournalSpecifier); /// /// Saves the contact to the returned string @@ -103,16 +104,19 @@ public bool Equals(CalendarJournal source, CalendarJournal target) // Check all the properties return PartComparison.PartsArrayEnumEqual(source.partsArray, target.partsArray) && - PartComparison.StringsEqual(source.strings, target.strings) + PartComparison.StringsEqual(source.strings, target.strings) && + PartComparison.IntegersEqual(source.integers, target.integers) ; } /// public override int GetHashCode() { - int hashCode = 1047895655; + int hashCode = 1333672311; + hashCode = hashCode * -1521134295 + base.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer>>.Default.GetHashCode(partsArray); hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(strings); + hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(integers); return hashCode; } @@ -130,6 +134,9 @@ public override int GetHashCode() internal new void SetString(CalendarStringsEnum key, string value) => SetString(key, value, strings); + internal new void SetInteger(CalendarIntegersEnum key, int value) => + SetInteger(key, value, integers); + internal CalendarJournal(Version version) : base(version) { } diff --git a/VisualCard.Calendar/Parts/CalendarStandard.cs b/VisualCard.Calendar/Parts/CalendarStandard.cs index ebea41a..162ecb4 100644 --- a/VisualCard.Calendar/Parts/CalendarStandard.cs +++ b/VisualCard.Calendar/Parts/CalendarStandard.cs @@ -34,6 +34,7 @@ public class CalendarStandard : Calendar, IEquatable { private readonly Dictionary> partsArray = []; private readonly Dictionary strings = []; + private readonly Dictionary integers = []; /// /// Gets a part array from a specified key @@ -68,7 +69,7 @@ public class CalendarStandard : Calendar, IEquatable /// Saves this parsed card to the string /// public new string SaveToString() => - SaveToString(CalendarVersion, partsArray, strings, VCalendarConstants._objectVStandardSpecifier); + SaveToString(CalendarVersion, partsArray, strings, integers, VCalendarConstants._objectVStandardSpecifier); /// /// Saves the contact to the returned string @@ -103,16 +104,19 @@ public bool Equals(CalendarStandard source, CalendarStandard target) // Check all the properties return PartComparison.PartsArrayEnumEqual(source.partsArray, target.partsArray) && - PartComparison.StringsEqual(source.strings, target.strings) + PartComparison.StringsEqual(source.strings, target.strings) && + PartComparison.IntegersEqual(source.integers, target.integers) ; } /// public override int GetHashCode() { - int hashCode = 1047895655; + int hashCode = 1333672311; + hashCode = hashCode * -1521134295 + base.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer>>.Default.GetHashCode(partsArray); hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(strings); + hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(integers); return hashCode; } @@ -130,6 +134,9 @@ public override int GetHashCode() internal new void SetString(CalendarStringsEnum key, string value) => SetString(key, value, strings); + internal new void SetInteger(CalendarIntegersEnum key, int value) => + SetInteger(key, value, integers); + internal CalendarStandard(Version version) : base(version) { } diff --git a/VisualCard.Calendar/Parts/CalendarTimeZone.cs b/VisualCard.Calendar/Parts/CalendarTimeZone.cs index da951bc..263ced6 100644 --- a/VisualCard.Calendar/Parts/CalendarTimeZone.cs +++ b/VisualCard.Calendar/Parts/CalendarTimeZone.cs @@ -36,6 +36,7 @@ public class CalendarTimeZone : Calendar, IEquatable internal readonly List daylights = []; private readonly Dictionary> partsArray = []; private readonly Dictionary strings = []; + private readonly Dictionary integers = []; /// /// Standard time list @@ -82,7 +83,7 @@ public class CalendarTimeZone : Calendar, IEquatable /// Saves this parsed card to the string /// public new string SaveToString() => - SaveToString(CalendarVersion, partsArray, strings, VCalendarConstants._objectVTimeZoneSpecifier); + SaveToString(CalendarVersion, partsArray, strings, integers, VCalendarConstants._objectVTimeZoneSpecifier); /// /// Saves the contact to the returned string @@ -117,16 +118,19 @@ public bool Equals(CalendarTimeZone source, CalendarTimeZone target) // Check all the properties return PartComparison.PartsArrayEnumEqual(source.partsArray, target.partsArray) && - PartComparison.StringsEqual(source.strings, target.strings) + PartComparison.StringsEqual(source.strings, target.strings) && + PartComparison.IntegersEqual(source.integers, target.integers) ; } /// public override int GetHashCode() { - int hashCode = 1047895655; + int hashCode = 1333672311; + hashCode = hashCode * -1521134295 + base.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer>>.Default.GetHashCode(partsArray); hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(strings); + hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(integers); return hashCode; } @@ -144,6 +148,9 @@ public override int GetHashCode() internal new void SetString(CalendarStringsEnum key, string value) => SetString(key, value, strings); + internal new void SetInteger(CalendarIntegersEnum key, int value) => + SetInteger(key, value, integers); + internal CalendarTimeZone(Version version) : base(version) { } diff --git a/VisualCard.Calendar/Parts/CalendarTodo.cs b/VisualCard.Calendar/Parts/CalendarTodo.cs index f2facb5..85a7a54 100644 --- a/VisualCard.Calendar/Parts/CalendarTodo.cs +++ b/VisualCard.Calendar/Parts/CalendarTodo.cs @@ -35,6 +35,7 @@ public class CalendarTodo : Calendar, IEquatable internal readonly List alarms = []; private readonly Dictionary> partsArray = []; private readonly Dictionary strings = []; + private readonly Dictionary integers = []; /// /// Alarm list @@ -75,7 +76,7 @@ public class CalendarTodo : Calendar, IEquatable /// Saves this parsed card to the string /// public new string SaveToString() => - SaveToString(CalendarVersion, partsArray, strings, VCalendarConstants._objectVTodoSpecifier); + SaveToString(CalendarVersion, partsArray, strings, integers, VCalendarConstants._objectVTodoSpecifier); /// /// Saves the contact to the returned string @@ -110,16 +111,19 @@ public bool Equals(CalendarTodo source, CalendarTodo target) // Check all the properties return PartComparison.PartsArrayEnumEqual(source.partsArray, target.partsArray) && - PartComparison.StringsEqual(source.strings, target.strings) + PartComparison.StringsEqual(source.strings, target.strings) && + PartComparison.IntegersEqual(source.integers, target.integers) ; } /// public override int GetHashCode() { - int hashCode = 1047895655; + int hashCode = 1333672311; + hashCode = hashCode * -1521134295 + base.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer>>.Default.GetHashCode(partsArray); hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(strings); + hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(integers); return hashCode; } @@ -137,6 +141,9 @@ public override int GetHashCode() internal new void SetString(CalendarStringsEnum key, string value) => SetString(key, value, strings); + internal new void SetInteger(CalendarIntegersEnum key, int value) => + SetInteger(key, value, integers); + internal CalendarTodo(Version version) : base(version) { }