Esempio n. 1
0
        /// <summary>
        /// See <see cref="IAssetReferenceService.AddIndexer"/>.
        /// </summary>
        public IAssetReference[] Find(Type indexerType, params object[] conditions)
        {
            if (indexerType == null)
            {
                throw new ArgumentNullException("indexerType");
            }
            IAssetReferenceIndexer indexer = (IAssetReferenceIndexer)indexers[indexerType];

            if (indexer == null)
            {
                throw new InvalidOperationException(String.Format(
                                                        System.Globalization.CultureInfo.CurrentCulture,
                                                        Properties.Resources.AssetReferenceService_NoIndexer, indexerType));
            }
            return(indexer.Find(conditions));
        }
Esempio n. 2
0
 /// <summary>
 /// See <see cref="IAssetReferenceService.AddIndexer"/>.
 /// </summary>
 public void AddIndexer(Type indexerType, IAssetReferenceIndexer indexerInstance)
 {
     if (indexerType == null)
     {
         throw new ArgumentNullException("indexerType");
     }
     if (indexerInstance == null)
     {
         throw new ArgumentNullException("indexerInstance");
     }
     indexers.Add(indexerType, indexerInstance);
     // Now, let's index the existing references in the new index
     foreach (IAssetReference existingReference in GetAll())
     {
         indexerInstance.Add(existingReference);
     }
 }