-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Imazen.Common: Fix API breakage w/ BuildDateAttribute and CommitAttri…
…bute
- Loading branch information
Showing
4 changed files
with
68 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,31 @@ | ||
namespace Imazen.Common.Licensing | ||
namespace Imazen.Common.Licensing; | ||
|
||
[AttributeUsage(AttributeTargets.Assembly)] | ||
[Obsolete("Use Imazen.Abstractions.AssemblyAttributes.BuildDateAttribute instead")] | ||
public class BuildDateAttribute : Attribute | ||
{ | ||
[AttributeUsage(AttributeTargets.Assembly)] | ||
[Obsolete("Use Imazen.Abstractions.AssemblyAttributes.BuildDateAttribute instead")] | ||
public class BuildDateAttribute : Abstractions.AssemblyAttributes.BuildDateAttribute | ||
public BuildDateAttribute() { Value = string.Empty; } | ||
public BuildDateAttribute(string buildDateStringRoundTrip) { Value = buildDateStringRoundTrip; } | ||
|
||
public string Value { get; } | ||
|
||
public DateTimeOffset? ValueDate | ||
{ | ||
public BuildDateAttribute() | ||
{ } | ||
public BuildDateAttribute(string buildDateStringRoundTrip):base(buildDateStringRoundTrip) { } | ||
|
||
get | ||
{ | ||
DateTimeOffset v; | ||
if (DateTimeOffset.TryParse(Value, null, System.Globalization.DateTimeStyles.RoundtripKind, out v)) | ||
{ | ||
return v; | ||
}else | ||
{ | ||
return null; | ||
} | ||
} | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
return Value; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,24 @@ | ||
namespace Imazen.Common.Licensing | ||
{ | ||
|
||
[AttributeUsage(AttributeTargets.Assembly)] | ||
[Obsolete("Use Imazen.Abstractions.AssemblyAttributes.CommitAttribute instead")] | ||
public class CommitAttribute : Abstractions.AssemblyAttributes.CommitAttribute | ||
{ | ||
public CommitAttribute() | ||
{} | ||
|
||
public CommitAttribute(string commitId):base(commitId){} | ||
} | ||
} | ||
namespace Imazen.Common.Licensing; | ||
|
||
[AttributeUsage(AttributeTargets.Assembly)] | ||
[Obsolete("Use Imazen.Abstractions.AssemblyAttributes.CommitAttribute instead")] | ||
public class CommitAttribute : Attribute | ||
{ | ||
private readonly string commitId; | ||
public CommitAttribute() | ||
{ | ||
commitId = string.Empty; | ||
} | ||
|
||
public CommitAttribute(string commitId) | ||
{ | ||
this.commitId = commitId; | ||
} | ||
|
||
public string Value => commitId; | ||
|
||
public override string ToString() | ||
{ | ||
return commitId; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters