Skip to content

Commit

Permalink
ref - Cleaned some more code
Browse files Browse the repository at this point in the history
---

Type: ref
Breaking: False
Doc Required: False
Backport Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Oct 3, 2024
1 parent 349215c commit d336b28
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
18 changes: 9 additions & 9 deletions VisualCard/Parsers/VcardCommonTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -609,32 +609,32 @@ internal static DateTimeOffset ParsePosixRepresentation(string posixDateRepresen
break;
case "UTC-OFFSET":
// Check the UTC offset
VcardCommonTools.ParseUtcOffset(finalValuePart);
ParseUtcOffset(finalValuePart);
break;
case "DATE":
// Check the date
if (!VcardCommonTools.TryParsePosixDate(finalValuePart, out _))
if (!TryParsePosixDate(finalValuePart, out _))
throw new InvalidDataException($"Date {finalValuePart} is invalid");
break;
case "TIME":
// Check the time
if (!VcardCommonTools.TryParsePosixTime(finalValuePart, out _))
if (!TryParsePosixTime(finalValuePart, out _))
throw new InvalidDataException($"Time {finalValuePart} is invalid");
break;
case "DATE-TIME":
// Check the date and time
if (!VcardCommonTools.TryParsePosixDateTime(finalValuePart, out _))
if (!TryParsePosixDateTime(finalValuePart, out _))
throw new InvalidDataException($"Date and time {finalValuePart} is invalid");
break;
case "DATE-AND-OR-TIME":
// Check the date and/or time
if (!VcardCommonTools.TryParsePosixDateTime(finalValuePart, out _) &&
!VcardCommonTools.TryParsePosixTime(finalValuePart, out _))
if (!TryParsePosixDateTime(finalValuePart, out _) &&
!TryParsePosixTime(finalValuePart, out _))
throw new InvalidDataException($"Date and/or time {finalValuePart} is invalid");
break;
case "TIMESTAMP":
// Check the timestamp
if (!VcardCommonTools.TryParsePosixTimestamp(finalValuePart, out _))
if (!TryParsePosixTimestamp(finalValuePart, out _))
throw new InvalidDataException($"Timestamp {finalValuePart} is invalid");
break;
case "BOOLEAN":
Expand All @@ -657,11 +657,11 @@ internal static DateTimeOffset ParsePosixRepresentation(string posixDateRepresen
break;
case "DURATION":
// Check the duration
VcardCommonTools.GetDurationSpan(finalValuePart);
GetDurationSpan(finalValuePart);
break;
case "PERIOD":
// Check the period
VcardCommonTools.GetTimePeriod(finalValuePart);
GetTimePeriod(finalValuePart);
break;
case "RECUR":
// Check the recursion rules
Expand Down
4 changes: 0 additions & 4 deletions VisualCard/Parts/Enums/CardKind.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//

using System;
using System.Collections.Generic;
using System.Text;

namespace VisualCard.Parts.Enums
{
/// <summary>
Expand Down

0 comments on commit d336b28

Please sign in to comment.