AVM.DDP.MetaTBManifest.AddArtifact C# (CSharp) Method

AddArtifact() public method

public AddArtifact ( string location, string tag, bool update = true ) : void
location string
tag string
update bool
return void
        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);
        }