/[EmuXPortal]/trunk/EmuXPortal/Api/EmuConfig.cs
ViewVC logotype

Diff of /trunk/EmuXPortal/Api/EmuConfig.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/EmuXPortal/Api/EmuConfig.cs	2012/04/04 02:11:37	20
+++ trunk/EmuXPortal/Api/EmuConfig.cs	2012/04/04 02:39:20	22
@@ -44,31 +44,36 @@
                     {
                         using (XmlReader reader = XmlReader.Create(fs))
                         {
+                            string value = "";
                             reader.ReadToFollowing("PLATFORMNAMESHORT");
-                            config.PlatformNameShort = reader.ReadElementContentAsString();
-                            logger.WriteLine("\tPLATFORMNAMESHORT={0}", config.PlatformNameShort);
+                            value = reader.ReadElementContentAsString();
+                            config.PlatformNameShort = (value == "") ? config.PlatformNameShort: value;
+                            logger.WriteLine("\t\tPLATFORMNAMESHORT={0}", config.PlatformNameShort);
 
                             reader.ReadToFollowing("PLATFORMNAMELONG");
-                            config.PlatformNameLong = reader.ReadElementContentAsString();
-                            logger.WriteLine("\tPLATFORMNAMELONG={0}", config.PlatformNameLong);
+                            value = reader.ReadElementContentAsString();
+                            config.PlatformNameLong = (value == "") ? config.PlatformNameLong : value;
+                            logger.WriteLine("\t\tPLATFORMNAMELONG={0}", config.PlatformNameLong);
 
                             reader.ReadToFollowing("PLATFORMIMAGE");
-                            string platform_image = reader.ReadElementContentAsString();
-                            
+                            string platform_image = reader.ReadElementContentAsString();                            
                             config.PlatformImage = (platform_image == "") ? Properties.Resources.DefaultPlatformImage : Image.FromFile(string.Format(@"{0}\{1}",rom_path,platform_image));
                             string str_platform_image = (platform_image == "") ? "DefaultPlatformImage" : platform_image;
-                            logger.WriteLine("\tPLATFORMIMAGE={0}", str_platform_image);
+                            logger.WriteLine("\t\tPLATFORMIMAGE={0}", str_platform_image);
 
                             reader.ReadToFollowing("EXTENSIONS");
-                            config.Extenstions = reader.ReadElementContentAsString();
-                            logger.WriteLine("\tEXTENSIONS={0}", config.Extenstions);
+                            value = reader.ReadElementContentAsString();
+                            config.Extenstions = (value == "") ? config.Extenstions : value;
+                            logger.WriteLine("\t\tEXTENSIONS={0}", config.Extenstions);
 
                             reader.ReadToFollowing("EMULATORPATH");
-                            config.EmuPath = reader.ReadElementContentAsString();
-                            logger.WriteLine("\tEMULATORPATH={0}", config.EmuPath);
+                            value = reader.ReadElementContentAsString();
+                            config.EmuPath = (value == "") ? config.EmuPath : value;
+                            logger.WriteLine("\t\tEMULATORPATH={0}", config.EmuPath);
 
                             reader.ReadToFollowing("EMULATOROPTIONS");
-                            config.EmuOptions = reader.ReadElementContentAsString();
+                            value = reader.ReadElementContentAsString();
+                            config.EmuOptions = (value == "") ? config.EmuOptions : value;
                             logger.WriteLine("\tEMULATOROPTIONS={0}", config.EmuOptions);
                         }
                     }

 

  ViewVC Help
Powered by ViewVC 1.1.22