Beispiel #1
0
        bool CheckAddins(bool updating)
        {
            entries.Clear();
            bool addinsNotFound = false;

            foreach (string id in addin_ids)
            {
                string name    = Addin.GetIdName(id);
                string version = Addin.GetIdVersion(id);
                AddinRepositoryEntry[] ares = setup.Repositories.GetAvailableAddin(name, version);
                if (ares.Length == 0)
                {
                    addinsNotFound = true;
                }
                else
                {
                    entries.Add(Package.FromRepository(ares[0]));
                }
            }

            DependencyCollection unresolved;
            PackageCollection    toUninstall;

            if (!setup.ResolveDependencies(this, entries, out toUninstall, out unresolved))
            {
                /* Change this to some way of notifying that there are missing deps
                 * foreach (Dependency dep in unresolved) {
                 *      txt += "<span foreground='red'><b>" + dep.Name + "</b> (not found)</span>\n";
                 * }
                 */
                addinsNotFound = true;
            }
            return(!addinsNotFound);
        }
Beispiel #2
0
        /// <summary>
        ///     Loads the packages.
        /// </summary>
        private void LoadPackages( )
        {
            PackageCollection.Clear( );
            PackageCache.Clear( );

            foreach (Package package in Package.GetPackages(Application.ApplicationId))
            {
                PackageCollection.Add(package);
                PackageCache.Add(package);
            }

            IEnumerable <TenantActivatedPackage> activatedPackages = TenantActivatedPackage.GetTenantActivatedPackages( );

            foreach (TenantActivatedPackage activation in activatedPackages)
            {
                Package p = PackageCollection.FirstOrDefault(pkg => pkg.AppVerId == activation.AppVerId);

                Tenant tenant = p?.TenantCollection.FirstOrDefault(t => t.EntityId == activation.TenantId);

                if (tenant != null)
                {
                    p.TenantCollection.Remove(tenant);
                }
            }

            if (PackageCollection.Count == 1)
            {
                SelectedPackage = PackageCollection[0];
            }
        }
Beispiel #3
0
        /// <summary>
        ///     Loads the packages.
        /// </summary>
        private void LoadPackages( )
        {
            PackageCollection.Clear( );
            PackageCache.Clear( );

            foreach (Package package in Package.GetPackages(Application.ApplicationId))
            {
                PackageCollection.Add(package);
                PackageCache.Add(package);
            }

            if (PackageCollection.Count == 1)
            {
                SelectedPackage = PackageCollection[0];
            }
        }
Beispiel #4
0
        bool CheckAddins(bool updating)
        {
            string txt = "";

            entries.Clear();
            bool addinsNotFound = false;

            foreach (string id in addinIds)
            {
                string name    = Addin.GetIdName(id);
                string version = Addin.GetIdVersion(id);
                AddinRepositoryEntry[] ares = setup.Repositories.GetAvailableAddin(name, version);
                if (ares.Length == 0)
                {
                    addinsNotFound = true;
                    if (updating)
                    {
                        txt += "<span foreground='grey'><b>" + name + " " + version + "</b> (searching add-in)</span>\n";
                    }
                    else
                    {
                        txt += "<span foreground='red'><b>" + name + " " + version + "</b> (not found)</span>\n";
                    }
                }
                else
                {
                    entries.Add(Package.FromRepository(ares[0]));
                    txt += "<b>" + ares[0].Addin.Name + " " + ares[0].Addin.Version + "</b>\n";
                }
            }
            PackageCollection    toUninstall;
            DependencyCollection unresolved;

            if (!setup.ResolveDependencies(this, entries, out toUninstall, out unresolved))
            {
                foreach (Dependency dep in unresolved)
                {
                    txt += "<span foreground='red'><b>" + dep.Name + "</b> (not found)</span>\n";
                }
                addinsNotFound = true;
            }
            addinList.Markup = txt;
            return(!addinsNotFound);
        }
Beispiel #5
0
        /// <summary>
        ///     Searches this instance.
        /// </summary>
        /// <param name="searchText">The search text.</param>
        private void Search(string searchText)
        {
            PackageCollection.Clear( );

            bool cleared = string.IsNullOrEmpty(searchText);

            foreach (Package package in PackageCache)
            {
                if (cleared)
                {
                    PackageCollection.Add(package);
                }
                else
                {
                    if (package.Version.Contains(searchText))
                    {
                        PackageCollection.Add(package);
                    }
                }
            }
        }