Skip to content

Commit

Permalink
Constant usage consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
Rian Stockbower committed Nov 9, 2017
1 parent bc91b0d commit 88e8ea9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
18 changes: 9 additions & 9 deletions net-core/Ical.Net/Ical.Net/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ public static class Components

public static class EventParticipationStatus
{
public const string ParticipationStatus = "PARTSTAT";
public const string Name = "PARTSTAT";
public const string Key = "PARTSTAT";
public static readonly StringComparison Comparison = StringComparison.Ordinal;

/// <summary> Event needs action </summary>
public const string NeedsAction = "NEEDS-ACTION";
Expand All @@ -51,13 +53,14 @@ public static class EventParticipationStatus
/// <summary> Event delegated </summary>
public const string Delegated = "DELEGATED";

public static string ParamName => ParticipationStatus;
public static string Default => NeedsAction;
}

public static class ToDoParticipationStatus
{
public const string ParticipationStatus = "PARTSTAT";
public const string Name = "PARTSTAT";
public const string Key = "PARTSTAT";
public static readonly StringComparison Comparison = StringComparison.Ordinal;

/// <summary> To-do needs action </summary>
public const string NeedsAction = "NEEDS-ACTION";
Expand All @@ -74,22 +77,19 @@ public static class ToDoParticipationStatus
/// <summary> To-do in process </summary>
public const string InProcess = "IN-PROCESS";

public static string ParamName => ParticipationStatus;
public static string Default => NeedsAction;
}

public static class JournalParticipationStatus
{
public const string ParticipationStatus = "PARTSTAT";
public const string Name = "PARTSTAT";
public const string Key = "PARTSTAT";
public static readonly StringComparison Comparison = StringComparison.Ordinal;

/// <summary> Event needs action </summary>
public const string NeedsAction = "NEEDS-ACTION";
/// <summary> Event accepted </summary>
public const string Accepted = "ACCEPTED";
/// <summary> Event declined </summary>
public const string Declined = "DECLINED";

public static string ParamName => ParticipationStatus;
public static string Default => NeedsAction;
}

Expand Down
6 changes: 3 additions & 3 deletions net-core/Ical.Net/Ical.Net/DataTypes/Attendee.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,18 +149,18 @@ public virtual string ParticipationStatus
{
if (string.IsNullOrEmpty(_participationStatus))
{
_participationStatus = Parameters.Get("PARTSTAT");
_participationStatus = Parameters.Get(EventParticipationStatus.Key);
}
return _participationStatus;
}
set
{
if (string.Equals(_participationStatus, value, StringComparison.OrdinalIgnoreCase))
if (string.Equals(_participationStatus, value, EventParticipationStatus.Comparison))
{
return;
}
_participationStatus = value;
Parameters.Set("PARTSTAT", value);
Parameters.Set(EventParticipationStatus.Key, value);
}
}

Expand Down

0 comments on commit 88e8ea9

Please sign in to comment.