Skip to content

Commit

Permalink
add - doc - Added part dictionary properties to co...
Browse files Browse the repository at this point in the history
...mponents

---

We've added a new way to list strings, integers, and parts array.

---

Type: add
Breaking: False
Doc Required: True
Backport Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Oct 8, 2024
1 parent 615f124 commit 4dae9c0
Show file tree
Hide file tree
Showing 11 changed files with 212 additions and 0 deletions.
19 changes: 19 additions & 0 deletions VisualCard.Calendar/Parts/Calendar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
Expand Down Expand Up @@ -97,6 +98,24 @@ public class Calendar : IEquatable<Calendar>
public CalendarOtherComponent[] Others =>
[.. others];

/// <summary>
/// Part array list in a dictionary (for enumeration operations)
/// </summary>
public virtual ReadOnlyDictionary<CalendarPartsArrayEnum, ReadOnlyCollection<BaseCalendarPartInfo>> PartsArray =>
new(partsArray.ToDictionary((kvp) => kvp.Key, (kvp) => kvp.Value.AsReadOnly()));

/// <summary>
/// String list in a dictionary (for enumeration operations)
/// </summary>
public virtual ReadOnlyDictionary<CalendarStringsEnum, ReadOnlyCollection<CalendarValueInfo<string>>> Strings =>
new(strings.ToDictionary((kvp) => kvp.Key, (kvp) => kvp.Value.AsReadOnly()));

/// <summary>
/// Integer list in a dictionary (for enumeration operations)
/// </summary>
public virtual ReadOnlyDictionary<CalendarIntegersEnum, ReadOnlyCollection<CalendarValueInfo<double>>> Integers =>
new(integers.ToDictionary((kvp) => kvp.Key, (kvp) => kvp.Value.AsReadOnly()));

/// <summary>
/// Gets a part array from a specified key
/// </summary>
Expand Down
20 changes: 20 additions & 0 deletions VisualCard.Calendar/Parts/CalendarAlarm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using VisualCard.Calendar.Parsers;
using VisualCard.Calendar.Parts.Comparers;
using VisualCard.Calendar.Parts.Enums;
Expand All @@ -36,6 +38,24 @@ public class CalendarAlarm : Calendar, IEquatable<CalendarAlarm>
private readonly Dictionary<CalendarStringsEnum, List<CalendarValueInfo<string>>> strings = [];
private readonly Dictionary<CalendarIntegersEnum, List<CalendarValueInfo<double>>> integers = [];

/// <summary>
/// Part array list in a dictionary (for enumeration operations)
/// </summary>
public override ReadOnlyDictionary<CalendarPartsArrayEnum, ReadOnlyCollection<BaseCalendarPartInfo>> PartsArray =>
new(partsArray.ToDictionary((kvp) => kvp.Key, (kvp) => kvp.Value.AsReadOnly()));

/// <summary>
/// String list in a dictionary (for enumeration operations)
/// </summary>
public override ReadOnlyDictionary<CalendarStringsEnum, ReadOnlyCollection<CalendarValueInfo<string>>> Strings =>
new(strings.ToDictionary((kvp) => kvp.Key, (kvp) => kvp.Value.AsReadOnly()));

/// <summary>
/// Integer list in a dictionary (for enumeration operations)
/// </summary>
public override ReadOnlyDictionary<CalendarIntegersEnum, ReadOnlyCollection<CalendarValueInfo<double>>> Integers =>
new(integers.ToDictionary((kvp) => kvp.Key, (kvp) => kvp.Value.AsReadOnly()));

/// <summary>
/// Gets a part array from a specified key
/// </summary>
Expand Down
20 changes: 20 additions & 0 deletions VisualCard.Calendar/Parts/CalendarDaylight.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using VisualCard.Calendar.Parsers;
using VisualCard.Calendar.Parts.Comparers;
using VisualCard.Calendar.Parts.Enums;
Expand All @@ -36,6 +38,24 @@ public class CalendarDaylight : Calendar, IEquatable<CalendarDaylight>
private readonly Dictionary<CalendarStringsEnum, List<CalendarValueInfo<string>>> strings = [];
private readonly Dictionary<CalendarIntegersEnum, List<CalendarValueInfo<double>>> integers = [];

/// <summary>
/// Part array list in a dictionary (for enumeration operations)
/// </summary>
public override ReadOnlyDictionary<CalendarPartsArrayEnum, ReadOnlyCollection<BaseCalendarPartInfo>> PartsArray =>
new(partsArray.ToDictionary((kvp) => kvp.Key, (kvp) => kvp.Value.AsReadOnly()));

