Skip to content

Commit

Permalink
[RPC-32] Use VCard Constants to maintain consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
AptiviCEO committed Apr 1, 2023
1 parent 2601dbc commit 2d83c79
Show file tree
Hide file tree
Showing 15 changed files with 70 additions and 70 deletions.
8 changes: 4 additions & 4 deletions VisualCard/Parts/AddressInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ internal string ToStringVcardTwo()
{
return
$"{VcardConstants._addressSpecifierWithType}" +
$"TYPE={string.Join(",", AddressTypes)}{VcardConstants._argumentDelimiter}" +
$"{VcardConstants._typeArgumentSpecifier}{string.Join(",", AddressTypes)}{VcardConstants._argumentDelimiter}" +
$"{PostOfficeBox}{VcardConstants._fieldDelimiter}" +
$"{ExtendedAddress}{VcardConstants._fieldDelimiter}" +
$"{StreetAddress}{VcardConstants._fieldDelimiter}" +
Expand All @@ -147,7 +147,7 @@ internal string ToStringVcardThree()
{
return
$"{VcardConstants._addressSpecifierWithType}" +
$"TYPE={string.Join(",", AddressTypes)}{VcardConstants._argumentDelimiter}" +
$"{VcardConstants._typeArgumentSpecifier}{string.Join(",", AddressTypes)}{VcardConstants._argumentDelimiter}" +
$"{PostOfficeBox}{VcardConstants._fieldDelimiter}" +
$"{ExtendedAddress}{VcardConstants._fieldDelimiter}" +
$"{StreetAddress}{VcardConstants._fieldDelimiter}" +
Expand All @@ -162,8 +162,8 @@ internal string ToStringVcardFour()
bool installAltId = AltId >= 0 && AltArguments.Length > 0;
return
$"{VcardConstants._addressSpecifierWithType}" +
$"{(installAltId ? "ALTID=" + AltId + VcardConstants._fieldDelimiter : "")}" +
$"TYPE={string.Join(",", AddressTypes)}{VcardConstants._argumentDelimiter}" +
$"{(installAltId ? VcardConstants._altIdArgumentSpecifier + AltId + VcardConstants._fieldDelimiter : "")}" +
$"{VcardConstants._typeArgumentSpecifier}{string.Join(",", AddressTypes)}{VcardConstants._argumentDelimiter}" +
$"{PostOfficeBox}{VcardConstants._fieldDelimiter}" +
$"{ExtendedAddress}{VcardConstants._fieldDelimiter}" +
$"{StreetAddress}{VcardConstants._fieldDelimiter}" +
Expand Down
8 changes: 4 additions & 4 deletions VisualCard/Parts/EmailInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ internal string ToStringVcardTwo()
{
return
$"{VcardConstants._emailSpecifier}" +
$"TYPE={string.Join(",", ContactEmailTypes)}{VcardConstants._argumentDelimiter}" +
$"{VcardConstants._typeArgumentSpecifier}{string.Join(",", ContactEmailTypes)}{VcardConstants._argumentDelimiter}" +
$"{ContactEmailAddress}";
}

internal string ToStringVcardThree()
{
return
$"{VcardConstants._emailSpecifier}" +
$"TYPE={string.Join(",", ContactEmailTypes)}{VcardConstants._argumentDelimiter}" +
$"{VcardConstants._typeArgumentSpecifier}{string.Join(",", ContactEmailTypes)}{VcardConstants._argumentDelimiter}" +
$"{ContactEmailAddress}";
}

Expand All @@ -112,8 +112,8 @@ internal string ToStringVcardFour()
bool installAltId = AltId >= 0 && AltArguments.Length > 0;
return
$"{VcardConstants._emailSpecifier}" +
$"{(installAltId ? "ALTID=" + AltId + VcardConstants._fieldDelimiter : "")}" +
$"TYPE={string.Join(",", ContactEmailTypes)}{VcardConstants._argumentDelimiter}" +
$"{(installAltId ? VcardConstants._altIdArgumentSpecifier + AltId + VcardConstants._fieldDelimiter : "")}" +
$"{VcardConstants._typeArgumentSpecifier}{string.Join(",", ContactEmailTypes)}{VcardConstants._argumentDelimiter}" +
$"{ContactEmailAddress}";
}

Expand Down
2 changes: 1 addition & 1 deletion VisualCard/Parts/GeoInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ internal string ToStringVcardFour()
bool installAltId = AltId >= 0 && AltArguments.Length > 0;
return
$"{(installAltId ? VcardConstants._geoSpecifierWithType : VcardConstants._geoSpecifier)}" +
$"{(installAltId ? "ALTID=" + AltId + VcardConstants._fieldDelimiter : "")}" +
$"{(installAltId ? VcardConstants._altIdArgumentSpecifier + AltId + VcardConstants._fieldDelimiter : "")}" +
$"{(installAltId ? string.Join(VcardConstants._fieldDelimiter.ToString(), AltArguments) + VcardConstants._argumentDelimiter : "")}" +
$"{Geo}";
}
Expand Down
6 changes: 3 additions & 3 deletions VisualCard/Parts/ImppInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ internal string ToStringVcardTwo()
{
return
$"{VcardConstants._imppSpecifierWithType}" +
$"TYPE={string.Join(",", ImppTypes)}{VcardConstants._argumentDelimiter}" +
$"{VcardConstants._typeArgumentSpecifier}{string.Join(",", ImppTypes)}{VcardConstants._argumentDelimiter}" +
$"{ContactIMPP}";
}

