예제 #1
0
파일: RemoteMenu.cs 프로젝트: oqewok/gitter
        public RemoteMenu(Remote remote)
        {
            Verify.Argument.IsValidGitObject(remote, "remote");

            _remote = remote;

            Items.Add(GuiItemFactory.GetShowRemoteItem <ToolStripMenuItem>(remote));
            Items.Add(GuiItemFactory.GetEditRemotePropertiesItem <ToolStripMenuItem>(remote));

            Items.Add(new ToolStripSeparator());

            Items.Add(GuiItemFactory.GetFetchFromItem <ToolStripMenuItem>(remote, "{0}"));
            Items.Add(GuiItemFactory.GetPullFromItem <ToolStripMenuItem>(remote, "{0}"));
            Items.Add(GuiItemFactory.GetPruneRemoteItem <ToolStripMenuItem>(remote, "{0}"));

            Items.Add(new ToolStripSeparator());

            Items.Add(GuiItemFactory.GetRemoveRemoteItem <ToolStripMenuItem>(remote, "{0}"));
            Items.Add(GuiItemFactory.GetRenameRemoteItem <ToolStripMenuItem>(remote, "{0}"));

            Items.Add(new ToolStripSeparator());

            var item = new ToolStripMenuItem(Resources.StrCopyToClipboard);

            item.DropDownItems.Add(GuiItemFactory.GetCopyToClipboardItem <ToolStripMenuItem>(Resources.StrName, remote.Name));
            item.DropDownItems.Add(GuiItemFactory.GetCopyToClipboardItem <ToolStripMenuItem>(Resources.StrFetchUrl, remote.FetchUrl));
            item.DropDownItems.Add(GuiItemFactory.GetCopyToClipboardItem <ToolStripMenuItem>(Resources.StrPushUrl, remote.PushUrl));

            Items.Add(item);
        }