diff --git a/VisualCard.Extras/Misc/CardGenerator.cs b/VisualCard.Extras/Misc/CardGenerator.cs index 6531fa8a..a61572cd 100644 --- a/VisualCard.Extras/Misc/CardGenerator.cs +++ b/VisualCard.Extras/Misc/CardGenerator.cs @@ -113,12 +113,12 @@ public static Card[] GenerateCards(int cards, string namePrefix = "", string nam // Now, convert generated parts to actual VisualCard parts var card = new Card(new(2, 1)); - card.AddPartToArray(PartsArrayEnum.Names, new NameInfo(0, [], [], "", firstName, lastName, [], [], [])); - card.AddPartToArray(PartsArrayEnum.FullName, new FullNameInfo(0, [], [], "", $"{firstName} {lastName}")); + card.AddPartToArray(PartsArrayEnum.Names, new NameInfo(0, [], [], "", "", firstName, lastName, [], [], [])); + card.AddPartToArray(PartsArrayEnum.FullName, new FullNameInfo(0, [], [], "", "", $"{firstName} {lastName}")); foreach (var telephone in telephones) - card.AddPartToArray(PartsArrayEnum.Telephones, new TelephoneInfo(0, [], [telephone.Key], "", telephone.Value)); + card.AddPartToArray(PartsArrayEnum.Telephones, new TelephoneInfo(0, [], [telephone.Key], "", "", telephone.Value)); foreach (var email in emails) - card.AddPartToArray(PartsArrayEnum.Mails, new EmailInfo(0, [], [email.Key], "", email.Value)); + card.AddPartToArray(PartsArrayEnum.Mails, new EmailInfo(0, [], [email.Key], "", "", email.Value)); string cardString = card.ToString(); // Verify the generated card and add it to the list of cards diff --git a/VisualCard.ShowContacts/Program.cs b/VisualCard.ShowContacts/Program.cs index 6fd1266c..2562b92a 100644 --- a/VisualCard.ShowContacts/Program.cs +++ b/VisualCard.ShowContacts/Program.cs @@ -93,71 +93,71 @@ static void Main(string[] args) // List names foreach (var fullName in Contact.GetPartsArray()) { - TextWriterColor.Write("Name: {0}", fullName.FullName ?? ""); - TextWriterColor.Write("ALTID: {0}", fullName.AltId); + TextWriterColor.Write("Name: {0} [G: {1}]", fullName.FullName ?? "", fullName.Group); + TextWriterColor.Write("ALTID: {0} [G: {1}]", fullName.AltId, fullName.Group); } // List names foreach (var name in Contact.GetPartsArray()) { - TextWriterColor.Write("First name: {0}", name.ContactFirstName ?? ""); - TextWriterColor.Write("Last name: {0}", name.ContactLastName ?? ""); - TextWriterColor.Write("ALTID: {0}", name.AltId); + TextWriterColor.Write("First name: {0} [G: {1}]", name.ContactFirstName ?? "", name.Group); + TextWriterColor.Write("Last name: {0} [G: {1}]", name.ContactLastName ?? "", name.Group); + TextWriterColor.Write("ALTID: {0} [G: {1}]", name.AltId, name.Group); } // List titles foreach (var title in Contact.GetPartsArray()) { - TextWriterColor.Write("Title or Job: {0}", title.ContactTitle ?? ""); - TextWriterColor.Write("ALTID: {0}", title.AltId); + TextWriterColor.Write("Title or Job: {0} [G: {1}]", title.ContactTitle ?? "", title.Group); + TextWriterColor.Write("ALTID: {0} [G: {1}]", title.AltId, title.Group); } // List addresses foreach (var Address in Contact.GetPartsArray()) { - TextWriterColor.Write("P.O. Box: {0}", Address.PostOfficeBox ?? ""); - TextWriterColor.Write("Extended Address: {0}", Address.ExtendedAddress ?? ""); - TextWriterColor.Write("Street Address: {0}", Address.StreetAddress ?? ""); - TextWriterColor.Write("Region: {0}", Address.Region ?? ""); - TextWriterColor.Write("Locality: {0}", Address.Locality ?? ""); - TextWriterColor.Write("Postal Code: {0}", Address.PostalCode ?? ""); - TextWriterColor.Write("Country: {0}", Address.Country ?? ""); + TextWriterColor.Write("P.O. Box: {0} [G: {1}]", Address.PostOfficeBox ?? "", Address.Group); + TextWriterColor.Write("Extended Address: {0} [G: {1}]", Address.ExtendedAddress ?? "", Address.Group); + TextWriterColor.Write("Street Address: {0} [G: {1}]", Address.StreetAddress ?? "", Address.Group); + TextWriterColor.Write("Region: {0} [G: {1}]", Address.Region ?? "", Address.Group); + TextWriterColor.Write("Locality: {0} [G: {1}]", Address.Locality ?? "", Address.Group); + TextWriterColor.Write("Postal Code: {0} [G: {1}]", Address.PostalCode ?? "", Address.Group); + TextWriterColor.Write("Country: {0} [G: {1}]", Address.Country ?? "", Address.Group); } // List e-mails foreach (var Email in Contact.GetPartsArray()) { - TextWriterColor.Write("Email address: {0}", Email.ContactEmailAddress ?? ""); + TextWriterColor.Write("Email address: {0} [G: {1}]", Email.ContactEmailAddress ?? "", Email.Group); } // List organizations foreach (var Organization in Contact.GetPartsArray()) { - TextWriterColor.Write("Organization Name: {0}", Organization.Name ?? ""); - TextWriterColor.Write("Organization Unit: {0}", Organization.Unit ?? ""); - TextWriterColor.Write("Organization Unit Role: {0}", Organization.Role ?? ""); + TextWriterColor.Write("Organization Name: {0} [G: {1}]", Organization.Name ?? "", Organization.Group); + TextWriterColor.Write("Organization Unit: {0} [G: {1}]", Organization.Unit ?? "", Organization.Group); + TextWriterColor.Write("Organization Unit Role: {0} [G: {1}]", Organization.Role ?? "", Organization.Group); } // List telephones foreach (var Telephone in Contact.GetPartsArray()) { - TextWriterColor.Write("Phone number: {0}", Telephone.ContactPhoneNumber ?? ""); + TextWriterColor.Write("Phone number: {0} [G: {1}]", Telephone.ContactPhoneNumber ?? "", Telephone.Group); } // List photos foreach (var Photo in Contact.GetPartsArray()) { - TextWriterColor.Write("Photo encoding: {0}", Photo.Encoding ?? ""); - TextWriterColor.Write("Photo value type: {0}", string.Join(",", Photo.ElementTypes)); - TextWriterColor.Write("ALTID: {0}", Photo.AltId); - TextWriterColor.Write("Photo data [blob: {0}]: \n{1}", true, Photo.IsBlob, Photo.PhotoEncoded ?? ""); + TextWriterColor.Write("Photo encoding: {0} [G: {1}]", Photo.Encoding ?? "", Photo.Group); + TextWriterColor.Write("Photo value type: {0} [G: {1}]", string.Join(",", Photo.ElementTypes), Photo.Group); + TextWriterColor.Write("ALTID: {0} [G: {1}]", Photo.AltId, Photo.Group); + TextWriterColor.Write("Photo data [blob: {0}, group: {1}]: \n{2}", true, Photo.IsBlob, Photo.Group, Photo.PhotoEncoded ?? ""); } // List roles foreach (var Role in Contact.GetPartsArray()) { - TextWriterColor.Write("Role: {0}", Role.ContactRole ?? ""); - TextWriterColor.Write("ALTID: {0}", Role.AltId); + TextWriterColor.Write("Role: {0} [G: {1}]", Role.ContactRole ?? "", Role.Group); + TextWriterColor.Write("ALTID: {0} [G: {1}]", Role.AltId, Role.Group); } // List remaining @@ -167,15 +167,15 @@ static void Main(string[] args) var url = Contact.GetPartsArray(); var note = Contact.GetPartsArray(); if (birth.Length > 0) - TextWriterColor.Write("Contact birthdate: {0}", birth[0].BirthDate); + TextWriterColor.Write("Contact birthdate: {0} [G: {1}]", birth[0].BirthDate, birth[0].Group); if (wedding.Length > 0) - TextWriterColor.Write("Contact wedding date: {0}", wedding[0].Anniversary); + TextWriterColor.Write("Contact wedding date: {0} [G: {1}]", wedding[0].Anniversary, wedding[0].Group); if (gender.Length > 0) - TextWriterColor.Write("Contact gender {0} [{1}]", gender[0].Gender.ToString(), gender[0].GenderDescription ?? ""); + TextWriterColor.Write("Contact gender {0} [{1}] [G: {2}]", gender[0].Gender.ToString(), gender[0].GenderDescription ?? "", gender[0].Group); if (url.Length > 0) - TextWriterColor.Write("Contact URL: {0}", url[0].Url ?? ""); + TextWriterColor.Write("Contact URL: {0} [G: {1}]", url[0].Url ?? "", url[0].Group); if (note.Length > 0) - TextWriterColor.Write("Contact Note: {0}", note[0].Note ?? ""); + TextWriterColor.Write("Contact Note: {0} [G: {1}]", note[0].Note ?? "", note[0].Group); TextWriterColor.Write("Card kind: {0}", Contact.CardKind); // Print VCard diff --git a/VisualCard.ShowContacts/Properties/launchSettings.json b/VisualCard.ShowContacts/Properties/launchSettings.json index bb27c7cd..b514a6b1 100644 --- a/VisualCard.ShowContacts/Properties/launchSettings.json +++ b/VisualCard.ShowContacts/Properties/launchSettings.json @@ -16,6 +16,10 @@ "commandName": "Project", "commandLineArgs": "TestFiles/fourVCard4.vcf" }, + "vCard 4.0 test (Property grouping)": { + "commandName": "Project", + "commandLineArgs": "TestFiles/VCard4GroupProps.vcf" + }, "vCard 5.0 test": { "commandName": "Project", "commandLineArgs": "TestFiles/fourVCard5.vcf" @@ -37,4 +41,4 @@ "commandLineArgs": "TestFiles/fourVCard5NestedAgents.vcf" } } -} \ No newline at end of file +} diff --git a/VisualCard.ShowContacts/TestFiles/VCard4GroupProps.vcf b/VisualCard.ShowContacts/TestFiles/VCard4GroupProps.vcf new file mode 100644 index 00000000..60d8f3e6 --- /dev/null +++ b/VisualCard.ShowContacts/TestFiles/VCard4GroupProps.vcf @@ -0,0 +1,18 @@ +BEGIN:VCARD +VERSION:4.0 +UID:urn:uuid:136c1090-d7d3-4399-9f59-8f7a7b6e2ef1 +ADR;TYPE=home:;;New York\, USA;;;; +A.EMAIL;TYPE=HOME:sarah.s@gmail.com +B.EMAIL;TYPE=WORK:sarah.s@sso.org +FN:Sarah Santos +N:Santos;Sarah;;; +ORG:Support Scammer Outcry Organization +A.TEL;TYPE=cell:589-210-1059 +B.TEL;TYPE=cell:589-210-1058 +TITLE:Chief Executive Officer +URL:https://sso.org/ +X-SIP-SIP:sip test +ANNIVERSARY:20230406 +GENDER:F;grrrl +DRESSCODE:CASUAL +END:VCARD diff --git a/VisualCard/Parsers/VcardParser.cs b/VisualCard/Parsers/VcardParser.cs index 1307b465..423f95e3 100644 --- a/VisualCard/Parsers/VcardParser.cs +++ b/VisualCard/Parsers/VcardParser.cs @@ -111,6 +111,10 @@ public Card Parse() List finalArgs = []; int altId = -1; + // Extract the group name + string group = prefix.Contains(".") ? prefix.Substring(0, prefix.IndexOf(".")) : ""; + prefix = prefix.RemovePrefix($"{group}."); + // Get the part type bool xNonstandard = prefix.StartsWith(VcardConstants._xSpecifier); bool specifierRequired = CardVersion.Major >= 3; @@ -191,7 +195,7 @@ public Card Parse() } // Set the string for real - card.SetString(stringType, finalValue); + card.SetString(stringType, finalValue, group); } break; case PartType.PartsArray: @@ -206,7 +210,7 @@ public Card Parse() // Now, get the part info string finalValue = partsArrayType is PartsArrayEnum.NonstandardNames or PartsArrayEnum.IanaNames ? _value : value; - var partInfo = fromString(finalValue, [.. finalArgs], altId, elementTypes, values, CardVersion); + var partInfo = fromString(finalValue, [.. finalArgs], altId, elementTypes, group, values, CardVersion); // Set the array for real card.AddPartToArray(partsArrayType, partInfo); @@ -261,7 +265,7 @@ private bool ValidateComponent(ref string[] expectedFields, out stri { case PartType.Strings: { - string value = component.GetString((StringsEnum)enumeration); + string value = component.GetString((StringsEnum)enumeration).value; bool exists = !string.IsNullOrEmpty(value); if (exists) actualFieldList.Add(expectedFieldName); diff --git a/VisualCard/Parsers/VcardParserTools.cs b/VisualCard/Parsers/VcardParserTools.cs index 234d042f..4305bb1c 100644 --- a/VisualCard/Parsers/VcardParserTools.cs +++ b/VisualCard/Parsers/VcardParserTools.cs @@ -203,7 +203,7 @@ internal static (PartsArrayEnum, PartCardinality) GetPartsArrayEnumFromType(Type return (PartsArrayEnum.IanaNames, PartCardinality.Any); } - internal static (PartType type, object enumeration, Type? enumType, Func? fromStringFunc, string defaultType, string defaultValue, string[] allowedExtraTypes) GetPartType(string prefix) => + internal static (PartType type, object enumeration, Type? enumType, Func? fromStringFunc, string defaultType, string defaultValue, string[] allowedExtraTypes) GetPartType(string prefix) => prefix switch { VcardConstants._nameSpecifier => (PartType.PartsArray, PartsArrayEnum.Names, typeof(NameInfo), NameInfo.FromStringVcardStatic, "", "", []), diff --git a/VisualCard/Parts/BaseCardPartInfo.cs b/VisualCard/Parts/BaseCardPartInfo.cs index 3dfa18e9..4dbf45f6 100644 --- a/VisualCard/Parts/BaseCardPartInfo.cs +++ b/VisualCard/Parts/BaseCardPartInfo.cs @@ -52,6 +52,11 @@ public abstract class BaseCardPartInfo : IEquatable /// public virtual string ValueType { get; internal set; } = ""; + /// + /// Property group + /// + public virtual string Group { get; internal set; } = ""; + /// /// Is this part preferred? /// @@ -125,6 +130,7 @@ public bool Equals(BaseCardPartInfo source, BaseCardPartInfo target) source.ElementTypes.SequenceEqual(target.ElementTypes) && source.AltId == target.AltId && source.ValueType == target.ValueType && + source.Group == target.Group && EqualsInternal(source, target) ; } @@ -136,11 +142,12 @@ public override bool Equals(object obj) => /// public override int GetHashCode() { - int hashCode = 936749766; + int hashCode = 975087586; hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(Arguments); hashCode = hashCode * -1521134295 + AltId.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(ElementTypes); hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(ValueType); + hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(Group); return hashCode; } @@ -155,19 +162,20 @@ public override int GetHashCode() internal virtual bool EqualsInternal(BaseCardPartInfo source, BaseCardPartInfo target) => true; - internal abstract BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion); + internal abstract BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion); internal abstract string ToStringVcardInternal(Version cardVersion); internal BaseCardPartInfo() { } - internal BaseCardPartInfo(string[] arguments, int altId, string[] elementTypes, string valueType) + internal BaseCardPartInfo(string[] arguments, int altId, string[] elementTypes, string valueType, string group) { Arguments = arguments; AltId = altId; ElementTypes = elementTypes; ValueType = valueType; + Group = group; } } } diff --git a/VisualCard/Parts/Card.cs b/VisualCard/Parts/Card.cs index e32650db..5f615c68 100644 --- a/VisualCard/Parts/Card.cs +++ b/VisualCard/Parts/Card.cs @@ -40,7 +40,7 @@ public class Card : IEquatable internal Card[] nestedCards = []; private readonly Version version; private readonly Dictionary> partsArray = []; - private readonly Dictionary strings = []; + private readonly Dictionary strings = []; /// /// The VCard version @@ -58,13 +58,13 @@ public class Card : IEquatable /// Unique ID for this card /// public string UniqueId => - GetString(StringsEnum.Uid); + GetString(StringsEnum.Uid).value; /// /// Card kind /// public string CardKind => - GetString(StringsEnum.Kind); + GetString(StringsEnum.Kind).value; /// /// Gets a part array from a specified key @@ -152,24 +152,24 @@ public BaseCardPartInfo[] GetPartsArray(Type partType, PartsArrayEnum key) /// Gets a string from a specified key /// /// A key to use - /// A value, or "individual" if the kind doesn't exist, or an empty string ("") if any other type either doesn't exist or the type is not supported by the card version - public string GetString(StringsEnum key) + /// A tuple that stores a group and a value, or "individual" if the kind doesn't exist, or an empty string ("") if any other type either doesn't exist or the type is not supported by the card version + public (string group, string value) GetString(StringsEnum key) { // Check for version support if (!VcardCommonTools.StringSupported(key, CardVersion)) - return ""; + return ("", ""); // Get the fallback value string fallback = key == StringsEnum.Kind ? "individual" : ""; // Check to see if the string has a value or not - bool hasValue = strings.TryGetValue(key, out string value); + bool hasValue = strings.TryGetValue(key, out var value); if (!hasValue) - return fallback; + return ("", fallback); // Now, verify that the string is not empty - hasValue = !string.IsNullOrEmpty(value); - return hasValue ? value : fallback; + hasValue = !string.IsNullOrEmpty(value.value); + return hasValue ? (value.group, value.value) : ("", fallback); } /// @@ -190,7 +190,7 @@ public string SaveToString() foreach (StringsEnum stringEnum in stringEnums) { // Get the string value - string stringValue = GetString(stringEnum); + var (group, stringValue) = GetString(stringEnum); if (string.IsNullOrEmpty(stringValue)) continue; @@ -200,6 +200,8 @@ public string SaveToString() // Now, locate the prefix and assemble the line string prefix = VcardParserTools.GetPrefixFromStringsEnum(stringEnum); + if (!string.IsNullOrEmpty(group)) + cardBuilder.Append($"{group}."); cardBuilder.Append($"{prefix}{VcardConstants._argumentDelimiter}"); cardBuilder.AppendLine($"{VcardCommonTools.MakeStringBlock(stringValue, prefix.Length)}"); } @@ -226,6 +228,9 @@ public string SaveToString() string partRepresentation = part.ToStringVcardInternal(version); string partArguments = CardBuilderTools.BuildArguments(part, version, defaultType, defaultValue); string[] partArgumentsLines = partArguments.SplitNewLines(); + string group = part.Group; + if (!string.IsNullOrEmpty(group)) + cardBuilder.Append($"{group}."); partBuilder.Append($"{prefix}"); partBuilder.Append($"{partArguments}"); partBuilder.Append($"{VcardCommonTools.MakeStringBlock(partRepresentation, partArgumentsLines[partArgumentsLines.Length - 1].Length + prefix.Length)}"); @@ -296,7 +301,7 @@ public override int GetHashCode() int hashCode = 1365540608; hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(nestedCards); hashCode = hashCode * -1521134295 + EqualityComparer>>.Default.GetHashCode(partsArray); - hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(strings); + hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(strings); return hashCode; } @@ -341,14 +346,14 @@ internal void AddPartToArray(PartsArrayEnum key, BaseCardPartInfo value) } } - internal void SetString(StringsEnum key, string value) + internal void SetString(StringsEnum key, string value, string group = "") { if (string.IsNullOrEmpty(value)) return; // If we don't have this key yet, add it. if (!strings.ContainsKey(key)) - strings.Add(key, value); + strings.Add(key, (group, value)); else throw new InvalidOperationException($"Can't overwrite string {key}."); } diff --git a/VisualCard/Parts/Comparers/PartComparison.cs b/VisualCard/Parts/Comparers/PartComparison.cs index 850af042..47318774 100644 --- a/VisualCard/Parts/Comparers/PartComparison.cs +++ b/VisualCard/Parts/Comparers/PartComparison.cs @@ -63,8 +63,8 @@ internal static bool PartsArrayEnumEqual( } internal static bool StringsEqual( - IDictionary source, - IDictionary target) + IDictionary source, + IDictionary target) { // Verify the dictionaries if (!VerifyDicts(source, target)) @@ -77,7 +77,7 @@ internal static bool StringsEqual( // Now, test the equality bool equal = source.All(kvp => { - bool exists = target.TryGetValue(kvp.Key, out string part); + bool exists = target.TryGetValue(kvp.Key, out var part); bool partsEqual = kvp.Value == part; return exists && partsEqual; }); diff --git a/VisualCard/Parts/Implementations/AddressInfo.cs b/VisualCard/Parts/Implementations/AddressInfo.cs index c7008497..21dcaa82 100644 --- a/VisualCard/Parts/Implementations/AddressInfo.cs +++ b/VisualCard/Parts/Implementations/AddressInfo.cs @@ -61,8 +61,8 @@ public class AddressInfo : BaseCardPartInfo, IEquatable /// public string? Country { get; } - internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) => - new AddressInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, valueType, cardVersion); + internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) => + new AddressInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, group, valueType, cardVersion); internal override string ToStringVcardInternal(Version cardVersion) => $"{PostOfficeBox}{VcardConstants._fieldDelimiter}" + @@ -73,7 +73,7 @@ internal override string ToStringVcardInternal(Version cardVersion) => $"{PostalCode}{VcardConstants._fieldDelimiter}" + $"{Country}"; - internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) + internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) { // Get the value string[] splitAdr = value.Split(VcardConstants._fieldDelimiter); @@ -91,7 +91,7 @@ internal override BaseCardPartInfo FromStringVcardInternal(string value, string[ string _addressRegion = Regex.Unescape(splitAdr[4]); string _addressPostalCode = Regex.Unescape(splitAdr[5]); string _addressCountry = Regex.Unescape(splitAdr[6]); - AddressInfo _address = new(altId, finalArgs, _addressTypes, valueType, _addressPOBox, _addressExtended, _addressStreet, _addressLocality, _addressRegion, _addressPostalCode, _addressCountry); + AddressInfo _address = new(altId, finalArgs, _addressTypes, valueType, group, _addressPOBox, _addressExtended, _addressStreet, _addressLocality, _addressRegion, _addressPostalCode, _addressCountry); return _address; } @@ -161,8 +161,8 @@ internal AddressInfo() : base() { } - internal AddressInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string postOfficeBox, string extendedAddress, string streetAddress, string locality, string region, string postalCode, string country) : - base(arguments, altId, elementTypes, valueType) + internal AddressInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string group, string postOfficeBox, string extendedAddress, string streetAddress, string locality, string region, string postalCode, string country) : + base(arguments, altId, elementTypes, valueType, group) { PostOfficeBox = postOfficeBox; ExtendedAddress = extendedAddress; diff --git a/VisualCard/Parts/Implementations/AgentInfo.cs b/VisualCard/Parts/Implementations/AgentInfo.cs index 73023023..52219798 100644 --- a/VisualCard/Parts/Implementations/AgentInfo.cs +++ b/VisualCard/Parts/Implementations/AgentInfo.cs @@ -38,8 +38,8 @@ public class AgentInfo : BaseCardPartInfo, IEquatable /// public Card[]? AgentCards { get; } - internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) => - new AgentInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, valueType, cardVersion); + internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) => + new AgentInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, group, valueType, cardVersion); internal override string ToStringVcardInternal(Version cardVersion) { @@ -56,7 +56,7 @@ internal override string ToStringVcardInternal(Version cardVersion) return agents.ToString(); } - internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) + internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) { // Check the provided agent if (string.IsNullOrEmpty(value)) @@ -65,7 +65,7 @@ internal override BaseCardPartInfo FromStringVcardInternal(string value, string[ // Populate the fields string _agentVcard = Regex.Unescape(value).Replace("\\n", "\n"); var _agentVcardParsers = CardTools.GetCardsFromString(_agentVcard); - AgentInfo _agent = new(altId, finalArgs, elementTypes, valueType, _agentVcardParsers); + AgentInfo _agent = new(altId, finalArgs, elementTypes, valueType, group, _agentVcardParsers); return _agent; } @@ -123,8 +123,8 @@ internal AgentInfo() : base() { } - internal AgentInfo(int altId, string[] arguments, string[] elementTypes, string valueType, Card[] agentCard) : - base(arguments, altId, elementTypes, valueType) + internal AgentInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string group, Card[] agentCard) : + base(arguments, altId, elementTypes, valueType, group) { AgentCards = agentCard; } diff --git a/VisualCard/Parts/Implementations/AnniversaryInfo.cs b/VisualCard/Parts/Implementations/AnniversaryInfo.cs index 03c7c842..6801e59d 100644 --- a/VisualCard/Parts/Implementations/AnniversaryInfo.cs +++ b/VisualCard/Parts/Implementations/AnniversaryInfo.cs @@ -34,19 +34,19 @@ public class AnniversaryInfo : BaseCardPartInfo, IEquatable /// public DateTimeOffset Anniversary { get; } - internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) => - new AnniversaryInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, valueType, cardVersion); + internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) => + new AnniversaryInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, group, valueType, cardVersion); internal override string ToStringVcardInternal(Version cardVersion) => $"{VcardCommonTools.SavePosixDate(Anniversary, true)}"; - internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) + internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) { // Populate the fields DateTimeOffset anniversary = VcardCommonTools.ParsePosixDate(value); // Add the fetched information - AnniversaryInfo _time = new(-1, [], [], valueType, anniversary); + AnniversaryInfo _time = new(-1, [], [], valueType, group, anniversary); return _time; } @@ -102,8 +102,8 @@ internal override bool EqualsInternal(BaseCardPartInfo source, BaseCardPartInfo internal AnniversaryInfo() { } - internal AnniversaryInfo(int altId, string[] arguments, string[] elementTypes, string valueType, DateTimeOffset anniversary) : - base(arguments, altId, elementTypes, valueType) + internal AnniversaryInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string group, DateTimeOffset anniversary) : + base(arguments, altId, elementTypes, valueType, group) { Anniversary = anniversary; } diff --git a/VisualCard/Parts/Implementations/BirthDateInfo.cs b/VisualCard/Parts/Implementations/BirthDateInfo.cs index dad19ac0..1d7e1017 100644 --- a/VisualCard/Parts/Implementations/BirthDateInfo.cs +++ b/VisualCard/Parts/Implementations/BirthDateInfo.cs @@ -34,19 +34,19 @@ public class BirthDateInfo : BaseCardPartInfo, IEquatable /// public DateTimeOffset BirthDate { get; } - internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) => - new BirthDateInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, valueType, cardVersion); + internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) => + new BirthDateInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, group, valueType, cardVersion); internal override string ToStringVcardInternal(Version cardVersion) => $"{VcardCommonTools.SavePosixDate(BirthDate, true)}"; - internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) + internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) { // Populate field DateTimeOffset bday = VcardCommonTools.ParsePosixDate(value); // Add the fetched information - BirthDateInfo _time = new(altId, finalArgs, elementTypes, valueType, bday); + BirthDateInfo _time = new(altId, finalArgs, elementTypes, valueType, group, bday); return _time; } @@ -102,8 +102,8 @@ internal override bool EqualsInternal(BaseCardPartInfo source, BaseCardPartInfo internal BirthDateInfo() { } - internal BirthDateInfo(int altId, string[] arguments, string[] elementTypes, string valueType, DateTimeOffset birth) : - base(arguments, altId, elementTypes, valueType) + internal BirthDateInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string group, DateTimeOffset birth) : + base(arguments, altId, elementTypes, valueType, group) { BirthDate = birth; } diff --git a/VisualCard/Parts/Implementations/CalendarSchedulingRequestUrlInfo.cs b/VisualCard/Parts/Implementations/CalendarSchedulingRequestUrlInfo.cs index dddd2ac0..0ec8b2eb 100644 --- a/VisualCard/Parts/Implementations/CalendarSchedulingRequestUrlInfo.cs +++ b/VisualCard/Parts/Implementations/CalendarSchedulingRequestUrlInfo.cs @@ -35,13 +35,13 @@ public class CalendarSchedulingRequestUrlInfo : BaseCardPartInfo, IEquatable public string? CalendarSchedulingRequestUrl { get; } - internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) => - new CalendarSchedulingRequestUrlInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, valueType, cardVersion); + internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) => + new CalendarSchedulingRequestUrlInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, group, valueType, cardVersion); internal override string ToStringVcardInternal(Version cardVersion) => CalendarSchedulingRequestUrl ?? ""; - internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) + internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) { // Try to parse the source to ensure that it conforms the IETF RFC 1738: Uniform Resource Locators if (!Uri.TryCreate(value, UriKind.Absolute, out Uri uri)) @@ -49,7 +49,7 @@ internal override BaseCardPartInfo FromStringVcardInternal(string value, string[ value = uri.ToString(); // Populate the fields - CalendarSchedulingRequestUrlInfo _source = new(altId, finalArgs, elementTypes, valueType, value); + CalendarSchedulingRequestUrlInfo _source = new(altId, finalArgs, elementTypes, valueType, group, value); return _source; } @@ -105,8 +105,8 @@ internal override bool EqualsInternal(BaseCardPartInfo source, BaseCardPartInfo internal CalendarSchedulingRequestUrlInfo() { } - internal CalendarSchedulingRequestUrlInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string source) : - base(arguments, altId, elementTypes, valueType) + internal CalendarSchedulingRequestUrlInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string group, string source) : + base(arguments, altId, elementTypes, valueType, group) { CalendarSchedulingRequestUrl = source; } diff --git a/VisualCard/Parts/Implementations/CalendarUrlInfo.cs b/VisualCard/Parts/Implementations/CalendarUrlInfo.cs index 103f6530..1678397e 100644 --- a/VisualCard/Parts/Implementations/CalendarUrlInfo.cs +++ b/VisualCard/Parts/Implementations/CalendarUrlInfo.cs @@ -35,13 +35,13 @@ public class CalendarUrlInfo : BaseCardPartInfo, IEquatable /// public string? CalendarUrl { get; } - internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) => - new CalendarUrlInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, valueType, cardVersion); + internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) => + new CalendarUrlInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, group, valueType, cardVersion); internal override string ToStringVcardInternal(Version cardVersion) => CalendarUrl ?? ""; - internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) + internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) { // Try to parse the source to ensure that it conforms the IETF RFC 1738: Uniform Resource Locators if (!Uri.TryCreate(value, UriKind.Absolute, out Uri uri)) @@ -49,7 +49,7 @@ internal override BaseCardPartInfo FromStringVcardInternal(string value, string[ value = uri.ToString(); // Populate the fields - CalendarUrlInfo _source = new(altId, finalArgs, elementTypes, valueType, value); + CalendarUrlInfo _source = new(altId, finalArgs, elementTypes, valueType, group, value); return _source; } @@ -105,8 +105,8 @@ internal override bool EqualsInternal(BaseCardPartInfo source, BaseCardPartInfo internal CalendarUrlInfo() { } - internal CalendarUrlInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string source) : - base(arguments, altId, elementTypes, valueType) + internal CalendarUrlInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string group, string source) : + base(arguments, altId, elementTypes, valueType, group) { CalendarUrl = source; } diff --git a/VisualCard/Parts/Implementations/CategoryInfo.cs b/VisualCard/Parts/Implementations/CategoryInfo.cs index 928f8d1c..80415e6a 100644 --- a/VisualCard/Parts/Implementations/CategoryInfo.cs +++ b/VisualCard/Parts/Implementations/CategoryInfo.cs @@ -36,19 +36,19 @@ public class CategoryInfo : BaseCardPartInfo, IEquatable /// public string[]? Category { get; } - internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) => - new CategoryInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, valueType, cardVersion); + internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) => + new CategoryInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, group, valueType, cardVersion); internal override string ToStringVcardInternal(Version cardVersion) => $"{string.Join(VcardConstants._valueDelimiter.ToString(), Category)}"; - internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) + internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) { // Populate the fields var categories = Regex.Unescape(value).Split(','); // Add the fetched information - CategoryInfo _time = new(-1, [], elementTypes, valueType, categories); + CategoryInfo _time = new(-1, [], elementTypes, valueType, group, categories); return _time; } @@ -104,8 +104,8 @@ internal override bool EqualsInternal(BaseCardPartInfo source, BaseCardPartInfo internal CategoryInfo() { } - internal CategoryInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string[] category) : - base(arguments, altId, elementTypes, valueType) + internal CategoryInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string group, string[] category) : + base(arguments, altId, elementTypes, valueType, group) { Category = category; } diff --git a/VisualCard/Parts/Implementations/ContactUriInfo.cs b/VisualCard/Parts/Implementations/ContactUriInfo.cs index 001f1636..ab193980 100644 --- a/VisualCard/Parts/Implementations/ContactUriInfo.cs +++ b/VisualCard/Parts/Implementations/ContactUriInfo.cs @@ -35,13 +35,13 @@ public class ContactUriInfo : BaseCardPartInfo, IEquatable /// public string? ContactUri { get; } - internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) => - new ContactUriInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, valueType, cardVersion); + internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) => + new ContactUriInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, group, valueType, cardVersion); internal override string ToStringVcardInternal(Version cardVersion) => ContactUri ?? ""; - internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) + internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) { // Try to parse the source to ensure that it conforms the IETF RFC 1738: Uniform Resource Locators if (!Uri.TryCreate(value, UriKind.Absolute, out Uri uri)) @@ -49,7 +49,7 @@ internal override BaseCardPartInfo FromStringVcardInternal(string value, string[ value = uri.ToString(); // Populate the fields - ContactUriInfo _source = new(altId, finalArgs, elementTypes, valueType, value); + ContactUriInfo _source = new(altId, finalArgs, elementTypes, valueType, group, value); return _source; } @@ -105,8 +105,8 @@ internal override bool EqualsInternal(BaseCardPartInfo source, BaseCardPartInfo internal ContactUriInfo() { } - internal ContactUriInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string source) : - base(arguments, altId, elementTypes, valueType) + internal ContactUriInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string group, string source) : + base(arguments, altId, elementTypes, valueType, group) { ContactUri = source; } diff --git a/VisualCard/Parts/Implementations/EmailInfo.cs b/VisualCard/Parts/Implementations/EmailInfo.cs index 98e811b1..5ea6c64c 100644 --- a/VisualCard/Parts/Implementations/EmailInfo.cs +++ b/VisualCard/Parts/Implementations/EmailInfo.cs @@ -36,13 +36,13 @@ public class EmailInfo : BaseCardPartInfo, IEquatable /// public string? ContactEmailAddress { get; } - internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) => - new EmailInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, valueType, cardVersion); + internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) => + new EmailInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, group, valueType, cardVersion); internal override string ToStringVcardInternal(Version cardVersion) => ContactEmailAddress ?? ""; - internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) + internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) { MailAddress mail; @@ -58,7 +58,7 @@ internal override BaseCardPartInfo FromStringVcardInternal(string value, string[ // Populate the fields string _emailAddress = mail.Address; - EmailInfo _address = new(altId, finalArgs, elementTypes, valueType, _emailAddress); + EmailInfo _address = new(altId, finalArgs, elementTypes, valueType, group, _emailAddress); return _address; } @@ -114,8 +114,8 @@ internal override bool EqualsInternal(BaseCardPartInfo source, BaseCardPartInfo internal EmailInfo() { } - internal EmailInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string contactEmailAddress) : - base(arguments, altId, elementTypes, valueType) + internal EmailInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string group, string contactEmailAddress) : + base(arguments, altId, elementTypes, valueType, group) { ContactEmailAddress = contactEmailAddress; } diff --git a/VisualCard/Parts/Implementations/ExtraInfo.cs b/VisualCard/Parts/Implementations/ExtraInfo.cs index 5fab0410..1f8dbe5f 100644 --- a/VisualCard/Parts/Implementations/ExtraInfo.cs +++ b/VisualCard/Parts/Implementations/ExtraInfo.cs @@ -40,13 +40,13 @@ public class ExtraInfo : BaseCardPartInfo, IEquatable /// public string[]? Values { get; } - internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) => - new ExtraInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, valueType, cardVersion); + internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) => + new ExtraInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, group, valueType, cardVersion); internal override string ToStringVcardInternal(Version cardVersion) => string.Join(VcardConstants._fieldDelimiter.ToString(), Values); - internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) + internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) { string[] split = value.Split(VcardConstants._argumentDelimiter); @@ -57,7 +57,7 @@ internal override BaseCardPartInfo FromStringVcardInternal(string value, string[ // Populate the fields string[] _values = split[1].Split(VcardConstants._fieldDelimiter); - ExtraInfo _extraInfo = new(altId, finalArgs, elementTypes, valueType, _extra, _values); + ExtraInfo _extraInfo = new(altId, finalArgs, elementTypes, valueType, group, _extra, _values); return _extraInfo; } @@ -115,8 +115,8 @@ internal override bool EqualsInternal(BaseCardPartInfo source, BaseCardPartInfo internal ExtraInfo() { } - internal ExtraInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string keyName, string[] values) : - base(arguments, altId, elementTypes, valueType) + internal ExtraInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string group, string keyName, string[] values) : + base(arguments, altId, elementTypes, valueType, group) { KeyName = keyName; Values = values; diff --git a/VisualCard/Parts/Implementations/FreeBusyInfo.cs b/VisualCard/Parts/Implementations/FreeBusyInfo.cs index 0c053ae2..fb8da4f4 100644 --- a/VisualCard/Parts/Implementations/FreeBusyInfo.cs +++ b/VisualCard/Parts/Implementations/FreeBusyInfo.cs @@ -35,13 +35,13 @@ public class FreeBusyInfo : BaseCardPartInfo, IEquatable /// public string? FreeBusy { get; } - internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) => - new FreeBusyInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, valueType, cardVersion); + internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) => + new FreeBusyInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, group, valueType, cardVersion); internal override string ToStringVcardInternal(Version cardVersion) => FreeBusy ?? ""; - internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) + internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) { // Try to parse the source to ensure that it conforms the IETF RFC 1738: Uniform Resource Locators if (!Uri.TryCreate(value, UriKind.Absolute, out Uri uri)) @@ -49,7 +49,7 @@ internal override BaseCardPartInfo FromStringVcardInternal(string value, string[ value = uri.ToString(); // Populate the fields - FreeBusyInfo _source = new(altId, finalArgs, elementTypes, valueType, value); + FreeBusyInfo _source = new(altId, finalArgs, elementTypes, valueType, group, value); return _source; } @@ -105,8 +105,8 @@ internal override bool EqualsInternal(BaseCardPartInfo source, BaseCardPartInfo internal FreeBusyInfo() { } - internal FreeBusyInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string source) : - base(arguments, altId, elementTypes, valueType) + internal FreeBusyInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string group, string source) : + base(arguments, altId, elementTypes, valueType, group) { FreeBusy = source; } diff --git a/VisualCard/Parts/Implementations/FullNameInfo.cs b/VisualCard/Parts/Implementations/FullNameInfo.cs index df3a3b95..84efd505 100644 --- a/VisualCard/Parts/Implementations/FullNameInfo.cs +++ b/VisualCard/Parts/Implementations/FullNameInfo.cs @@ -35,19 +35,19 @@ public class FullNameInfo : BaseCardPartInfo, IEquatable /// public string? FullName { get; } - internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) => - new FullNameInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, valueType, cardVersion); + internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) => + new FullNameInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, group, valueType, cardVersion); internal override string ToStringVcardInternal(Version cardVersion) => FullName ?? ""; - internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) + internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) { // Get the value string _fullNameStr = Regex.Unescape(value); // Populate the fields - FullNameInfo _fullName = new(altId, finalArgs, elementTypes, valueType, _fullNameStr); + FullNameInfo _fullName = new(altId, finalArgs, elementTypes, valueType, group, _fullNameStr); return _fullName; } @@ -103,8 +103,8 @@ internal override bool EqualsInternal(BaseCardPartInfo source, BaseCardPartInfo internal FullNameInfo() { } - internal FullNameInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string fullName) : - base(arguments, altId, elementTypes, valueType) + internal FullNameInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string group, string fullName) : + base(arguments, altId, elementTypes, valueType, group) { FullName = fullName; } diff --git a/VisualCard/Parts/Implementations/GenderInfo.cs b/VisualCard/Parts/Implementations/GenderInfo.cs index a86ef787..06b576d3 100644 --- a/VisualCard/Parts/Implementations/GenderInfo.cs +++ b/VisualCard/Parts/Implementations/GenderInfo.cs @@ -42,14 +42,14 @@ public class GenderInfo : BaseCardPartInfo, IEquatable /// public string? GenderDescription { get; } - internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) => - new GenderInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, valueType, cardVersion); + internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) => + new GenderInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, group, valueType, cardVersion); internal override string ToStringVcardInternal(Version cardVersion) => (Gender != Gender.Unspecified ? Gender.ToString()[0] : "") + (!string.IsNullOrEmpty(GenderDescription) ? $"{VcardConstants._fieldDelimiter}{GenderDescription}" : ""); - internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) + internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) { // Populate field string genderString = value; @@ -78,7 +78,7 @@ internal override BaseCardPartInfo FromStringVcardInternal(string value, string[ }; // Add the fetched information - GenderInfo _gender = new(-1, [], elementTypes, valueType, gender, genderDescription); + GenderInfo _gender = new(-1, [], elementTypes, valueType, group, gender, genderDescription); return _gender; } @@ -136,8 +136,8 @@ internal override bool EqualsInternal(BaseCardPartInfo source, BaseCardPartInfo internal GenderInfo() { } - internal GenderInfo(int altId, string[] arguments, string[] elementTypes, string valueType, Gender gender, string genderDescription) : - base(arguments, altId, elementTypes, valueType) + internal GenderInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string group, Gender gender, string genderDescription) : + base(arguments, altId, elementTypes, valueType, group) { Gender = gender; GenderDescription = genderDescription; diff --git a/VisualCard/Parts/Implementations/GeoInfo.cs b/VisualCard/Parts/Implementations/GeoInfo.cs index 78dbf96b..9f2026a4 100644 --- a/VisualCard/Parts/Implementations/GeoInfo.cs +++ b/VisualCard/Parts/Implementations/GeoInfo.cs @@ -35,19 +35,19 @@ public class GeoInfo : BaseCardPartInfo, IEquatable /// public string? Geo { get; } - internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) => - new GeoInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, valueType, cardVersion); + internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) => + new GeoInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, group, valueType, cardVersion); internal override string ToStringVcardInternal(Version cardVersion) => Geo ?? ""; - internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) + internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) { // Get the value string _geoStr = Regex.Unescape(value); // Populate the fields - GeoInfo _geo = new(altId, finalArgs, elementTypes, valueType, _geoStr); + GeoInfo _geo = new(altId, finalArgs, elementTypes, valueType, group, _geoStr); return _geo; } @@ -103,8 +103,8 @@ internal override bool EqualsInternal(BaseCardPartInfo source, BaseCardPartInfo internal GeoInfo() { } - internal GeoInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string geo) : - base(arguments, altId, elementTypes, valueType) + internal GeoInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string group, string geo) : + base(arguments, altId, elementTypes, valueType, group) { Geo = geo; } diff --git a/VisualCard/Parts/Implementations/ImppInfo.cs b/VisualCard/Parts/Implementations/ImppInfo.cs index fae3d103..392b4359 100644 --- a/VisualCard/Parts/Implementations/ImppInfo.cs +++ b/VisualCard/Parts/Implementations/ImppInfo.cs @@ -35,17 +35,17 @@ public class ImppInfo : BaseCardPartInfo, IEquatable /// public string? ContactIMPP { get; } - internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) => - new ImppInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, valueType, cardVersion); + internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) => + new ImppInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, group, valueType, cardVersion); internal override string ToStringVcardInternal(Version cardVersion) => ContactIMPP ?? ""; - internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) + internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) { // Populate the fields string _impp = Regex.Unescape(value); - ImppInfo _imppInstance = new(altId, finalArgs, elementTypes, valueType, _impp); + ImppInfo _imppInstance = new(altId, finalArgs, elementTypes, valueType, group, _impp); return _imppInstance; } @@ -101,8 +101,8 @@ internal override bool EqualsInternal(BaseCardPartInfo source, BaseCardPartInfo internal ImppInfo() { } - internal ImppInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string contactImpp) : - base(arguments, altId, elementTypes, valueType) + internal ImppInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string group, string contactImpp) : + base(arguments, altId, elementTypes, valueType, group) { ContactIMPP = contactImpp; } diff --git a/VisualCard/Parts/Implementations/KeyInfo.cs b/VisualCard/Parts/Implementations/KeyInfo.cs index 56a46b4b..55471e84 100644 --- a/VisualCard/Parts/Implementations/KeyInfo.cs +++ b/VisualCard/Parts/Implementations/KeyInfo.cs @@ -45,13 +45,13 @@ public class KeyInfo : BaseCardPartInfo, IEquatable public bool IsBlob => VcardCommonTools.IsEncodingBlob(Arguments, KeyEncoded); - internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) => - new KeyInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, valueType, cardVersion); + internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) => + new KeyInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, group, valueType, cardVersion); internal override string ToStringVcardInternal(Version cardVersion) => KeyEncoded ?? ""; - internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) + internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) { bool vCard4 = cardVersion.Major >= 4; @@ -78,7 +78,7 @@ internal override BaseCardPartInfo FromStringVcardInternal(string value, string[ } // Populate the fields - KeyInfo _key = new(altId, finalArgs, elementTypes, valueType, keyEncoding, value); + KeyInfo _key = new(altId, finalArgs, elementTypes, valueType, group, keyEncoding, value); return _key; } @@ -143,8 +143,8 @@ internal override bool EqualsInternal(BaseCardPartInfo source, BaseCardPartInfo internal KeyInfo() { } - internal KeyInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string encoding, string keyEncoded) : - base(arguments, altId, elementTypes, valueType) + internal KeyInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string group, string encoding, string keyEncoded) : + base(arguments, altId, elementTypes, valueType, group) { Encoding = encoding; KeyEncoded = keyEncoded; diff --git a/VisualCard/Parts/Implementations/LabelAddressInfo.cs b/VisualCard/Parts/Implementations/LabelAddressInfo.cs index c4cfe747..ada79932 100644 --- a/VisualCard/Parts/Implementations/LabelAddressInfo.cs +++ b/VisualCard/Parts/Implementations/LabelAddressInfo.cs @@ -35,17 +35,17 @@ public class LabelAddressInfo : BaseCardPartInfo, IEquatable /// public string? DeliveryLabel { get; } - internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) => - new LabelAddressInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, valueType, cardVersion); + internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) => + new LabelAddressInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, group, valueType, cardVersion); internal override string ToStringVcardInternal(Version cardVersion) => DeliveryLabel ?? ""; - internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) + internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) { // Populate the fields string _addressLabel = Regex.Unescape(value); - LabelAddressInfo _address = new(altId, finalArgs, elementTypes, valueType, _addressLabel); + LabelAddressInfo _address = new(altId, finalArgs, elementTypes, valueType, group, _addressLabel); return _address; } @@ -101,8 +101,8 @@ internal override bool EqualsInternal(BaseCardPartInfo source, BaseCardPartInfo internal LabelAddressInfo() { } - internal LabelAddressInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string label) : - base(arguments, altId, elementTypes, valueType) + internal LabelAddressInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string group, string label) : + base(arguments, altId, elementTypes, valueType, group) { DeliveryLabel = label; } diff --git a/VisualCard/Parts/Implementations/LangInfo.cs b/VisualCard/Parts/Implementations/LangInfo.cs index e629aa6c..497ca706 100644 --- a/VisualCard/Parts/Implementations/LangInfo.cs +++ b/VisualCard/Parts/Implementations/LangInfo.cs @@ -38,16 +38,16 @@ public class LangInfo : BaseCardPartInfo, IEquatable /// public string? ContactLang { get; } - internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) => - new LangInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, valueType, cardVersion); + internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) => + new LangInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, group, valueType, cardVersion); internal override string ToStringVcardInternal(Version cardVersion) => ContactLang ?? ""; - internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) + internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) { // Populate the fields - LangInfo _lang = new(altId, finalArgs, elementTypes, valueType, value); + LangInfo _lang = new(altId, finalArgs, elementTypes, valueType, group, value); return _lang; } @@ -104,8 +104,8 @@ internal override bool EqualsInternal(BaseCardPartInfo source, BaseCardPartInfo internal LangInfo() { } - internal LangInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string contactLangCode) : - base(arguments, altId, elementTypes, valueType) + internal LangInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string group, string contactLangCode) : + base(arguments, altId, elementTypes, valueType, group) { ContactLang = contactLangCode; } diff --git a/VisualCard/Parts/Implementations/LogoInfo.cs b/VisualCard/Parts/Implementations/LogoInfo.cs index d8ec28d1..852730b7 100644 --- a/VisualCard/Parts/Implementations/LogoInfo.cs +++ b/VisualCard/Parts/Implementations/LogoInfo.cs @@ -45,13 +45,13 @@ public class LogoInfo : BaseCardPartInfo, IEquatable public bool IsBlob => VcardCommonTools.IsEncodingBlob(Arguments, LogoEncoded); - internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) => - new LogoInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, valueType, cardVersion); + internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) => + new LogoInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, group, valueType, cardVersion); internal override string ToStringVcardInternal(Version cardVersion) => LogoEncoded ?? ""; - internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) + internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) { bool vCard4 = cardVersion.Major >= 4; @@ -78,7 +78,7 @@ internal override BaseCardPartInfo FromStringVcardInternal(string value, string[ } // Populate the fields - LogoInfo _logo = new(altId, finalArgs, elementTypes, valueType, logoEncoding, value); + LogoInfo _logo = new(altId, finalArgs, elementTypes, valueType, group, logoEncoding, value); return _logo; } @@ -143,8 +143,8 @@ internal override bool EqualsInternal(BaseCardPartInfo source, BaseCardPartInfo internal LogoInfo() { } - internal LogoInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string encoding, string logoEncoded) : - base(arguments, altId, elementTypes, valueType) + internal LogoInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string group, string encoding, string logoEncoded) : + base(arguments, altId, elementTypes, valueType, group) { Encoding = encoding; LogoEncoded = logoEncoded; diff --git a/VisualCard/Parts/Implementations/MemberInfo.cs b/VisualCard/Parts/Implementations/MemberInfo.cs index bcc01e19..48ac0ed9 100644 --- a/VisualCard/Parts/Implementations/MemberInfo.cs +++ b/VisualCard/Parts/Implementations/MemberInfo.cs @@ -35,13 +35,13 @@ public class MemberInfo : BaseCardPartInfo, IEquatable /// public string? MemberUri { get; } - internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) => - new MemberInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, valueType, cardVersion); + internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) => + new MemberInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, group, valueType, cardVersion); internal override string ToStringVcardInternal(Version cardVersion) => MemberUri ?? ""; - internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) + internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) { // Try to parse the source to ensure that it conforms the IETF RFC 1738: Uniform Resource Locators if (!Uri.TryCreate(value, UriKind.Absolute, out Uri uri)) @@ -49,7 +49,7 @@ internal override BaseCardPartInfo FromStringVcardInternal(string value, string[ value = uri.ToString(); // Populate the fields - MemberInfo _source = new(altId, finalArgs, elementTypes, valueType, value); + MemberInfo _source = new(altId, finalArgs, elementTypes, valueType, group, value); return _source; } @@ -105,8 +105,8 @@ internal override bool EqualsInternal(BaseCardPartInfo source, BaseCardPartInfo internal MemberInfo() { } - internal MemberInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string source) : - base(arguments, altId, elementTypes, valueType) + internal MemberInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string group, string source) : + base(arguments, altId, elementTypes, valueType, group) { MemberUri = source; } diff --git a/VisualCard/Parts/Implementations/NameInfo.cs b/VisualCard/Parts/Implementations/NameInfo.cs index 243f40a9..ab2ee2f1 100644 --- a/VisualCard/Parts/Implementations/NameInfo.cs +++ b/VisualCard/Parts/Implementations/NameInfo.cs @@ -54,8 +54,8 @@ public class NameInfo : BaseCardPartInfo, IEquatable /// public string[]? Suffixes { get; } - internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) => - new NameInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, valueType, cardVersion); + internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) => + new NameInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, group, valueType, cardVersion); internal override string ToStringVcardInternal(Version cardVersion) { @@ -70,7 +70,7 @@ internal override string ToStringVcardInternal(Version cardVersion) $"{suffixesStr}"; } - internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) + internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) { string[] splitName = value.Split(VcardConstants._fieldDelimiter); if (splitName.Length < 2) @@ -82,7 +82,7 @@ internal override BaseCardPartInfo FromStringVcardInternal(string value, string[ string[] _altNames = splitName.Length >= 3 ? Regex.Unescape(splitName[2]).Split(new char[] { VcardConstants._valueDelimiter }, StringSplitOptions.RemoveEmptyEntries) : []; string[] _prefixes = splitName.Length >= 4 ? Regex.Unescape(splitName[3]).Split(new char[] { VcardConstants._valueDelimiter }, StringSplitOptions.RemoveEmptyEntries) : []; string[] _suffixes = splitName.Length >= 5 ? Regex.Unescape(splitName[4]).Split(new char[] { VcardConstants._valueDelimiter }, StringSplitOptions.RemoveEmptyEntries) : []; - NameInfo _name = new(altId, finalArgs, elementTypes, valueType, _firstName, _lastName, _altNames, _prefixes, _suffixes); + NameInfo _name = new(altId, finalArgs, elementTypes, valueType, group, _firstName, _lastName, _altNames, _prefixes, _suffixes); return _name; } @@ -146,8 +146,8 @@ internal override bool EqualsInternal(BaseCardPartInfo source, BaseCardPartInfo internal NameInfo() { } - internal NameInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string contactFirstName, string contactLastName, string[] altNames, string[] prefixes, string[] suffixes) : - base(arguments, altId, elementTypes, valueType) + internal NameInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string group, string contactFirstName, string contactLastName, string[] altNames, string[] prefixes, string[] suffixes) : + base(arguments, altId, elementTypes, valueType, group) { ContactFirstName = contactFirstName; ContactLastName = contactLastName; diff --git a/VisualCard/Parts/Implementations/NicknameInfo.cs b/VisualCard/Parts/Implementations/NicknameInfo.cs index e2fcd013..f4c3fc06 100644 --- a/VisualCard/Parts/Implementations/NicknameInfo.cs +++ b/VisualCard/Parts/Implementations/NicknameInfo.cs @@ -35,17 +35,17 @@ public class NicknameInfo : BaseCardPartInfo, IEquatable /// public string? ContactNickname { get; } - internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) => - new NicknameInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, valueType, cardVersion); + internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) => + new NicknameInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, group, valueType, cardVersion); internal override string ToStringVcardInternal(Version cardVersion) => ContactNickname ?? ""; - internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) + internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) { // Populate the fields string _nick = Regex.Unescape(value); - NicknameInfo _nickInstance = new(altId, finalArgs, elementTypes, valueType, _nick); + NicknameInfo _nickInstance = new(altId, finalArgs, elementTypes, valueType, group, _nick); return _nickInstance; } @@ -101,8 +101,8 @@ internal override bool EqualsInternal(BaseCardPartInfo source, BaseCardPartInfo internal NicknameInfo() { } - internal NicknameInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string contactNickname) : - base(arguments, altId, elementTypes, valueType) + internal NicknameInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string group, string contactNickname) : + base(arguments, altId, elementTypes, valueType, group) { ContactNickname = contactNickname; } diff --git a/VisualCard/Parts/Implementations/NoteInfo.cs b/VisualCard/Parts/Implementations/NoteInfo.cs index 39db93ac..7e0533f6 100644 --- a/VisualCard/Parts/Implementations/NoteInfo.cs +++ b/VisualCard/Parts/Implementations/NoteInfo.cs @@ -35,19 +35,19 @@ public class NoteInfo : BaseCardPartInfo, IEquatable /// public string? Note { get; } - internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) => - new NoteInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, valueType, cardVersion); + internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) => + new NoteInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, group, valueType, cardVersion); internal override string ToStringVcardInternal(Version cardVersion) => Note ?? ""; - internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) + internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) { // Get the value string _noteStr = Regex.Unescape(value); // Populate the fields - NoteInfo _note = new(altId, finalArgs, elementTypes, valueType, _noteStr); + NoteInfo _note = new(altId, finalArgs, elementTypes, valueType, group, _noteStr); return _note; } @@ -103,8 +103,8 @@ internal override bool EqualsInternal(BaseCardPartInfo source, BaseCardPartInfo internal NoteInfo() { } - internal NoteInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string note) : - base(arguments, altId, elementTypes, valueType) + internal NoteInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string group, string note) : + base(arguments, altId, elementTypes, valueType, group) { Note = note; } diff --git a/VisualCard/Parts/Implementations/OrganizationInfo.cs b/VisualCard/Parts/Implementations/OrganizationInfo.cs index 7a7f047c..662b0f51 100644 --- a/VisualCard/Parts/Implementations/OrganizationInfo.cs +++ b/VisualCard/Parts/Implementations/OrganizationInfo.cs @@ -44,15 +44,15 @@ public class OrganizationInfo : BaseCardPartInfo, IEquatable /// public string? Role { get; } - internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) => - new OrganizationInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, valueType, cardVersion); + internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) => + new OrganizationInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, group, valueType, cardVersion); internal override string ToStringVcardInternal(Version cardVersion) => $"{Name}{VcardConstants._fieldDelimiter}" + $"{Unit}{VcardConstants._fieldDelimiter}" + $"{Role}"; - internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) + internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) { string[] splitOrg = value.Split(VcardConstants._fieldDelimiter); @@ -60,7 +60,7 @@ internal override BaseCardPartInfo FromStringVcardInternal(string value, string[ string _orgName = Regex.Unescape(splitOrg[0]); string _orgUnit = Regex.Unescape(splitOrg.Length >= 2 ? splitOrg[1] : ""); string _orgUnitRole = Regex.Unescape(splitOrg.Length >= 3 ? splitOrg[2] : ""); - OrganizationInfo _org = new(altId, finalArgs, elementTypes, valueType, _orgName, _orgUnit, _orgUnitRole); + OrganizationInfo _org = new(altId, finalArgs, elementTypes, valueType, group, _orgName, _orgUnit, _orgUnitRole); return _org; } @@ -120,8 +120,8 @@ internal override bool EqualsInternal(BaseCardPartInfo source, BaseCardPartInfo internal OrganizationInfo() { } - internal OrganizationInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string name, string unit, string role) : - base(arguments, altId, elementTypes, valueType) + internal OrganizationInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string group, string name, string unit, string role) : + base(arguments, altId, elementTypes, valueType, group) { Name = name; Unit = unit; diff --git a/VisualCard/Parts/Implementations/PhotoInfo.cs b/VisualCard/Parts/Implementations/PhotoInfo.cs index adfc588b..2a5f11c3 100644 --- a/VisualCard/Parts/Implementations/PhotoInfo.cs +++ b/VisualCard/Parts/Implementations/PhotoInfo.cs @@ -45,13 +45,13 @@ public class PhotoInfo : BaseCardPartInfo, IEquatable public bool IsBlob => VcardCommonTools.IsEncodingBlob(Arguments, PhotoEncoded); - internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) => - new PhotoInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, valueType, cardVersion); + internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) => + new PhotoInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, group, valueType, cardVersion); internal override string ToStringVcardInternal(Version cardVersion) => PhotoEncoded ?? ""; - internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) + internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) { bool vCard4 = cardVersion.Major >= 4; @@ -78,7 +78,7 @@ internal override BaseCardPartInfo FromStringVcardInternal(string value, string[ } // Populate the fields - PhotoInfo _photo = new(altId, finalArgs, elementTypes, valueType, photoEncoding, value); + PhotoInfo _photo = new(altId, finalArgs, elementTypes, valueType, group, photoEncoding, value); return _photo; } @@ -143,8 +143,8 @@ internal override bool EqualsInternal(BaseCardPartInfo source, BaseCardPartInfo internal PhotoInfo() { } - internal PhotoInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string encoding, string photoEncoded) : - base(arguments, altId, elementTypes, valueType) + internal PhotoInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string group, string encoding, string photoEncoded) : + base(arguments, altId, elementTypes, valueType, group) { Encoding = encoding; PhotoEncoded = photoEncoded; diff --git a/VisualCard/Parts/Implementations/RevisionInfo.cs b/VisualCard/Parts/Implementations/RevisionInfo.cs index 1558b8b1..c122b338 100644 --- a/VisualCard/Parts/Implementations/RevisionInfo.cs +++ b/VisualCard/Parts/Implementations/RevisionInfo.cs @@ -34,13 +34,13 @@ public class RevisionInfo : BaseCardPartInfo, IEquatable /// public DateTimeOffset Revision { get; } - internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) => - new RevisionInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, valueType, cardVersion); + internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) => + new RevisionInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, group, valueType, cardVersion); internal override string ToStringVcardInternal(Version cardVersion) => $"{VcardCommonTools.SavePosixDate(Revision)}"; - internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) + internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) { // Get the value string revValue = value.Substring(VcardConstants._revSpecifier.Length + 1); @@ -49,7 +49,7 @@ internal override BaseCardPartInfo FromStringVcardInternal(string value, string[ DateTimeOffset rev = VcardCommonTools.ParsePosixDate(revValue); // Add the fetched information - RevisionInfo _time = new(altId, finalArgs, elementTypes, valueType, rev); + RevisionInfo _time = new(altId, finalArgs, elementTypes, valueType, group, rev); return _time; } @@ -105,8 +105,8 @@ internal override bool EqualsInternal(BaseCardPartInfo source, BaseCardPartInfo internal RevisionInfo() { } - internal RevisionInfo(int altId, string[] arguments, string[] elementTypes, string valueType, DateTimeOffset rev) : - base(arguments, altId, elementTypes, valueType) + internal RevisionInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string group, DateTimeOffset rev) : + base(arguments, altId, elementTypes, valueType, group) { Revision = rev; } diff --git a/VisualCard/Parts/Implementations/RoleInfo.cs b/VisualCard/Parts/Implementations/RoleInfo.cs index aa049823..bf36cbc6 100644 --- a/VisualCard/Parts/Implementations/RoleInfo.cs +++ b/VisualCard/Parts/Implementations/RoleInfo.cs @@ -35,18 +35,18 @@ public class RoleInfo : BaseCardPartInfo, IEquatable /// public string? ContactRole { get; } - internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) => - new RoleInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, valueType, cardVersion); + internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) => + new RoleInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, group, valueType, cardVersion); internal override string ToStringVcardInternal(Version cardVersion) => ContactRole ?? ""; - internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) + internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) { string roleValue = Regex.Unescape(value); // Populate the fields - RoleInfo _role = new(altId, finalArgs, elementTypes, valueType, roleValue); + RoleInfo _role = new(altId, finalArgs, elementTypes, valueType, group, roleValue); return _role; } @@ -102,8 +102,8 @@ internal override bool EqualsInternal(BaseCardPartInfo source, BaseCardPartInfo internal RoleInfo() { } - internal RoleInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string contactRole) : - base(arguments, altId, elementTypes, valueType) + internal RoleInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string group, string contactRole) : + base(arguments, altId, elementTypes, valueType, group) { ContactRole = contactRole; } diff --git a/VisualCard/Parts/Implementations/SoundInfo.cs b/VisualCard/Parts/Implementations/SoundInfo.cs index 6532195e..f40a8ea8 100644 --- a/VisualCard/Parts/Implementations/SoundInfo.cs +++ b/VisualCard/Parts/Implementations/SoundInfo.cs @@ -45,13 +45,13 @@ public class SoundInfo : BaseCardPartInfo, IEquatable public bool IsBlob => VcardCommonTools.IsEncodingBlob(Arguments, SoundEncoded); - internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) => - new SoundInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, valueType, cardVersion); + internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) => + new SoundInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, group, valueType, cardVersion); internal override string ToStringVcardInternal(Version cardVersion) => SoundEncoded ?? ""; - internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) + internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) { bool vCard4 = cardVersion.Major >= 4; @@ -78,7 +78,7 @@ internal override BaseCardPartInfo FromStringVcardInternal(string value, string[ } // Populate the fields - SoundInfo _sound = new(altId, finalArgs, elementTypes, valueType, soundEncoding, value); + SoundInfo _sound = new(altId, finalArgs, elementTypes, valueType, group, soundEncoding, value); return _sound; } @@ -143,8 +143,8 @@ internal override bool EqualsInternal(BaseCardPartInfo source, BaseCardPartInfo internal SoundInfo() { } - internal SoundInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string encoding, string soundEncoded) : - base(arguments, altId, elementTypes, valueType) + internal SoundInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string group, string encoding, string soundEncoded) : + base(arguments, altId, elementTypes, valueType, group) { Encoding = encoding; SoundEncoded = soundEncoded; diff --git a/VisualCard/Parts/Implementations/SourceInfo.cs b/VisualCard/Parts/Implementations/SourceInfo.cs index 417a8c9e..f1dddd64 100644 --- a/VisualCard/Parts/Implementations/SourceInfo.cs +++ b/VisualCard/Parts/Implementations/SourceInfo.cs @@ -35,13 +35,13 @@ public class SourceInfo : BaseCardPartInfo, IEquatable /// public string? Source { get; } - internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) => - new SourceInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, valueType, cardVersion); + internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) => + new SourceInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, group, valueType, cardVersion); internal override string ToStringVcardInternal(Version cardVersion) => Source ?? ""; - internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) + internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) { // Try to parse the source to ensure that it conforms the IETF RFC 1738: Uniform Resource Locators if (!Uri.TryCreate(value, UriKind.Absolute, out Uri uri)) @@ -49,7 +49,7 @@ internal override BaseCardPartInfo FromStringVcardInternal(string value, string[ value = uri.ToString(); // Populate the fields - SourceInfo _source = new(altId, finalArgs, elementTypes, valueType, value); + SourceInfo _source = new(altId, finalArgs, elementTypes, valueType, group, value); return _source; } @@ -105,8 +105,8 @@ internal override bool EqualsInternal(BaseCardPartInfo source, BaseCardPartInfo internal SourceInfo() { } - internal SourceInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string source) : - base(arguments, altId, elementTypes, valueType) + internal SourceInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string group, string source) : + base(arguments, altId, elementTypes, valueType, group) { Source = source; } diff --git a/VisualCard/Parts/Implementations/TelephoneInfo.cs b/VisualCard/Parts/Implementations/TelephoneInfo.cs index 46eb968c..75d7554d 100644 --- a/VisualCard/Parts/Implementations/TelephoneInfo.cs +++ b/VisualCard/Parts/Implementations/TelephoneInfo.cs @@ -35,17 +35,17 @@ public class TelephoneInfo : BaseCardPartInfo, IEquatable /// public string? ContactPhoneNumber { get; } - internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) => - new TelephoneInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, valueType, cardVersion); + internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) => + new TelephoneInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, group, valueType, cardVersion); internal override string ToStringVcardInternal(Version cardVersion) => ContactPhoneNumber ?? ""; - internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) + internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) { // Populate the fields string _telephoneNumber = Regex.Unescape(value); - TelephoneInfo _telephone = new(altId, finalArgs, elementTypes, valueType, _telephoneNumber); + TelephoneInfo _telephone = new(altId, finalArgs, elementTypes, valueType, group, _telephoneNumber); return _telephone; } @@ -101,8 +101,8 @@ internal override bool EqualsInternal(BaseCardPartInfo source, BaseCardPartInfo internal TelephoneInfo() { } - internal TelephoneInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string contactPhoneNumber) : - base(arguments, altId, elementTypes, valueType) + internal TelephoneInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string group, string contactPhoneNumber) : + base(arguments, altId, elementTypes, valueType, group) { ContactPhoneNumber = contactPhoneNumber; } diff --git a/VisualCard/Parts/Implementations/TimeDateZoneInfo.cs b/VisualCard/Parts/Implementations/TimeDateZoneInfo.cs index faa5d94e..d0f1de13 100644 --- a/VisualCard/Parts/Implementations/TimeDateZoneInfo.cs +++ b/VisualCard/Parts/Implementations/TimeDateZoneInfo.cs @@ -35,19 +35,19 @@ public class TimeDateZoneInfo : BaseCardPartInfo, IEquatable /// public string? TimeZone { get; } - internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) => - new TimeDateZoneInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, valueType, cardVersion); + internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) => + new TimeDateZoneInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, group, valueType, cardVersion); internal override string ToStringVcardInternal(Version cardVersion) => TimeZone ?? ""; - internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) + internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) { // Get the types and the number string _tzStr = Regex.Unescape(value); // Add the fetched information - TimeDateZoneInfo _timeZone = new(altId, finalArgs, elementTypes, valueType, _tzStr); + TimeDateZoneInfo _timeZone = new(altId, finalArgs, elementTypes, valueType, group, _tzStr); return _timeZone; } @@ -103,8 +103,8 @@ internal override bool EqualsInternal(BaseCardPartInfo source, BaseCardPartInfo internal TimeDateZoneInfo() { } - internal TimeDateZoneInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string timeZone) : - base(arguments, altId, elementTypes, valueType) + internal TimeDateZoneInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string group, string timeZone) : + base(arguments, altId, elementTypes, valueType, group) { TimeZone = timeZone; } diff --git a/VisualCard/Parts/Implementations/TitleInfo.cs b/VisualCard/Parts/Implementations/TitleInfo.cs index 7e560357..10834e4b 100644 --- a/VisualCard/Parts/Implementations/TitleInfo.cs +++ b/VisualCard/Parts/Implementations/TitleInfo.cs @@ -35,16 +35,16 @@ public class TitleInfo : BaseCardPartInfo, IEquatable /// public string? ContactTitle { get; } - internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) => - new TitleInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, valueType, cardVersion); + internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) => + new TitleInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, group, valueType, cardVersion); internal override string ToStringVcardInternal(Version cardVersion) => ContactTitle ?? ""; - internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) + internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) { string _title = Regex.Unescape(value); - TitleInfo _titleInfo = new(altId, finalArgs, elementTypes, valueType, _title); + TitleInfo _titleInfo = new(altId, finalArgs, elementTypes, valueType, group, _title); return _titleInfo; } @@ -100,8 +100,8 @@ internal override bool EqualsInternal(BaseCardPartInfo source, BaseCardPartInfo internal TitleInfo() { } - internal TitleInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string contactTitle) : - base(arguments, altId, elementTypes, valueType) + internal TitleInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string group, string contactTitle) : + base(arguments, altId, elementTypes, valueType, group) { ContactTitle = contactTitle; } diff --git a/VisualCard/Parts/Implementations/UrlInfo.cs b/VisualCard/Parts/Implementations/UrlInfo.cs index da0ec0bd..9af7cdad 100644 --- a/VisualCard/Parts/Implementations/UrlInfo.cs +++ b/VisualCard/Parts/Implementations/UrlInfo.cs @@ -35,13 +35,13 @@ public class UrlInfo : BaseCardPartInfo, IEquatable /// public string? Url { get; } - internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) => - new UrlInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, valueType, cardVersion); + internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) => + new UrlInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, group, valueType, cardVersion); internal override string ToStringVcardInternal(Version cardVersion) => Url ?? ""; - internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) + internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) { // Try to parse the URL to ensure that it conforms the IETF RFC 1738: Uniform Resource Locators if (!Uri.TryCreate(value, UriKind.Absolute, out Uri uri)) @@ -49,7 +49,7 @@ internal override BaseCardPartInfo FromStringVcardInternal(string value, string[ value = uri.ToString(); // Populate the fields - UrlInfo _url = new(altId, finalArgs, elementTypes, valueType, value); + UrlInfo _url = new(altId, finalArgs, elementTypes, valueType, group, value); return _url; } @@ -105,8 +105,8 @@ internal override bool EqualsInternal(BaseCardPartInfo source, BaseCardPartInfo internal UrlInfo() { } - internal UrlInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string url) : - base(arguments, altId, elementTypes, valueType) + internal UrlInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string group, string url) : + base(arguments, altId, elementTypes, valueType, group) { Url = url; } diff --git a/VisualCard/Parts/Implementations/XNameInfo.cs b/VisualCard/Parts/Implementations/XNameInfo.cs index 4b66f155..fcb6cf89 100644 --- a/VisualCard/Parts/Implementations/XNameInfo.cs +++ b/VisualCard/Parts/Implementations/XNameInfo.cs @@ -40,13 +40,13 @@ public class XNameInfo : BaseCardPartInfo, IEquatable /// public string[]? XValues { get; } - internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) => - new XNameInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, valueType, cardVersion); + internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) => + new XNameInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, group, valueType, cardVersion); internal override string ToStringVcardInternal(Version cardVersion) => string.Join(VcardConstants._fieldDelimiter.ToString(), XValues); - internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) + internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) { string xValue = value.Substring(VcardConstants._xSpecifier.Length); string[] splitX = xValue.Split(VcardConstants._argumentDelimiter); @@ -58,7 +58,7 @@ internal override BaseCardPartInfo FromStringVcardInternal(string value, string[ // Populate the fields string[] _xValues = splitX[1].Split(VcardConstants._fieldDelimiter); - XNameInfo _x = new(altId, finalArgs, elementTypes, valueType, _xName, _xValues); + XNameInfo _x = new(altId, finalArgs, elementTypes, valueType, group, _xName, _xValues); return _x; } @@ -116,8 +116,8 @@ internal override bool EqualsInternal(BaseCardPartInfo source, BaseCardPartInfo internal XNameInfo() { } - internal XNameInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string xKeyName, string[] xValues) : - base(arguments, altId, elementTypes, valueType) + internal XNameInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string group, string xKeyName, string[] xValues) : + base(arguments, altId, elementTypes, valueType, group) { XKeyName = xKeyName; XValues = xValues; diff --git a/VisualCard/Parts/Implementations/XmlInfo.cs b/VisualCard/Parts/Implementations/XmlInfo.cs index c63a5fb0..6f04e804 100644 --- a/VisualCard/Parts/Implementations/XmlInfo.cs +++ b/VisualCard/Parts/Implementations/XmlInfo.cs @@ -40,13 +40,13 @@ public class XmlInfo : BaseCardPartInfo, IEquatable /// public string? XmlString { get; } - internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) => - new XmlInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, valueType, cardVersion); + internal static BaseCardPartInfo FromStringVcardStatic(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) => + new XmlInfo().FromStringVcardInternal(value, finalArgs, altId, elementTypes, group, valueType, cardVersion); internal override string ToStringVcardInternal(Version cardVersion) => XmlString ?? ""; - internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string valueType, Version cardVersion) + internal override BaseCardPartInfo FromStringVcardInternal(string value, string[] finalArgs, int altId, string[] elementTypes, string group, string valueType, Version cardVersion) { // Check to see if the XML document is valid or not string finalXml = @@ -60,7 +60,7 @@ internal override BaseCardPartInfo FromStringVcardInternal(string value, string[ doc.LoadXml(finalXml); // Add the fetched information - XmlInfo _xml = new(altId, finalArgs, elementTypes, valueType, doc, value); + XmlInfo _xml = new(altId, finalArgs, elementTypes, valueType, group, doc, value); return _xml; } @@ -117,8 +117,8 @@ internal override bool EqualsInternal(BaseCardPartInfo source, BaseCardPartInfo internal XmlInfo() { } - internal XmlInfo(int altId, string[] arguments, string[] elementTypes, string valueType, XmlDocument xml, string xmlString) : - base(arguments, altId, elementTypes, valueType) + internal XmlInfo(int altId, string[] arguments, string[] elementTypes, string valueType, string group, XmlDocument xml, string xmlString) : + base(arguments, altId, elementTypes, valueType, group) { Xml = xml; XmlString = xmlString;