using LibGit2Sharp.Core; namespace LibGit2Sharp { /// /// A TagAnnotation /// public class TagAnnotation : GitObject { private readonly GitObjectLazyGroup group; private readonly ILazy lazyTarget; private readonly ILazy lazyName; private readonly ILazy lazyMessage; private readonly ILazy lazyTagger; /// /// Needed for mocking purposes. /// protected TagAnnotation() { } internal TagAnnotation(Repository repo, ObjectId id) : base(id) { lazyName = GitObjectLazyGroup.Singleton(repo, id, Proxy.git_tag_name); lazyTarget = GitObjectLazyGroup.Singleton(repo, id, obj => GitObject.BuildFrom(repo, Proxy.git_tag_target_oid(obj), Proxy.git_tag_type(obj), null)); group = new GitObjectLazyGroup(repo, id); lazyTagger = group.AddLazy(Proxy.git_tag_tagger); lazyMessage = group.AddLazy(Proxy.git_tag_message); } /// /// Gets the name of this tag. /// public virtual string Name { get { return lazyName.Value; } } /// /// Gets the message of this tag. /// public virtual string Message { get { return lazyMessage.Value; } } /// /// Gets the that this tag annotation points to. /// public virtual GitObject Target { get { return lazyTarget.Value; } } /// /// Gets the tagger. /// public virtual Signature Tagger { get { return lazyTagger.Value; } } } }