Esempio n. 1
0
 private static void Tile()
 {
     try
     {
         Console.WriteLine("Rendering tile");
         var set = new TilesSet( new TileXmlConfigurator("tiles.xml"));
         var model = new TagModel(new Hashtable
                                      {
                                          {
                                              "Key",
                                              new List<Person>
                                                  {
                                                      new Person {Name = "Ruth Kingsley", Age = 42},
                                                      new Person {Name = "Jacob van Dijk", Age = 23},
                                                      new Person {Name = "Stuward Langley", Age = 66}
                                                  }
                                              }
                                      }).UpdateFactory(new FileLocatorFactory());
         Console.WriteLine(set["template"].Render(model));
     }
     catch (ExceptionWithContext EWC)
     {
         Console.WriteLine(EWC.Message);
         Console.WriteLine(EWC.Context);
     }
     Console.WriteLine("Hit enter");
     Console.ReadLine();
 }
Esempio n. 2
0
        static TemplateField()
        {
            TagLib = new TagLib();

            TilesConfigurationSection config = TilesConfigurationSection.Get();
            var prefix = TemplateFieldPrefixHelper.BuildPrefix(HostingEnvironment.ApplicationPhysicalPath, config.FilePrefix);
            RefreshJob.REFRESH_INTERVAL = config.RefreshIntervalSeconds;
            _configuration = new TileXmlConfigurator(
                TagLib,
                config.ConfigFilePath,
                prefix
                );
            TILES = new TilesSet(_configuration);
        }