From d6f88503f160e243ac9bf6b4791d968aff3b9a3c Mon Sep 17 00:00:00 2001 From: Aptivi CEO Date: Sun, 29 Sep 2024 18:55:22 +0300 Subject: [PATCH] add - doc - Added Card.CardKind --- We've added the CardKind property. --- Type: add Breaking: False Doc Required: True Backport Required: False Part: 1/1 --- VisualCard.ShowContacts/Program.cs | 3 +-- VisualCard/Parts/Card.cs | 8 +++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/VisualCard.ShowContacts/Program.cs b/VisualCard.ShowContacts/Program.cs index 7c4e1c06..29c6db45 100644 --- a/VisualCard.ShowContacts/Program.cs +++ b/VisualCard.ShowContacts/Program.cs @@ -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(); diff --git a/VisualCard/Parts/Card.cs b/VisualCard/Parts/Card.cs index 9c3244ba..658bdf0f 100644 --- a/VisualCard/Parts/Card.cs +++ b/VisualCard/Parts/Card.cs @@ -60,6 +60,12 @@ public class Card : IEquatable public string UniqueId => GetString(StringsEnum.Uid); + /// + /// Card kind + /// + public string CardKind => + GetString(StringsEnum.Kind); + /// /// Gets a part array from a specified key /// @@ -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