internal string ToStringVcardThree()
{
return
$"{VcardConstants._imppSpecifierWithType}" +
$"TYPE={string.Join(",", ImppTypes)}{VcardConstants._argumentDelimiter}" +
$"{VcardConstants._typeArgumentSpecifier}{string.Join(",", ImppTypes)}{VcardConstants._argumentDelimiter}" +
$"{ContactIMPP}";
}

Expand All @@ -112,7 +112,7 @@ internal string ToStringVcardFour()
bool installAltId = AltId >= 0 && AltArguments.Length > 0;
return
$"{(installAltId ? VcardConstants._imppSpecifierWithType : VcardConstants._imppSpecifier)}" +
$"{(installAltId ? "ALTID=" + AltId + VcardConstants._fieldDelimiter : "")}" +
$"{(installAltId ? VcardConstants._altIdArgumentSpecifier + AltId + VcardConstants._fieldDelimiter : "")}" +
$"{(installAltId ? string.Join(VcardConstants._fieldDelimiter.ToString(), AltArguments) + VcardConstants._argumentDelimiter : "")}" +
$"{ContactIMPP}";
}
Expand Down
28 changes: 14 additions & 14 deletions VisualCard/Parts/LogoInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,16 @@ internal string ToStringVcardTwo()
{
return
$"{VcardConstants._logoSpecifierWithType}" +
$"VALUE={ValueType}{VcardConstants._argumentDelimiter}" +
$"{VcardConstants._valueArgumentSpecifier}{ValueType}{VcardConstants._argumentDelimiter}" +
$"{LogoEncoded}";
}
else
{
string logoArgsLine =
$"{VcardConstants._logoSpecifierWithType}" +
$"VALUE={ValueType}{VcardConstants._fieldDelimiter}" +
$"ENCODING={Encoding}{VcardConstants._fieldDelimiter}" +
$"TYPE={LogoType}{VcardConstants._argumentDelimiter}";
$"{VcardConstants._valueArgumentSpecifier}{ValueType}{VcardConstants._fieldDelimiter}" +
$"{VcardConstants._encodingArgumentSpecifier}{Encoding}{VcardConstants._fieldDelimiter}" +
$"{VcardConstants._typeArgumentSpecifier}{LogoType}{VcardConstants._argumentDelimiter}";
return logoArgsLine + BaseVcardParser.MakeStringBlock(LogoEncoded, logoArgsLine.Length);
}
}
Expand All @@ -132,16 +132,16 @@ internal string ToStringVcardThree()
{
return
$"{VcardConstants._logoSpecifierWithType}" +
$"VALUE={ValueType}{VcardConstants._argumentDelimiter}" +
$"{VcardConstants._valueArgumentSpecifier}{ValueType}{VcardConstants._argumentDelimiter}" +
$"{LogoEncoded}";
}
else
{
string logoArgsLine =
$"{VcardConstants._logoSpecifierWithType}" +
$"VALUE={ValueType}{VcardConstants._fieldDelimiter}" +
$"ENCODING={Encoding}{VcardConstants._fieldDelimiter}" +
$"TYPE={LogoType}{VcardConstants._argumentDelimiter}";
$"{VcardConstants._valueArgumentSpecifier}{ValueType}{VcardConstants._fieldDelimiter}" +
$"{VcardConstants._encodingArgumentSpecifier}{Encoding}{VcardConstants._fieldDelimiter}" +
$"{VcardConstants._typeArgumentSpecifier}{LogoType}{VcardConstants._argumentDelimiter}";
return logoArgsLine + BaseVcardParser.MakeStringBlock(LogoEncoded, logoArgsLine.Length);
}
}
Expand All @@ -153,20 +153,20 @@ internal string ToStringVcardFour()
{
return
$"{VcardConstants._logoSpecifierWithType}" +
$"{(installAltId ? "ALTID=" + AltId + VcardConstants._fieldDelimiter : "")}" +
$"{(installAltId ? VcardConstants._altIdArgumentSpecifier + AltId + VcardConstants._fieldDelimiter : "")}" +
$"{(installAltId ? string.Join(VcardConstants._fieldDelimiter.ToString(), AltArguments) + VcardConstants._fieldDelimiter : "")}" +
$"VALUE={ValueType}{VcardConstants._argumentDelimiter}" +
$"{VcardConstants._valueArgumentSpecifier}{ValueType}{VcardConstants._argumentDelimiter}" +
$"{LogoEncoded}";
}
else
{
string logoArgsLine =
$"{VcardConstants._logoSpecifierWithType}" +
$"{(installAltId ? "ALTID=" + AltId + VcardConstants._fieldDelimiter : "")}" +
$"{(installAltId ? VcardConstants._altIdArgumentSpecifier + AltId + VcardConstants._fieldDelimiter : "")}" +
$"{(installAltId ? string.Join(VcardConstants._fieldDelimiter.ToString(), AltArguments) + VcardConstants._fieldDelimiter : "")}" +
$"VALUE={ValueType}{VcardConstants._fieldDelimiter}" +
$"ENCODING={Encoding}{VcardConstants._fieldDelimiter}" +
$"TYPE={LogoType}{VcardConstants._argumentDelimiter}";
$"{VcardConstants._valueArgumentSpecifier}{ValueType}{VcardConstants._fieldDelimiter}" +
$"{VcardConstants._encodingArgumentSpecifier}{Encoding}{VcardConstants._fieldDelimiter}" +
$"{VcardConstants._typeArgumentSpecifier}{LogoType}{VcardConstants._argumentDelimiter}";
return logoArgsLine + BaseVcardParser.MakeStringBlock(LogoEncoded, logoArgsLine.Length);
}
}
Expand Down
2 changes: 1 addition & 1 deletion VisualCard/Parts/NameInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ internal string ToStringVcardFour()
string suffixesStr = string.Join(VcardConstants._valueDelimiter.ToString(), Suffixes);
return
$"{(installAltId ? VcardConstants._nameSpecifierWithType : VcardConstants._nameSpecifier)}" +
$"{(installAltId ? "ALTID=" + AltId + VcardConstants._fieldDelimiter : "")}" +
$"{(installAltId ? VcardConstants._altIdArgumentSpecifier + AltId + VcardConstants._fieldDelimiter : "")}" +
$"{(installAltId ? string.Join(VcardConstants._fieldDelimiter.ToString(), AltArguments) + VcardConstants._argumentDelimiter : "")}" +
$"{ContactLastName}{VcardConstants._fieldDelimiter}" +
$"{ContactFirstName}{VcardConstants._fieldDelimiter}" +
Expand Down
6 changes: 3 additions & 3 deletions VisualCard/Parts/NicknameInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ internal string ToStringVcardThree()
{
return
$"{VcardConstants._nicknameSpecifierWithType}" +
$"TYPE={string.Join(",", NicknameTypes)}{VcardConstants._argumentDelimiter}" +
$"{VcardConstants._typeArgumentSpecifier}{string.Join(",", NicknameTypes)}{VcardConstants._argumentDelimiter}" +
$"{ContactNickname}";
}