/// <summary>
/// String list in a dictionary (for enumeration operations)
/// </summary>
public override ReadOnlyDictionary<CalendarStringsEnum, ReadOnlyCollection<CalendarValueInfo<string>>> Strings =>
new(strings.ToDictionary((kvp) => kvp.Key, (kvp) => kvp.Value.AsReadOnly()));

/// <summary>
/// Integer list in a dictionary (for enumeration operations)
/// </summary>
public override ReadOnlyDictionary<CalendarIntegersEnum, ReadOnlyCollection<CalendarValueInfo<double>>> Integers =>
new(integers.ToDictionary((kvp) => kvp.Key, (kvp) => kvp.Value.AsReadOnly()));

/// <summary>
/// Gets a part array from a specified key
/// </summary>
Expand Down
20 changes: 20 additions & 0 deletions VisualCard.Calendar/Parts/CalendarEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using VisualCard.Calendar.Parsers;
using VisualCard.Calendar.Parts.Comparers;
using VisualCard.Calendar.Parts.Enums;
Expand All @@ -37,6 +39,24 @@ public class CalendarEvent : Calendar, IEquatable<CalendarEvent>
private readonly Dictionary<CalendarStringsEnum, List<CalendarValueInfo<string>>> strings = [];
private readonly Dictionary<CalendarIntegersEnum, List<CalendarValueInfo<double>>> integers = [];

/// <summary>
/// Part array list in a dictionary (for enumeration operations)
/// </summary>
public override ReadOnlyDictionary<CalendarPartsArrayEnum, ReadOnlyCollection<BaseCalendarPartInfo>> PartsArray =>
new(partsArray.ToDictionary((kvp) => kvp.Key, (kvp) => kvp.Value.AsReadOnly()));

/// <summary>
/// String list in a dictionary (for enumeration operations)
/// </summary>
public override ReadOnlyDictionary<CalendarStringsEnum, ReadOnlyCollection<CalendarValueInfo<string>>> Strings =>
new(strings.ToDictionary((kvp) => kvp.Key, (kvp) => kvp.Value.AsReadOnly()));

/// <summary>
/// Integer list in a dictionary (for enumeration operations)
/// </summary>
public override ReadOnlyDictionary<CalendarIntegersEnum, ReadOnlyCollection<CalendarValueInfo<double>>> Integers =>
new(integers.ToDictionary((kvp) => kvp.Key, (kvp) => kvp.Value.AsReadOnly()));

/// <summary>
/// Alarm list
/// </summary>
Expand Down
20 changes: 20 additions & 0 deletions VisualCard.Calendar/Parts/CalendarFreeBusy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using VisualCard.Calendar.Parsers;
using VisualCard.Calendar.Parts.Comparers;
using VisualCard.Calendar.Parts.Enums;
Expand All @@ -36,6 +38,24 @@ public class CalendarFreeBusy : Calendar, IEquatable<CalendarFreeBusy>
private readonly Dictionary<CalendarStringsEnum, List<CalendarValueInfo<string>>> strings = [];
private readonly Dictionary<CalendarIntegersEnum, List<CalendarValueInfo<double>>> integers = [];

/// <summary>
/// Part array list in a dictionary (for enumeration operations)
/// </summary>
public override ReadOnlyDictionary<CalendarPartsArrayEnum, ReadOnlyCollection<BaseCalendarPartInfo>> PartsArray =>
new(partsArray.ToDictionary((kvp) => kvp.Key, (kvp) => kvp.Value.AsReadOnly()));

/// <summary>
/// String list in a dictionary (for enumeration operations)
/// </summary>
public override ReadOnlyDictionary<CalendarStringsEnum, ReadOnlyCollection<CalendarValueInfo<string>>> Strings =>
new(strings.ToDictionary((kvp) => kvp.Key, (kvp) => kvp.Value.AsReadOnly()));

/// <summary>
/// Integer list in a dictionary (for enumeration operations)
/// </summary>
public override ReadOnlyDictionary<CalendarIntegersEnum, ReadOnlyCollection<CalendarValueInfo<double>>> Integers =>
new(integers.ToDictionary((kvp) => kvp.Key, (kvp) => kvp.Value.AsReadOnly()));

/// <summary>
/// Gets a part array from a specified key
/// </summary>
Expand Down
20 changes: 20 additions & 0 deletions VisualCard.Calendar/Parts/CalendarJournal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using VisualCard.Calendar.Parsers;
using VisualCard.Calendar.Parts.Comparers;
using VisualCard.Calendar.Parts.Enums;
Expand All @@ -36,6 +38,24 @@ public class CalendarJournal : Calendar, IEquatable<CalendarJournal>
private readonly Dictionary<CalendarStringsEnum, List<CalendarValueInfo<string>>> strings = [];
private readonly Dictionary<CalendarIntegersEnum, List<CalendarValueInfo<double>>> integers = [];

