Пример #1
0
        internal static void BuildFragments(IHostBundleMetadataNode hostNode)
        {
            AssertUtility.ArgumentNotNull(hostNode, "hostNode");
            Interface1 metadata = hostNode.Metadata as Interface1;

            AssertUtility.ArgumentNotNull(metadata, "metadata");
            if ((metadata.Fragments != null) && (metadata.Fragments.Count != 0))
            {
                hostNode.DetachAllFragments();
                metadata.Fragments.ForEach(a => hostNode.AttachFragment((IFragmentBundleMetadataNode)hostNode.ConstraintResolver.UnResolverNodes.Find(node => node.Metadata == a)));
            }
        }
Пример #2
0
 public void Resolve(List <IBundleMetadata> unResolvedMetadatas)
 {
     if (this.State != null)
     {
         List <Interface2> needUnResolvedNodes = this.ResolvedNodes.FindAll(a => unResolvedMetadatas.Contains((IBundleMetadata)a.Metadata));
         this.TryUnResolveBundles(needUnResolvedNodes);
         List <Interface2> bundles = this.UnResolverNodes.FindAll(a => unResolvedMetadatas.Contains((IBundleMetadata)a.Metadata));
         bundles.ForEach(delegate(object a) {
             IHostBundleMetadataNode node = a as IHostBundleMetadataNode;
             if (node != null)
             {
                 node.AttachAllFragments();
             }
         });
         this.TryResolveBundles(bundles);
     }
 }
Пример #3
0
 public void RemoveBundle(IBundleMetadata bundleMetadata)
 {
     if (bundleMetadata != null)
     {
         IHostBundleMetadataNode node = this.Resolver.ResolvedNodes.Find(node => node.Metadata == bundleMetadata) as IHostBundleMetadataNode;
         if ((node != null) && node.IsReferenced())
         {
             this.Changes.RecordBundleRemovalPending(bundleMetadata);
             this.OnRemovalPending(bundleMetadata);
         }
         else
         {
             this.Bundles.Remove(bundleMetadata);
             this.OnRemovedBundle(bundleMetadata);
         }
     }
 }