Exemplo n.º 1
0
 private bool HasDependentBundleInCollection(HostBundle bundle, List <HostBundle> bundlesToCheck)
 {
     if (bundle.Metadata.DependentBundles.Count == 0)
     {
         return(false);
     }
     return(bundle.Metadata.DependentBundles.Exists(dependent => bundlesToCheck.Exists(item => item.Metadata == dependent.DependentMetadata)));
 }
Exemplo n.º 2
0
        public void ChangeStartLevel(int startLevel)
        {
            if (this._framework == null)
            {
                throw new InvalidOperationException();
            }
            List <IBundle> list = this._framework.Bundles.FindAll(bundle => bundle.GetBunldeStartLevel() <= startLevel);

            list.Sort((bundle1, bundle2) => bundle1.GetBunldeStartLevel().CompareTo(bundle2.GetBunldeStartLevel()));
            for (int i = 0; i < list.Count; i++)
            {
                HostBundle bundle = list[i] as HostBundle;
                if (bundle != null)
                {
                    try
                    {
                        DefaultBundleState?bundleStartState = bundle.GetBundleStartState();
                        if (!bundleStartState.HasValue)
                        {
                            if (this._framework.Options.DefaultBundleState == DefaultBundleState.Active)
                            {
                                list[i].Start(BundleStartOptions.Transient);
                            }
                        }
                        else if (((DefaultBundleState)bundleStartState.Value) == DefaultBundleState.Active)
                        {
                            list[i].Start(BundleStartOptions.General);
                        }
                    }
                    catch (Exception exception)
                    {
                        FileLogUtility.Error(string.Format(Messages.StartBundleFailed, bundle.SymbolicName, bundle.Version));
                        FileLogUtility.Error(exception);
                        this._framework.EventManager.DispatchFrameworkEvent(this, new FrameworkEventArgs(FrameworkEventType.Error, list[i], exception));
                    }
                }
            }
        }
Exemplo n.º 3
0
 public HostBundleLoader(HostBundle bundle)
     : base(bundle)
 {
     Framework        = bundle.Framework;
     FrameworkAdaptor = bundle.Framework.FrameworkAdaptor;
 }