예제 #1
0
        public void LoadPackage(IPackage package, IPackageRepository repo, NuGetForm.task task, bool isInstalled)
        {
            if (package == null)
            {
                return;
            }
            this.Dock = DockStyle.Fill;

            if (task == NuGetForm.task.browse)
            {
                SetBrowse(isInstalled);
            }
            if (task == NuGetForm.task.installed)
            {
                SetInstalled(package);
            }
            this.tasks   = task;
            this.package = package;
            pLabel.Text  = package.GetFullName();
            LoadIcon();
            LoadDescription();
            List <IPackage> packages = NuGets.FindPackageById(package.Id, repo);

            cb.Items.Clear();
            foreach (IPackage p in packages)
            {
                cb.Items.Add(p.Version.ToFullString());
            }
        }
예제 #2
0
        public NuGetPacketShort(NuGetForm.task tasks = NuGetForm.task.none)
        {
            InitializeComponent();

            this.tasks = tasks;

            panel  = panel1;
            rb     = richTextBox1;
            button = pictureBox1;

            // this.Controls.Remove(panel);
            //this.Controls.Remove(button);

            rb.Resize += Rb_Resize;

            //rb.Controls.Add(button);
            //rb.Controls.Add(panel);

            //panel.Dock = DockStyle.Right;

            HookChildrenEvents(this);

            this.MouseLeave += NuGetPacketShort_MouseLeave;
            this.MouseEnter += NuGetPacketShort_MouseHover;
            this.MouseClick += NuGetPacketShort_MouseClick;

            vLabel = label1;

            uLabel = label2;

            pbInstall = pictureBox3;

            pbUpdate = pictureBox4;

            pbInstall.Visible = false;

            pbUpdate.Visible = false;

            pbInstall.MouseHover += PbInstall_MouseHover;

            pbUpdate.MouseHover += PbUpdate_MouseHover;

            this.Resize += NuGetPacketShort_Resize;

            rb.RightMargin = rb.Width - panel.Width - 5;
            SetHandlers(vLabel);
            SetHandlers(uLabel);
            if (tasks != NuGetForm.task.update)
            {
                LoadNoUpdate();
            }
            else
            {
                rb.SelectionIndent += 130;
            }

            this.AutoScroll             = false;
            this.VScroll                = false;
            this.VerticalScroll.Enabled = false;
        }
예제 #3
0
        private void UnloadUpdate(NuGetForm.task tasks = task.none)
        {
            return;

            if (tasks != task.update)
            {
                sp.Panel1.Controls.Remove(panel1);
                dg.Location = new Point(0, 0);
            }
            else
            {
                sp.Panel1.Controls.Add(panel1);
                panel1.Location    = new Point(0, 0);
                panel1.Width       = sp.Panel1.Width - 1;
                panel1.BorderStyle = BorderStyle.FixedSingle;
                dg.Location        = new Point(0, panel1.Height + 5);
            }
        }