Skip to content

Commit

Permalink
upd - Updated libraries
Browse files Browse the repository at this point in the history
---

Type: upd
Breaking: False
Doc Required: False
Backport Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Sep 11, 2024
1 parent e446f98 commit ce58007
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 38 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="MSTest.Sdk/3.5.2">
<Project Sdk="MSTest.Sdk/3.6.0">

<PropertyGroup>
<OutputPath>..\KSTest\</OutputPath>
Expand Down
2 changes: 1 addition & 1 deletion private/Nitrocid.Tests/Nitrocid.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="MSTest.Sdk/3.5.2">
<Project Sdk="MSTest.Sdk/3.6.0">

<PropertyGroup>
<OutputPath>KSTest\</OutputPath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,81 +73,81 @@ public override int Execute(CommandParameters parameters, ref string variableVal
if (hasFullName)
{
TextWriters.Write("- " + Translate.DoTranslation("Contact name") + ": ", false, KernelColorType.ListEntry);
TextWriters.Write(contact.GetPartsArray<FullNameInfo>()[0].FullName, KernelColorType.ListValue);
TextWriters.Write(contact.GetPartsArray<FullNameInfo>()[0].FullName ?? "", KernelColorType.ListValue);
}
if (hasName)
{
TextWriters.Write(" - " + Translate.DoTranslation("First name") + ": ", false, KernelColorType.ListEntry);
TextWriters.Write(contact.GetPartsArray<NameInfo>()[0].ContactFirstName, KernelColorType.ListValue);
TextWriters.Write(contact.GetPartsArray<NameInfo>()[0].ContactFirstName ?? "", KernelColorType.ListValue);
TextWriters.Write(" - " + Translate.DoTranslation("Last name") + ": ", false, KernelColorType.ListEntry);
TextWriters.Write(contact.GetPartsArray<NameInfo>()[0].ContactLastName, KernelColorType.ListValue);
TextWriters.Write(contact.GetPartsArray<NameInfo>()[0].ContactLastName ?? "", KernelColorType.ListValue);
}
if (hasAddress)
{
var address = contact.GetPartsArray<AddressInfo>()[0];
string street = address.StreetAddress;
string postal = address.PostalCode;
string poBox = address.PostOfficeBox;
string extended = address.ExtendedAddress;
string locality = address.Locality;
string region = address.Region;
string country = address.Country;
string street = address.StreetAddress ?? "";
string postal = address.PostalCode ?? "";
string poBox = address.PostOfficeBox ?? "";
string extended = address.ExtendedAddress ?? "";
string locality = address.Locality ?? "";
string region = address.Region ?? "";
string country = address.Country ?? "";
TextWriters.Write(" - " + Translate.DoTranslation("Contact address") + ": ", false, KernelColorType.ListEntry);
TextWriters.Write($"{street}, {postal}, {poBox}, {extended}, {locality}, {region}, {country}", KernelColorType.ListValue);
}
if (hasMail)
{
TextWriters.Write(" - " + Translate.DoTranslation("Contact mail") + ": ", false, KernelColorType.ListEntry);
TextWriters.Write(contact.GetPartsArray<EmailInfo>()[0].ContactEmailAddress, KernelColorType.ListValue);
TextWriters.Write(contact.GetPartsArray<EmailInfo>()[0].ContactEmailAddress ?? "", KernelColorType.ListValue);
}
if (hasOrganization)
{
var org = contact.GetPartsArray<OrganizationInfo>()[0];
string name = org.Name;
string unit = org.Unit;
string role = org.Role;
string name = org.Name ?? "";
string unit = org.Unit ?? "";
string role = org.Role ?? "";
TextWriters.Write(" - " + Translate.DoTranslation("Contact organization") + ": ", false, KernelColorType.ListEntry);
TextWriters.Write($"{name}, {unit}, {role}", KernelColorType.ListValue);
}
if (hasTelephone)
{
TextWriters.Write(" - " + Translate.DoTranslation("Contact telephone") + ": ", false, KernelColorType.ListEntry);
TextWriters.Write(contact.GetPartsArray<TelephoneInfo>()[0].ContactPhoneNumber, KernelColorType.ListValue);
TextWriters.Write(contact.GetPartsArray<TelephoneInfo>()[0].ContactPhoneNumber ?? "", KernelColorType.ListValue);
}
if (hasURL)
{
TextWriters.Write(" - " + Translate.DoTranslation("Contact URL") + ": ", false, KernelColorType.ListEntry);
TextWriters.Write(contact.GetPartsArray<UrlInfo>()[0].Url, KernelColorType.ListValue);
TextWriters.Write(contact.GetPartsArray<UrlInfo>()[0].Url ?? "", KernelColorType.ListValue);
}
if (hasGeo)
{
TextWriters.Write(" - " + Translate.DoTranslation("Contact Geo") + ": ", false, KernelColorType.ListEntry);
TextWriters.Write(contact.GetPartsArray<GeoInfo>()[0].Geo, KernelColorType.ListValue);
TextWriters.Write(contact.GetPartsArray<GeoInfo>()[0].Geo ?? "", KernelColorType.ListValue);
}
if (hasImpp)
{
TextWriters.Write(" - " + Translate.DoTranslation("Contact IMPP") + ": ", false, KernelColorType.ListEntry);
TextWriters.Write(contact.GetPartsArray<ImppInfo>()[0].ContactIMPP, KernelColorType.ListValue);
TextWriters.Write(contact.GetPartsArray<ImppInfo>()[0].ContactIMPP ?? "", KernelColorType.ListValue);
}
if (hasNickname)
{
TextWriters.Write(" - " + Translate.DoTranslation("Contact nickname") + ": ", false, KernelColorType.ListEntry);
TextWriters.Write(contact.GetPartsArray<NicknameInfo>()[0].ContactNickname, KernelColorType.ListValue);
TextWriters.Write(contact.GetPartsArray<NicknameInfo>()[0].ContactNickname ?? "", KernelColorType.ListValue);
}
if (hasRoles)
{
TextWriters.Write(" - " + Translate.DoTranslation("Contact role") + ": ", false, KernelColorType.ListEntry);
TextWriters.Write(contact.GetPartsArray<RoleInfo>()[0].ContactRole, KernelColorType.ListValue);
TextWriters.Write(contact.GetPartsArray<RoleInfo>()[0].ContactRole ?? "", KernelColorType.ListValue);
}
if (hasTitles)
{
TextWriters.Write(" - " + Translate.DoTranslation("Contact title") + ": ", false, KernelColorType.ListEntry);
TextWriters.Write(contact.GetPartsArray<TitleInfo>()[0].ContactTitle, KernelColorType.ListValue);
TextWriters.Write(contact.GetPartsArray<TitleInfo>()[0].ContactTitle ?? "", KernelColorType.ListValue);
}
if (hasNotes)
{
TextWriters.Write(" - " + Translate.DoTranslation("Contact note") + ": ", false, KernelColorType.ListEntry);
TextWriters.Write(contact.GetPartsArray<NoteInfo>()[0].Note, KernelColorType.ListValue);
TextWriters.Write(contact.GetPartsArray<NoteInfo>()[0].Note ?? "", KernelColorType.ListValue);
}
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ public static Card GetContact(int contactIndex)
cachedSearchExpression = expression;

// Get the list of cards satisfying the expression
var satisfiedCards = cards.Where((card) => RegexpTools.IsMatch(card.GetPartsArray<FullNameInfo>()[0].FullName, expression)).ToArray();
var satisfiedCards = cards.Where((card) => RegexpTools.IsMatch(card.GetPartsArray<FullNameInfo>()[0].FullName ?? "", expression)).ToArray();

// Return a card if the index is valid
if (satisfiedCards.Length > 0)
Expand Down Expand Up @@ -381,7 +381,7 @@ public static Card GetContact(int contactIndex)
throw new KernelException(KernelExceptionType.Contacts, Translate.DoTranslation("Regular expression is invalid."));

// Get the list of cards satisfying the expression
var satisfiedCards = cards.Where((card) => RegexpTools.IsMatch(card.GetPartsArray<FullNameInfo>()[0].FullName, expression)).ToArray();
var satisfiedCards = cards.Where((card) => RegexpTools.IsMatch(card.GetPartsArray<FullNameInfo>()[0].FullName ?? "", expression)).ToArray();

// Compare between the cached expression and the given expression
if (expression == cachedSearchExpression)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public override string GetEntryFromItem(Card item)
Card contact = item;
if (contact is null)
return "";
return contact.GetPartsArray<FullNameInfo>()[0].FullName;
return contact.GetPartsArray<FullNameInfo>()[0].FullName ?? "";
}

