Skip to content

Commit

Permalink
add - doc - Added Card.CardKind
Browse files Browse the repository at this point in the history
---

We've added the CardKind property.

---

Type: add
Breaking: False
Doc Required: True
Backport Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Sep 29, 2024
1 parent 7946c79 commit d6f8850
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 1 addition & 2 deletions VisualCard.ShowContacts/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ static void Main(string[] args)
TextWriterColor.Write("Contact URL: {0}", url[0].Url ?? "");
if (note.Length > 0)
TextWriterColor.Write("Contact Note: {0}", note[0].Note ?? "");
TextWriterColor.Write("Contact mailer: {0}", Contact.GetString(StringsEnum.Mailer));
TextWriterColor.Write("Contact UUID: {0}", Contact.UniqueId);
TextWriterColor.Write("Contact kind: {0}", Contact.CardKind);

// Print VCard
string raw = Contact.SaveToString();
Expand Down
8 changes: 7 additions & 1 deletion VisualCard/Parts/Card.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ public class Card : IEquatable<Card>
public string UniqueId =>
GetString(StringsEnum.Uid);

/// <summary>
/// Card kind
/// </summary>
public string CardKind =>
GetString(StringsEnum.Kind);

/// <summary>
/// Gets a part array from a specified key
/// </summary>
Expand Down Expand Up @@ -114,7 +120,7 @@ public BaseCardPartInfo[] GetPartsArray(Type partType, PartsArrayEnum key)
throw new InvalidOperationException($"Base type is not BaseCardPartInfo [{partType.BaseType.Name}] and the part type is [{partType.Name}] that doesn't represent card part.");

// Check for version support
if (!VcardParserTools.EnumArrayTypeSupported(key, CardVersion))
if (!VcardParserTools.EnumArrayTypeSupported(key, CardVersion, CardKind))
return [];

// Get the parts enumeration according to the type
Expand Down

0 comments on commit d6f8850

Please sign in to comment.