/[RomCheater]/trunk/RomCheater/Serialization/SerializationReader.cs
ViewVC logotype

Diff of /trunk/RomCheater/Serialization/SerializationReader.cs

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

--- trunk/RomCheater/Serialization/SerializationReader.cs	2013/06/02 19:52:03	446
+++ trunk/RomCheater/Serialization/SerializationReader.cs	2013/06/02 20:22:04	448
@@ -8,24 +8,41 @@
 {
     public abstract class SerializationReader : ISerializationResultCount, IDisposable
     {
-         private static string CreateFilename(Guid guid)
+ private string CreateFilename(Guid guid)
         {
             if (guid == Guid.Empty)
             {
-                return DEFAULT_PATH;
+                if (this.TemporaryFolder != string.Empty)
+                {
+                    return string.Format(@"{0}\{1}\{2}", DEFAULT_FOLDER, TemporaryFolder, DEFAULT_FILENAME);
+                }
+                else
+                {
+                    return string.Format(@"{0}\{1}", DEFAULT_FOLDER, DEFAULT_FILENAME);
+                }
+                
             }
             else
             {
-                return string.Format(@"{0}\{1}", DEFAULT_FOLDER, string.Format("{0}.tmp", guid.ToString()));
+                if (this.TemporaryFolder != string.Empty)
+                {
+                    return string.Format(@"{0}\{1}\{2}", DEFAULT_FOLDER, TemporaryFolder, string.Format("{0}.tmp", guid.ToString()));
+                }
+                else
+                {
+                    return string.Format(@"{0}\{1}", DEFAULT_FOLDER, string.Format("{0}.tmp", guid.ToString()));
+                }
             }
         }
-        private const string DEFAULT_FOLDER = "tmp";
-        private const string DEFAULT_FILENAME = "SerializedMemoryResults.tmp";
-        private static string DEFAULT_PATH = string.Format(@"{0}\{1}", DEFAULT_FOLDER, DEFAULT_FILENAME);
+
+ public const string DEFAULT_FOLDER = "tmp";
+ protected const string DEFAULT_FILENAME = "SerializedMemoryResults.tmp";
+        //private static string DEFAULT_PATH = string.Format(@"{0}\{1}", DEFAULT_FOLDER, DEFAULT_FILENAME);
         //public SerializationReader() : this(CreateFilename(Guid.Empty)) { CreateReader(Guid.Empty); }
-        public SerializationReader(Guid guid) : this(CreateFilename(guid)) { CreateReader(guid); } 
-        protected SerializationReader(string filename) { FileName = filename; }
+        public SerializationReader(Guid guid) { CreateFilename(guid); CreateReader(guid); } 
+        //protected SerializationReader(string filename) { FileName = filename; }
 
+        protected virtual string TemporaryFolder { get { return string.Empty; } }
 
         protected bool Cancelled { get; set; }
 

 

  ViewVC Help
Powered by ViewVC 1.1.22