/[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 20:38:58	450
+++ trunk/RomCheater/Serialization/SerializationReader.cs	2013/06/02 21:37:09	451
@@ -39,7 +39,7 @@
  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) { CreateFilename(guid); CreateReader(guid); } 
+        public SerializationReader(Guid guid) { CreateFilename(guid); } 
         //protected SerializationReader(string filename) { FileName = filename; }
 
         protected virtual string TemporaryFolder { get { return string.Empty; } }
@@ -51,14 +51,12 @@
         #region ISerializationResultCount members
         public int ResultCount { get; protected set; }
         #endregion
-        private FileStream fileStream;
-        protected BinaryReader binReader;
+        //private FileStream fileStream;
+        //protected BinaryReader binReader;
         protected string FileName { get; private set; }
-        private void CreateReader(Guid guid)
+        protected FileStream CreateReader(Guid guid)
         {
-            if (Cancelled) { return; }
-            fileStream = new FileStream(FileName, FileMode.Open, FileAccess.Read, FileShare.Read);
-            binReader = new BinaryReader(fileStream);
+            return new FileStream(FileName, FileMode.Open, FileAccess.Read, FileShare.Read);
         }
             #region IDisposable Support
         // Track whether Dispose has been called.
@@ -101,10 +99,10 @@
                 // If disposing is false,
                 // only the following code is executed.
                
-                // clean up any resources
-                binReader.Close();
-                binReader = null;
-                fileStream = null;                
+                //// clean up any resources
+                //binReader.Close();
+                //binReader = null;
+                //fileStream = null;                
                 // Note disposing has been done.
                 disposed = true;
 

 

  ViewVC Help
Powered by ViewVC 1.1.22