Example #1
0
 protected virtual void SerializeAllEntities(bool bSaving)
 {
     if (bSaving)
     {
         for (int CurrentEntity = 0; CurrentEntity < Entities.Count; ++CurrentEntity)
         {
             EntityType CurrentCopy = Entities[CurrentEntity];
             SerializeEntity(CurrentCopy.GetFilename(), ref CurrentCopy, true, TypeUtils.GetXMLSerializerForTypeString(CurrentCopy.GetEntityName()));
         }
     }
 }
Example #2
0
        public virtual void EntityToFilename(ref EntityType SourceEntity, ref string SavedFilename)
        {
            if (SourceEntity != null)
            {
                SavedFilename = SourceEntity.GetEntityName() + ":=:" + SourceEntity.GetFilename();
            }
            else if (SavedFilename != null)
            {
                string[] Delimiters     = { ":=:" };
                string[] NameTypeString = SavedFilename.Split(Delimiters, System.StringSplitOptions.None);
                string   TypeString     = NameTypeString[0];
                string   NameString     = NameTypeString[1];

                CreateOrUpdateEntityFromFilename(NameString, ref Entities, TypeUtils.GetNewObjectOfTypeString(TypeString), TypeUtils.GetXMLSerializerForTypeString(TypeString));
            }
        }