internal void RemoveContact(int index) =>
Expand Down Expand Up @@ -310,13 +310,13 @@ internal string GetContactAddressFinal(Card card)

var address = card.GetPartsArray<AddressInfo>()[0];
List<string> fullElements = [];
string street = address.StreetAddress;
string postal = address.PostalCode;
string poBox = address.PostOfficeBox;
string extended = address.ExtendedAddress;
string locality = address.Locality;
string region = address.Region;
string country = address.Country;
string street = address.StreetAddress ?? "";
string postal = address.PostalCode ?? "";
string poBox = address.PostOfficeBox ?? "";
string extended = address.ExtendedAddress ?? "";
string locality = address.Locality ?? "";
string region = address.Region ?? "";
string country = address.Country ?? "";
if (!string.IsNullOrEmpty(street))
fullElements.Add(street);
if (!string.IsNullOrEmpty(postal))
Expand Down Expand Up @@ -381,9 +381,9 @@ internal string GetContactOrganizationFinal(Card card)

var org = card.GetPartsArray<OrganizationInfo>()[0];
List<string> fullElements = [];
string name = org.Name;
string unit = org.Unit;
string role = org.Role;
string name = org.Name ?? "";
string unit = org.Unit ?? "";
string role = org.Role ?? "";
if (!string.IsNullOrEmpty(name))
fullElements.Add(name);
if (!string.IsNullOrEmpty(unit))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<!-- Extras.Contacts addon Platform Information End -->

<ItemGroup>
<PackageReference Include="VisualCard" Version="2.0.0" />
<PackageReference Include="VisualCard" Version="2.1.0" />
</ItemGroup>

</Project>

0 comments on commit ce58007

Please sign in to comment.