Esempio n. 1
0
 /// <summary>
 /// Must be called after all Items have been deserialized.
 /// Restores the Item references in CustomProperties of type Item.
 /// </summary>
 public void RestoreItemAssociations(root root)
 {
     foreach (CustomProperty cp in Values)
     {
         if (cp.type == typeof(Component))
         {
             cp.value = root.getItemByName((string)cp.value);
         }
     }
 }
Esempio n. 2
0
        public static root FromFile(string filename)
        {
            FileStream    stream     = File.Open(filename, FileMode.Open);
            XmlSerializer serializer = new XmlSerializer(typeof(root));
            root          root       = (root)serializer.Deserialize(stream);

            stream.Close();



            return(root);
        }
Esempio n. 3
0
        public static root FromFile(string filename, ContentManager cm)
        {
            FileStream    stream     = File.Open(filename, FileMode.Open);
            XmlSerializer serializer = new XmlSerializer(typeof(root));
            root          root       = (root)serializer.Deserialize(stream);

            stream.Close();
            foreach (Archetype arch in root.Archetypes)
            {
                foreach (Component comp in arch.Components)
                {
                    //comp.load(cm);
                }
            }

            return(root);
        }