/// <summary>
/// Part array list in a dictionary (for enumeration operations)
/// </summary>
public override ReadOnlyDictionary<CalendarPartsArrayEnum, ReadOnlyCollection<BaseCalendarPartInfo>> PartsArray =>
new(partsArray.ToDictionary((kvp) => kvp.Key, (kvp) => kvp.Value.AsReadOnly()));

/// <summary>
/// String list in a dictionary (for enumeration operations)
/// </summary>
public override ReadOnlyDictionary<CalendarStringsEnum, ReadOnlyCollection<CalendarValueInfo<string>>> Strings =>
new(strings.ToDictionary((kvp) => kvp.Key, (kvp) => kvp.Value.AsReadOnly()));

/// <summary>
/// Integer list in a dictionary (for enumeration operations)
/// </summary>
public override ReadOnlyDictionary<CalendarIntegersEnum, ReadOnlyCollection<CalendarValueInfo<double>>> Integers =>
new(integers.ToDictionary((kvp) => kvp.Key, (kvp) => kvp.Value.AsReadOnly()));

/// <summary>
/// Gets a part array from a specified key
/// </summary>
Expand Down
20 changes: 20 additions & 0 deletions VisualCard.Calendar/Parts/CalendarOtherComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using VisualCard.Calendar.Parsers;
using VisualCard.Calendar.Parts.Comparers;
using VisualCard.Calendar.Parts.Enums;
Expand All @@ -37,6 +39,24 @@ public class CalendarOtherComponent : Calendar, IEquatable<CalendarOtherComponen
private readonly Dictionary<CalendarStringsEnum, List<CalendarValueInfo<string>>> strings = [];
private readonly Dictionary<CalendarIntegersEnum, List<CalendarValueInfo<double>>> integers = [];

/// <summary>
/// Part array list in a dictionary (for enumeration operations)
/// </summary>
public override ReadOnlyDictionary<CalendarPartsArrayEnum, ReadOnlyCollection<BaseCalendarPartInfo>> PartsArray =>
new(partsArray.ToDictionary((kvp) => kvp.Key, (kvp) => kvp.Value.AsReadOnly()));

/// <summary>
/// String list in a dictionary (for enumeration operations)
/// </summary>
public override ReadOnlyDictionary<CalendarStringsEnum, ReadOnlyCollection<CalendarValueInfo<string>>> Strings =>
new(strings.ToDictionary((kvp) => kvp.Key, (kvp) => kvp.Value.AsReadOnly()));

/// <summary>
/// Integer list in a dictionary (for enumeration operations)
/// </summary>
public override ReadOnlyDictionary<CalendarIntegersEnum, ReadOnlyCollection<CalendarValueInfo<double>>> Integers =>
new(integers.ToDictionary((kvp) => kvp.Key, (kvp) => kvp.Value.AsReadOnly()));

/// <summary>
/// Component name
/// </summary>
Expand Down
20 changes: 20 additions & 0 deletions VisualCard.Calendar/Parts/CalendarStandard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using VisualCard.Calendar.Parsers;
using VisualCard.Calendar.Parts.Comparers;
using VisualCard.Calendar.Parts.Enums;
Expand All @@ -36,6 +38,24 @@ public class CalendarStandard : Calendar, IEquatable<CalendarStandard>
private readonly Dictionary<CalendarStringsEnum, List<CalendarValueInfo<string>>> strings = [];
private readonly Dictionary<CalendarIntegersEnum, List<CalendarValueInfo<double>>> integers = [];

/// <summary>
/// Part array list in a dictionary (for enumeration operations)
/// </summary>
public override ReadOnlyDictionary<CalendarPartsArrayEnum, ReadOnlyCollection<BaseCalendarPartInfo>> PartsArray =>
new(partsArray.ToDictionary((kvp) => kvp.Key, (kvp) => kvp.Value.AsReadOnly()));

/// <summary>
/// String list in a dictionary (for enumeration operations)
/// </summary>
public override ReadOnlyDictionary<CalendarStringsEnum, ReadOnlyCollection<CalendarValueInfo<string>>> Strings =>
new(strings.ToDictionary((kvp) => kvp.Key, (kvp) => kvp.Value.AsReadOnly()));

/// <summary>
/// Integer list in a dictionary (for enumeration operations)
/// </summary>
public override ReadOnlyDictionary<CalendarIntegersEnum, ReadOnlyCollection<CalendarValueInfo<double>>> Integers =>
new(integers.ToDictionary((kvp) => kvp.Key, (kvp) => kvp.Value.AsReadOnly()));

