コード例 #1
0
        private void Import(IMod mod = null)
        {
            try
            {
                _packageImport.Clear();

                if (mod is null)
                {
                    foreach (var pg in _packageManage.PackageGroups)
                    {
                        QueuePackageGroup(pg);
                    }
                }
                else
                {
                    QueuePackageGroup(_packageManage.PackageGroups.FirstOrDefault(pg => pg.Mod.Name == mod.Name));
                }

                _packageImport.Import(true);

                Localizer.RefreshLanguages();

                Utils.LogDebug("Auto import end.");
            }
            catch
            {
            }
        }
コード例 #2
0
        private void Import(IMod mod = null)
        {
            void QueuePackageGroup(IPackageGroup packageGroup)
            {
                if (packageGroup is null || !packageGroup.Mod.Enabled)
                {
                    return;
                }

                foreach (var p in packageGroup.Packages)
                {
                    if (p.Enabled)
                    {
                        _packageImportPackageImport.Queue(p);
                    }
                }
            }

            Utils.SafeWrap(() =>
            {
                _packageImportPackageImport.Clear();

                if (mod is null)
                {
                    foreach (var pg in _packageManage.PackageGroups)
                    {
                        QueuePackageGroup(pg);
                    }
                }
                else
                {
                    QueuePackageGroup(_packageManage.PackageGroups.FirstOrDefault(pg => pg.Mod.Name == mod.Name));
                }

                _packageImportPackageImport.Import(true);

                Localizer.RefreshLanguages();

                Utils.LogDebug("Auto import end.");
            });
        }