Esempio n. 1
0
 protected virtual void OnBundleUnresolving(BundleMetadataEventArgs e)
 {
     if (this.BundleUnresolving != null)
     {
         this.BundleUnresolving(this, e);
     }
 }
Esempio n. 2
0
 protected virtual void OnBundleResolved(BundleMetadataEventArgs e)
 {
     if (this.BundleResolved != null)
     {
         this.BundleResolved(this, e);
     }
 }
Esempio n. 3
0
        private void State_BundleAdded(object sender, BundleMetadataEventArgs e)
        {
            Interface1 metadata = e.Metadata as Interface1;

            if (metadata != null)
            {
                this.UnResolverNodes.Add(new HostBundleMetadataNode(this, metadata));
            }
            else
            {
                this.UnResolverNodes.Add(new FragmentBundleMetadataNode(this, (IFragmentBundleMetadata)e.Metadata));
            }
        }
Esempio n. 4
0
 private void Resolver_BundleUnresolved(object sender, BundleMetadataEventArgs e)
 {
     using (ReaderWriterLockHelper.CreateWriterLock(this._lock))
     {
         Dictionary <string, AssemblyEntry> dictionary = new Dictionary <string, AssemblyEntry>(this.Cache);
         foreach (KeyValuePair <string, AssemblyEntry> pair in dictionary)
         {
             if (pair.Value.ProvidedBy.Owner == e.Metadata)
             {
                 this.Cache.Remove(pair.Key);
             }
         }
     }
 }
Esempio n. 5
0
        private void State_BundleRemoved(object sender, BundleMetadataEventArgs e)
        {
            Predicate <Interface2> match      = null;
            Predicate <Interface2> predicate2 = null;
            Predicate <Interface2> predicate3 = null;
            Interface1             host       = e.Metadata as Interface1;

            if (host != null)
            {
                if (host.IsResolved)
                {
                    if (match == null)
                    {
                        match = a => a.Metadata == host;
                    }
                    Interface2 interface3 = this.ResolvedNodes.Find(match);
                    if (interface3 != null)
                    {
                        interface3.Unresolve();
                    }
                    if (predicate2 == null)
                    {
                        predicate2 = a => a.Metadata == e.Metadata;
                    }
                    this.ResolvedNodes.RemoveAll(predicate2);
                }
                else
                {
                    if (predicate3 == null)
                    {
                        predicate3 = a => a.Metadata == e.Metadata;
                    }
                    this.UnResolverNodes.RemoveAll(predicate3);
                }
            }
            else
            {
                Predicate <Interface2>  predicate4 = null;
                IFragmentBundleMetadata framgent   = e.Metadata as IFragmentBundleMetadata;
                if (this.ResolvedNodes.Find(a => framgent.HostConstraint.DependentMetadata == a.Metadata) == null)
                {
                    if (predicate4 == null)
                    {
                        predicate4 = a => framgent.HostConstraint.DependentMetadata == a.Metadata;
                    }
                    Interface2 interface2 = this.UnResolverNodes.Find(predicate4);
                }
            }
        }