public void AddArtifact(
string location,
string tag,
bool update = true)
{
Contract.Requires(location != null);
// TODO: determine how to handle empty tags
if (update && !string.IsNullOrWhiteSpace(tag))
{
var oldArtifact = this.Artifacts.FirstOrDefault(x => x.Tag == tag);
if (oldArtifact != null)
{
this.Artifacts.Remove(oldArtifact);
}
}
Artifact artifact = new Artifact();
artifact.Location = location;
artifact.Tag = tag;
this.Artifacts.Add(artifact);
}