/[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/03 07:13:44	471
+++ trunk/RomCheater/Serialization/SerializationReader.cs	2013/06/03 07:39:39	472
@@ -8,17 +8,17 @@
 {
     public abstract class SerializationReader : ISerializationResultCount, IDisposable
     {
-        private void CreateFilename(Guid guid)
+        private string CreateDynamicFilename(Guid guid)
         {
             if (guid == Guid.Empty)
             {
                 if (this.TemporaryFolder != string.Empty)
                 {
-                    FileName = string.Format(@"{0}\{1}\{2}", DEFAULT_FOLDER, TemporaryFolder, DEFAULT_FILENAME);
+                    return string.Format(@"{0}\{1}\{2}", DEFAULT_FOLDER, TemporaryFolder, DEFAULT_FILENAME);
                 }
                 else
                 {
-                    FileName = string.Format(@"{0}\{1}", DEFAULT_FOLDER, DEFAULT_FILENAME);
+                    return string.Format(@"{0}\{1}", DEFAULT_FOLDER, DEFAULT_FILENAME);
                 }
 
             }
@@ -26,14 +26,18 @@
             {
                 if (this.TemporaryFolder != string.Empty)
                 {
-                    FileName = string.Format(@"{0}\{1}\{2}", DEFAULT_FOLDER, TemporaryFolder, string.Format("{0}.tmp", guid.ToString()));
+                    return string.Format(@"{0}\{1}\{2}", DEFAULT_FOLDER, TemporaryFolder, string.Format("{0}.tmp", guid.ToString()));
                 }
                 else
                 {
-                    FileName = string.Format(@"{0}\{1}", DEFAULT_FOLDER, string.Format("{0}.tmp", guid.ToString()));
+                    return string.Format(@"{0}\{1}", DEFAULT_FOLDER, string.Format("{0}.tmp", guid.ToString()));
                 }
             }
         }
+        private void CreateFilename(Guid guid)
+        {
+            FileName = CreateDynamicFilename(guid);
+        }
 
  public const string DEFAULT_FOLDER = "tmp";
  protected const string DEFAULT_FILENAME = "SerializedMemoryResults.tmp";
@@ -60,6 +64,10 @@
         {
             return new FileStream(FileName, FileMode.Open, FileAccess.Read, FileShare.Read);
         }
+        protected FileStream CreateReader(Guid guid)
+        {           
+            return new FileStream(FileName, FileMode.Open, FileAccess.Read, FileShare.Read);
+        }
             #region IDisposable Support
         // Track whether Dispose has been called.
         private bool disposed = false;

 

  ViewVC Help
Powered by ViewVC 1.1.22