Expand All @@ -109,9 +109,9 @@ internal string ToStringVcardFour()
bool installAltId = AltId >= 0 && AltArguments.Length > 0;
return
$"{(installAltId ? VcardConstants._nicknameSpecifierWithType : VcardConstants._nicknameSpecifier)}" +
$"{(installAltId ? "ALTID=" + AltId + VcardConstants._fieldDelimiter : "")}" +
$"{(installAltId ? VcardConstants._altIdArgumentSpecifier + AltId + VcardConstants._fieldDelimiter : "")}" +
$"{(installAltId ? string.Join(VcardConstants._fieldDelimiter.ToString(), AltArguments) + VcardConstants._fieldDelimiter : "")}" +
$"TYPE={string.Join(",", NicknameTypes)}{VcardConstants._argumentDelimiter}" +
$"{VcardConstants._typeArgumentSpecifier}{string.Join(",", NicknameTypes)}{VcardConstants._argumentDelimiter}" +
$"{ContactNickname}";
}

Expand Down
8 changes: 4 additions & 4 deletions VisualCard/Parts/OrganizationInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ internal string ToStringVcardTwo()
bool installType = OrgTypes.Length > 0 && OrgTypes[0].ToUpper() != "WORK";
return
$"{(installType ? VcardConstants._orgSpecifierWithType : VcardConstants._orgSpecifier)}" +
$"{(installType ? $"TYPE={string.Join(",", OrgTypes)}{VcardConstants._argumentDelimiter}" : "")}" +
$"{(installType ? $"{VcardConstants._typeArgumentSpecifier}{string.Join(",", OrgTypes)}{VcardConstants._argumentDelimiter}" : "")}" +
$"{Name}{VcardConstants._fieldDelimiter}" +
$"{Unit}{VcardConstants._fieldDelimiter}" +
$"{Role}";
Expand All @@ -119,7 +119,7 @@ internal string ToStringVcardThree()
bool installType = OrgTypes.Length > 0 && OrgTypes[0].ToUpper() != "WORK";
return
$"{(installType ? VcardConstants._orgSpecifierWithType : VcardConstants._orgSpecifier)}" +
$"{(installType ? $"TYPE={string.Join(",", OrgTypes)}{VcardConstants._argumentDelimiter}" : "")}" +
$"{(installType ? $"{VcardConstants._typeArgumentSpecifier}{string.Join(",", OrgTypes)}{VcardConstants._argumentDelimiter}" : "")}" +
$"{Name}{VcardConstants._fieldDelimiter}" +
$"{Unit}{VcardConstants._fieldDelimiter}" +
$"{Role}";
Expand All @@ -131,8 +131,8 @@ internal string ToStringVcardFour()
bool installType = (installAltId || OrgTypes.Length > 0) && OrgTypes[0].ToUpper() != "WORK";
return
$"{(installType ? VcardConstants._orgSpecifierWithType : VcardConstants._orgSpecifier)}" +
$"{(installAltId ? "ALTID=" + AltId + (installType ? VcardConstants._fieldDelimiter : VcardConstants._argumentDelimiter) : "")}" +
$"{(installType ? $"TYPE={string.Join(",", OrgTypes)}{VcardConstants._argumentDelimiter}" : "")}" +
$"{(installAltId ? VcardConstants._altIdArgumentSpecifier + AltId + (installType ? VcardConstants._fieldDelimiter : VcardConstants._argumentDelimiter) : "")}" +
$"{(installType ? $"{VcardConstants._typeArgumentSpecifier}{string.Join(",", OrgTypes)}{VcardConstants._argumentDelimiter}" : "")}" +
$"{Name}{VcardConstants._fieldDelimiter}" +
$"{Unit}{VcardConstants._fieldDelimiter}" +
$"{Role}";
Expand Down
28 changes: 14 additions & 14 deletions VisualCard/Parts/PhotoInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,16 @@ internal string ToStringVcardTwo()
{
return
$"{VcardConstants._photoSpecifierWithType}" +
$"VALUE={ValueType}{VcardConstants._argumentDelimiter}" +
$"{VcardConstants._valueArgumentSpecifier}{ValueType}{VcardConstants._argumentDelimiter}" +
$"{PhotoEncoded}";
}
else
{
string photoArgsLine =
$"{VcardConstants._photoSpecifierWithType}" +
$"VALUE={ValueType}{VcardConstants._fieldDelimiter}" +
$"ENCODING={Encoding}{VcardConstants._fieldDelimiter}" +
$"TYPE={PhotoType}{VcardConstants._argumentDelimiter}";
$"{VcardConstants._valueArgumentSpecifier}{ValueType}{VcardConstants._fieldDelimiter}" +
$"{VcardConstants._encodingArgumentSpecifier}{Encoding}{VcardConstants._fieldDelimiter}" +
$"{VcardConstants._typeArgumentSpecifier}{PhotoType}{VcardConstants._argumentDelimiter}";
return photoArgsLine + BaseVcardParser.MakeStringBlock(PhotoEncoded, photoArgsLine.Length);
}
}
Expand All @@ -132,16 +132,16 @@ internal string ToStringVcardThree()
{
return
$"{VcardConstants._photoSpecifierWithType}" +
$"VALUE={ValueType}{VcardConstants._argumentDelimiter}" +
$"{VcardConstants._valueArgumentSpecifier}{ValueType}{VcardConstants._argumentDelimiter}" +
$"{PhotoEncoded}";
}
else
{
string photoArgsLine =
$"{VcardConstants._photoSpecifierWithType}" +
$"VALUE={ValueType}{VcardConstants._fieldDelimiter}" +
$"ENCODING={Encoding}{VcardConstants._fieldDelimiter}" +
$"TYPE={PhotoType}{VcardConstants._argumentDelimiter}";
$"{VcardConstants._valueArgumentSpecifier}{ValueType}{VcardConstants._fieldDelimiter}" +
$"{VcardConstants._encodingArgumentSpecifier}{Encoding}{VcardConstants._fieldDelimiter}" +
$"{VcardConstants._typeArgumentSpecifier}{PhotoType}{VcardConstants._argumentDelimiter}";
return photoArgsLine + BaseVcardParser.MakeStringBlock(PhotoEncoded, photoArgsLine.Length);
}
}
Expand All @@ -153,20 +153,20 @@ internal string ToStringVcardFour()
{
return
$"{VcardConstants._photoSpecifierWithType}" +
$"{(installAltId ? "ALTID=" + AltId + VcardConstants._fieldDelimiter : "")}" +
$"{(installAltId ? VcardConstants._altIdArgumentSpecifier + AltId + VcardConstants._fieldDelimiter : "")}" +
$"{(installAltId ? string.Join(VcardConstants._fieldDelimiter.ToString(), AltArguments) + VcardConstants._fieldDelimiter : "")}" +
$"VALUE={ValueType}{VcardConstants._argumentDelimiter}" +
$"{VcardConstants._valueArgumentSpecifier}{ValueType}{VcardConstants._argumentDelimiter}" +
$"{PhotoEncoded}";
}
else
{
string photoArgsLine =
$"{VcardConstants._photoSpecifierWithType}" +
$"{(installAltId ? "ALTID=" + AltId + VcardConstants._fieldDelimiter : "")}" +
$"{(installAltId ? VcardConstants._altIdArgumentSpecifier + AltId + VcardConstants._fieldDelimiter : "")}" +
$"{(installAltId ? string.Join(VcardConstants._fieldDelimiter.ToString(), AltArguments) + VcardConstants._fieldDelimiter : "")}" +
$"VALUE={ValueType}{VcardConstants._fieldDelimiter}" +
$"ENCODING={Encoding}{VcardConstants._fieldDelimiter}" +
$"TYPE={PhotoType}{VcardConstants._argumentDelimiter}";
$"{VcardConstants._valueArgumentSpecifier}{ValueType}{VcardConstants._fieldDelimiter}" +
$"{VcardConstants._encodingArgumentSpecifier}{Encoding}{VcardConstants._fieldDelimiter}" +
$"{VcardConstants._typeArgumentSpecifier}{PhotoType}{VcardConstants._argumentDelimiter}";
return photoArgsLine + BaseVcardParser.MakeStringBlock(PhotoEncoded, photoArgsLine.Length);
}
}
Expand Down
2 changes: 1 addition & 1 deletion VisualCard/Parts/RoleInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ internal string ToStringVcardFour()
bool installAltId = AltId >= 0 && AltArguments.Length > 0;
return
$"{(installAltId ? VcardConstants._roleSpecifierWithType : VcardConstants._roleSpecifier)}" +
$"{(installAltId ? "ALTID=" + AltId + VcardConstants._fieldDelimiter : "")}" +
$"{(installAltId ? VcardConstants._altIdArgumentSpecifier + AltId + VcardConstants._fieldDelimiter : "")}" +
$"{(installAltId ? string.Join(VcardConstants._fieldDelimiter.ToString(), AltArguments) + VcardConstants._argumentDelimiter : "")}" +
$"{ContactRole}";
}
Expand Down
Loading

0 comments on commit 2d83c79

Please sign in to comment.