Esempio n. 1
0
        private void S_nugetShortSelectedEvent(NuGetPacketShort sender)
        {
            NuGetPacketShort ng = sender as NuGetPacketShort;

            if (ng == null)
            {
                return;
            }
            IPackage package = ng.package;

            if (package == null)
            {
                return;
            }
            if (ns == null)
            {
                ns      = new NuGetPacketInfo(vs);
                ns.Dock = DockStyle.Fill;
                //sp.Panel2.Controls.Clear();
                sp.Panel2.Controls.Add(ns);
            }
            bool isInstalled = false;

            foreach (IPackage p in InstalledPackages)
            {
                if (p.GetFullName() == package.GetFullName())
                {
                    isInstalled = true;
                    break;
                }
            }

            ns.LoadPackage(package, repo, tasks, isInstalled);
        }
Esempio n. 2
0
        public void AddNugetPackageInfo(IPackage package, task tasks = task.none)
        {
            NuGetPacketShort s = new NuGetPacketShort(tasks);
            //s.Width = this.sp.Panel1.Width - 5;
            string text = "";

            foreach (string b in package.Authors)
            {
                text += " " + b;
            }

            s.SetMainText("" + package.GetFullName() + "  by " + text + "\n" + package.Description);
            s.SetAsBold(package.GetFullName());
            if (package.IconUrl != null)
            {
                try
                {
                    Bitmap icon = NuGets.GetIcon(package.IconUrl);//NuGets.NuGetUrl(package.IconUrl);
                    if (icon == null || icon.Width == 0)
                    {
                        icon = ve_resource.VSO_NugetLogo_52x;
                    }
                    s.SetIcon(icon);
                }
                catch (Exception ex)
                {
                }
            }
            else
            {
                Bitmap icon = ve_resource.VSO_NugetLogo_52x;
                s.SetIcon(icon);
            }
            if (package.Version != null)
            {
                s.SetVersion(package.Version.ToFullString());
            }
            else
            {
                s.SetVersion("");
            }
            s.nugetShortSelectedEvent += S_nugetShortSelectedEvent;

            s.SetPackage(package);
            s.AutoScroll = false;
            dg.AddControl(s);
            //dg.Refresh();
        }
Esempio n. 3
0
        public void LoadForVSProject()
        {
            NuGetPacketShort s = new NuGetPacketShort();

            s.Width = this.Width - 1;
            //s.Anchor = AnchorStyles.Left | AnchorStyles.Right;
            dg.Controls.Add(s);
            s = new NuGetPacketShort();
            //s.Anchor = AnchorStyles.Left | AnchorStyles.Right;
            s.Width = this.Width - 1;
            dg.Controls.Add(s);
            s       = new NuGetPacketShort();
            s.Width = this.Width - 1;
            //s.Anchor = AnchorStyles.Left | AnchorStyles.Right;
            dg.Controls.Add(s);
        }