/[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

revision 456 by william, Mon Jun 3 01:45:40 2013 UTC revision 472 by william, Mon Jun 3 07:39:39 2013 UTC
# Line 8  namespace RomCheater.Serialization Line 8  namespace RomCheater.Serialization
8  {  {
9      public abstract class SerializationReader : ISerializationResultCount, IDisposable      public abstract class SerializationReader : ISerializationResultCount, IDisposable
10      {      {
11          private void CreateFilename(Guid guid)          private string CreateDynamicFilename(Guid guid)
12          {          {
13              if (guid == Guid.Empty)              if (guid == Guid.Empty)
14              {              {
15                  if (this.TemporaryFolder != string.Empty)                  if (this.TemporaryFolder != string.Empty)
16                  {                  {
17                      FileName = string.Format(@"{0}\{1}\{2}", DEFAULT_FOLDER, TemporaryFolder, DEFAULT_FILENAME);                      return string.Format(@"{0}\{1}\{2}", DEFAULT_FOLDER, TemporaryFolder, DEFAULT_FILENAME);
18                  }                  }
19                  else                  else
20                  {                  {
21                      FileName = string.Format(@"{0}\{1}", DEFAULT_FOLDER, DEFAULT_FILENAME);                      return string.Format(@"{0}\{1}", DEFAULT_FOLDER, DEFAULT_FILENAME);
22                  }                  }
23    
24              }              }
# Line 26  namespace RomCheater.Serialization Line 26  namespace RomCheater.Serialization
26              {              {
27                  if (this.TemporaryFolder != string.Empty)                  if (this.TemporaryFolder != string.Empty)
28                  {                  {
29                      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()));
30                  }                  }
31                  else                  else
32                  {                  {
33                      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()));
34                  }                  }
35              }              }
36          }          }
37            private void CreateFilename(Guid guid)
38            {
39                FileName = CreateDynamicFilename(guid);
40            }
41    
42   public const string DEFAULT_FOLDER = "tmp";   public const string DEFAULT_FOLDER = "tmp";
43   protected const string DEFAULT_FILENAME = "SerializedMemoryResults.tmp";   protected const string DEFAULT_FILENAME = "SerializedMemoryResults.tmp";
# Line 60  namespace RomCheater.Serialization Line 64  namespace RomCheater.Serialization
64          {          {
65              return new FileStream(FileName, FileMode.Open, FileAccess.Read, FileShare.Read);              return new FileStream(FileName, FileMode.Open, FileAccess.Read, FileShare.Read);
66          }          }
67            protected FileStream CreateReader(Guid guid)
68            {          
69                return new FileStream(FileName, FileMode.Open, FileAccess.Read, FileShare.Read);
70            }
71              #region IDisposable Support              #region IDisposable Support
72          // Track whether Dispose has been called.          // Track whether Dispose has been called.
73          private bool disposed = false;          private bool disposed = false;

Legend:
Removed from v.456  
changed lines
  Added in v.472

  ViewVC Help
Powered by ViewVC 1.1.22