/[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/05/28 20:44:13	443
+++ trunk/RomCheater/Serialization/SerializationReader.cs	2013/06/02 18:56:41	444
@@ -8,12 +8,25 @@
 {
     public abstract class SerializationReader : ISerializationResultCount, IDisposable
     {
+         private static string CreateFilename(Guid guid)
+        {
+            if (guid == Guid.Empty)
+            {
+                return DEFAULT_PATH;
+            }
+            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 SerializationReader() : this(DEFAULT_PATH) { }
-        protected SerializationReader(string filename) { FileName = filename; CreateReader(); }
+        //public SerializationReader() : this(CreateFilename(Guid.Empty)) { CreateReader(Guid.Empty); }
+        public SerializationReader(Guid guid) { CreateReader(guid); } 
+        protected SerializationReader(string filename) { FileName = filename; }
 
+               
 
         #region ISerializationResultCount members
         public int ResultCount { get; protected set; }
@@ -21,7 +34,7 @@
         private FileStream fileStream;
         protected BinaryReader binReader;
         protected string FileName { get; private set; }
-        private void CreateReader()
+        private void CreateReader(Guid guid)
         {
             fileStream = new FileStream(FileName, FileMode.Open, FileAccess.Read, FileShare.Read);
             binReader = new BinaryReader(fileStream);

 

  ViewVC Help
Powered by ViewVC 1.1.22