Beispiel #1
0
 public void Accept(IVisitCacheable visitor)
 {
     var cacheable = inner as ICacheable;
     if (cacheable == null)
         return;
     cacheable.Accept(visitor);
 }
        private void TryCache(ICacheable cacheable)
        {
            if (cacheable == null)
            {
                return;
            }
            var cacheModels = kernel.GetAssignableHandlers(typeof(IVisitCacheable));

            foreach (var cache in cacheModels)
            {
                IVisitCacheable visitor = null;
                try
                {
                    visitor = cache.Resolve(CreationContext.Empty) as IVisitCacheable;
                    if (visitor == null)
                    {
                        throw new DittoConfigurationException("Problem with resolution of {0}", cache.ComponentModel.Implementation);
                    }
                    cacheable.Accept(visitor);
                }
                finally
                {
                    if (visitor != null)
                    {
                        kernel.ReleaseComponent(visitor);
                    }
                }
            }
        }
Beispiel #3
0
 public void Accept(IVisitCacheable visitor)
 {
     var cachingResolver = new CachingPropertyNameResolver();
     foreach (var resolver in destinationProperty2Resolver.Values)
     {
         cachingResolver.TryCache(SourceType,visitor,resolver);
     }
 }
Beispiel #4
0
        public void Accept(IVisitCacheable visitor)
        {
            var cachingResolver = new CachingPropertyNameResolver();

            foreach (var resolver in destinationProperty2Resolver.Values)
            {
                cachingResolver.TryCache(SourceType, visitor, resolver);
            }
        }
        public void TryCache(Type sourceType,IVisitCacheable visitor,IResolveValue resolver)
        {
            var propertyNameResolver = resolver as PropertyNameResolver;
            if(propertyNameResolver==null)
                return;

            var sourced = propertyNameResolver.SourcedBy(sourceType);
            visitor.Visit(sourced);
        }
 public void Accept(IVisitCacheable visitor)
 {
     foreach (var config in destinationType2BindableConfig.Values)
     {
         var cacheable = config as ICacheable;
         if (cacheable == null)
             continue;
         cacheable.Accept(visitor);
     }
 }
Beispiel #7
0
        public void Accept(IVisitCacheable visitor)
        {
            var cacheable = inner as ICacheable;

            if (cacheable == null)
            {
                return;
            }
            cacheable.Accept(visitor);
        }
 public void Accept(IVisitCacheable visitor)
 {
     foreach (var sourceContext in SourceContexts.OfType<ICacheable>())
     {
         sourceContext.Accept(visitor);
     }
     foreach (var cachedDestinationProp in DestinationProperties.OfType<ICacheable>())
     {
         cachedDestinationProp.Accept(visitor);
     }
     visitor.Visit(this);
 }
 public void Accept(IVisitCacheable visitor)
 {
     foreach (var config in destinationType2BindableConfig.Values)
     {
         var cacheable = config as ICacheable;
         if (cacheable == null)
         {
             continue;
         }
         cacheable.Accept(visitor);
     }
 }
Beispiel #10
0
 public void Accept(IVisitCacheable visitor)
 {
     foreach (var sourceContext in SourceContexts.OfType <ICacheable>())
     {
         sourceContext.Accept(visitor);
     }
     foreach (var cachedDestinationProp in DestinationProperties.OfType <ICacheable>())
     {
         cachedDestinationProp.Accept(visitor);
     }
     visitor.Visit(this);
 }
        public void TryCache(Type sourceType, IVisitCacheable visitor, IResolveValue resolver)
        {
            var propertyNameResolver = resolver as PropertyNameResolver;

            if (propertyNameResolver == null)
            {
                return;
            }

            var sourced = propertyNameResolver.SourcedBy(sourceType);

            visitor.Visit(sourced);
        }
Beispiel #12
0
 public void Accept(IVisitCacheable visitor)
 {
     var cachingResolver = new CachingPropertyNameResolver();
     cachingResolver.TryCache(sourceType,visitor,resolver);
 }
 public void Accept(IVisitCacheable visitor)
 {
     visitor.Visit(this);
 }
 public void Accept(IVisitCacheable visitor)
 {
     visitor.Visit(this);
 }
Beispiel #15
0
        public void Accept(IVisitCacheable visitor)
        {
            var cachingResolver = new CachingPropertyNameResolver();

            cachingResolver.TryCache(sourceType, visitor, resolver);
        }