/// <summary>
/// Gets a part array from a specified key
/// </summary>
Expand Down
20 changes: 20 additions & 0 deletions VisualCard.Calendar/Parts/CalendarTimeZone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using VisualCard.Calendar.Parsers;
using VisualCard.Calendar.Parts.Comparers;
using VisualCard.Calendar.Parts.Enums;
Expand All @@ -38,6 +40,24 @@ public class CalendarTimeZone : Calendar, IEquatable<CalendarTimeZone>
private readonly Dictionary<CalendarStringsEnum, List<CalendarValueInfo<string>>> strings = [];
private readonly Dictionary<CalendarIntegersEnum, List<CalendarValueInfo<double>>> integers = [];

/// <summary>
/// Part array list in a dictionary (for enumeration operations)
/// </summary>
public override ReadOnlyDictionary<CalendarPartsArrayEnum, ReadOnlyCollection<BaseCalendarPartInfo>> PartsArray =>
new(partsArray.ToDictionary((kvp) => kvp.Key, (kvp) => kvp.Value.AsReadOnly()));

/// <summary>
/// String list in a dictionary (for enumeration operations)
/// </summary>
public override ReadOnlyDictionary<CalendarStringsEnum, ReadOnlyCollection<CalendarValueInfo<string>>> Strings =>
new(strings.ToDictionary((kvp) => kvp.Key, (kvp) => kvp.Value.AsReadOnly()));

/// <summary>
/// Integer list in a dictionary (for enumeration operations)
/// </summary>
public override ReadOnlyDictionary<CalendarIntegersEnum, ReadOnlyCollection<CalendarValueInfo<double>>> Integers =>
new(integers.ToDictionary((kvp) => kvp.Key, (kvp) => kvp.Value.AsReadOnly()));

/// <summary>
/// Standard time list
/// </summary>
Expand Down
20 changes: 20 additions & 0 deletions VisualCard.Calendar/Parts/CalendarTodo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using VisualCard.Calendar.Parsers;
using VisualCard.Calendar.Parts.Comparers;
using VisualCard.Calendar.Parts.Enums;
Expand All @@ -37,6 +39,24 @@ public class CalendarTodo : Calendar, IEquatable<CalendarTodo>
private readonly Dictionary<CalendarStringsEnum, List<CalendarValueInfo<string>>> strings = [];
private readonly Dictionary<CalendarIntegersEnum, List<CalendarValueInfo<double>>> integers = [];

/// <summary>
/// Part array list in a dictionary (for enumeration operations)
/// </summary>
public override ReadOnlyDictionary<CalendarPartsArrayEnum, ReadOnlyCollection<BaseCalendarPartInfo>> PartsArray =>
new(partsArray.ToDictionary((kvp) => kvp.Key, (kvp) => kvp.Value.AsReadOnly()));

/// <summary>
/// String list in a dictionary (for enumeration operations)
/// </summary>
public override ReadOnlyDictionary<CalendarStringsEnum, ReadOnlyCollection<CalendarValueInfo<string>>> Strings =>
new(strings.ToDictionary((kvp) => kvp.Key, (kvp) => kvp.Value.AsReadOnly()));

/// <summary>
/// Integer list in a dictionary (for enumeration operations)
/// </summary>
public override ReadOnlyDictionary<CalendarIntegersEnum, ReadOnlyCollection<CalendarValueInfo<double>>> Integers =>
new(integers.ToDictionary((kvp) => kvp.Key, (kvp) => kvp.Value.AsReadOnly()));

/// <summary>
/// Alarm list
/// </summary>
Expand Down
13 changes: 13 additions & 0 deletions VisualCard/Parts/Card.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
Expand Down Expand Up @@ -72,6 +73,18 @@ public class Card : IEquatable<Card>
public CardKind CardKind =>
VcardCommonTools.GetKindEnum(CardKindStr);

/// <summary>
/// Part array list in a dictionary (for enumeration operations)
/// </summary>
public ReadOnlyDictionary<PartsArrayEnum, ReadOnlyCollection<BaseCardPartInfo>> PartsArray =>
new(partsArray.ToDictionary((kvp) => kvp.Key, (kvp) => kvp.Value.AsReadOnly()));

/// <summary>
/// String list in a dictionary (for enumeration operations)
/// </summary>
public ReadOnlyDictionary<StringsEnum, ReadOnlyCollection<CardValueInfo<string>>> Strings =>
new(strings.ToDictionary((kvp) => kvp.Key, (kvp) => kvp.Value.AsReadOnly()));

/// <summary>
/// Gets a part array from a specified key
/// </summary>
Expand Down

0 comments on commit 4dae9c0

Please sign in to comment.