Beispiel #1
0
        /// <summary>Create <see cref="RemoteBranchMenu"/>.</summary>
        /// <param name="remoteTag">Remote branch, for which menu is generated.</param>
        public RemoteTagMenu(RemoteRepositoryTag remoteTag)
        {
            Verify.Argument.IsNotNull(remoteTag, nameof(remoteTag));
            Verify.Argument.IsFalse(remoteTag.IsDeleted, nameof(remoteTag),
                                    Resources.ExcObjectIsDeleted.UseAsFormat("RemoteTag"));

            RemoteTag = remoteTag;

            Items.Add(GuiItemFactory.GetRemoveRemoteTagItem <ToolStripMenuItem>(RemoteTag, "{0}"));

            var copyToClipboardItem = new ToolStripMenuItem(Resources.StrCopyToClipboard);

            copyToClipboardItem.DropDownItems.Add(GuiItemFactory.GetCopyToClipboardItem <ToolStripMenuItem>(
                                                      Resources.StrName, RemoteTag.Name));
            copyToClipboardItem.DropDownItems.Add(GuiItemFactory.GetCopyToClipboardItem <ToolStripMenuItem>(
                                                      Resources.StrFullName, RemoteTag.FullName));
            copyToClipboardItem.DropDownItems.Add(GuiItemFactory.GetCopyHashToClipboardItem <ToolStripMenuItem>(
                                                      Resources.StrPosition, RemoteTag.Hash.ToString()));
            Items.Add(copyToClipboardItem);
        }