Exemplo n.º 1
0
 /// <summary>
 /// Adds the resource and checks name conflicts.
 /// </summary>
 private void AddRequiredResourceCore(string name, ResourceBase resource)
 {
     ResourceBase originalResource;
     if (requiredResources.TryGetValue(name, out originalResource))
     {
         if (originalResource.Url != resource.Url)
         {
             ThrowNonUniqueName(name);
         }
     }
     else
     {
         foreach (var dep in resource.Dependencies)
         {
             AddRequiredResource(dep);
         }
         requiredResourcesOrdered.Add(name);
         requiredResources[name] = resource;
     }
 }
Exemplo n.º 2
0
 public override bool Predicate(string name, ResourceBase resource)
     => BundleInverseIndex.ContainsKey(name);
Exemplo n.º 3
0
 /// <summary>
 /// registers a new resource in collection
 /// </summary>
 public void Register(string name, ResourceBase resource, bool replaceIfExists = true)
 {
     if (replaceIfExists)
         Resources.AddOrUpdate(name, resource, (key, res) => resource);
     else if (!Resources.TryAdd(name, resource))
         throw new InvalidOperationException("name already registered");
 }
Exemplo n.º 4
0
 public virtual bool Predicate(string name, ResourceBase resource) => true;