Exemple #1
0
        public static ITilesDefinitions getTilesDefinitionXml(string fileToMap)
        {
            var tilesDefinitions   = new KTilesDefinitions();
            var tilesDefinitionXml = ((tilesdefinitions)Serialize.getDeSerializedObjectFromXmlFile(fileToMap, typeof(tilesdefinitions)));

            if (tilesDefinitionXml != null)
            {
                foreach (var definition in tilesDefinitionXml.definition)
                {
                    var newTilesDefinition = new KTilesDefinition()
                    {
                        name    = definition.name,
                        extends = definition.extends,
                        path    = definition.path,
                        page    = definition.page
                    };
                    if (definition.put != null)
                    {
                        foreach (var put in definition.put)
                        {
                            newTilesDefinition.puts.Add(put.name, put.value);
                        }
                    }
                    tilesDefinitions.definitions.Add(newTilesDefinition);
                }
            }
            return(tilesDefinitions);
        }
 public static ITilesDefinitions getTilesDefinitionXml(string fileToMap)
 {
     var tilesDefinitions = new KTilesDefinitions();
     var tilesDefinitionXml = ((tilesdefinitions)Serialize.getDeSerializedObjectFromXmlFile(fileToMap, typeof(tilesdefinitions)));
     if (tilesDefinitionXml != null)
     {
         foreach (var definition in tilesDefinitionXml.definition)
         {
             var newTilesDefinition = new KTilesDefinition()
                                     {
                                         name = definition.name,
                                         extends = definition.extends,
                                         path = definition.path,
                                         page = definition.page
                                     };
             if (definition.put != null)
                 foreach(var put in definition.put)
                     newTilesDefinition.puts.Add(put.name, put.value);
             tilesDefinitions.definitions.Add(newTilesDefinition);
         }               
 }
     return tilesDefinitions;
 }