/[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:21:16	445
+++ trunk/RomCheater/Serialization/SerializationReader.cs	2013/06/02 19:52:03	446
@@ -26,7 +26,10 @@
         public SerializationReader(Guid guid) : this(CreateFilename(guid)) { CreateReader(guid); } 
         protected SerializationReader(string filename) { FileName = filename; }
 
-               
+
+        protected bool Cancelled { get; set; }
+
+        public void CancelRequest() { Cancelled = true; }
 
         #region ISerializationResultCount members
         public int ResultCount { get; protected set; }
@@ -36,6 +39,7 @@
         protected string FileName { get; private set; }
         private void CreateReader(Guid guid)
         {
+            if (Cancelled) { return; }
             fileStream = new FileStream(FileName, FileMode.Open, FileAccess.Read, FileShare.Read);
             binReader = new BinaryReader(fileStream);
         }

 

  ViewVC Help
Powered by ViewVC 1.1.22