Example #1
0
 protected void InitFactory(Assembly assembly)
 {
     if (_factory == null)
     {
         _assembly = assembly;
         Type   factoryType = null;
         String prefix      = null;
         try
         {
             var config = TilesConfigurationSection.Get();
             factoryType = config.ResourceFactoryType;
             prefix      = config.FilePrefix;
             RefreshJob.REFRESH_INTERVAL = config.RefreshIntervalSeconds;
         }
         catch
         {
             Debug.WriteLine("No config section found for tiles, using assembly configuration");
         }
         _factory = factoryType == null
                        ?
                    new AssemblyLocatorFactory(_assembly, prefix).CloneForTagLib(_lib)
                        :
                    TileXmlConfigurator.GetCustomFactory(_lib, factoryType);
     }
 }