/[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 446 by william, Sun Jun 2 19:52:03 2013 UTC revision 448 by william, Sun Jun 2 20:22:04 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 static string CreateFilename(Guid guid)   private string CreateFilename(Guid guid)
12          {          {
13              if (guid == Guid.Empty)              if (guid == Guid.Empty)
14              {              {
15                  return DEFAULT_PATH;                  if (this.TemporaryFolder != string.Empty)
16                    {
17                        return string.Format(@"{0}\{1}\{2}", DEFAULT_FOLDER, TemporaryFolder, DEFAULT_FILENAME);
18                    }
19                    else
20                    {
21                        return string.Format(@"{0}\{1}", DEFAULT_FOLDER, DEFAULT_FILENAME);
22                    }
23                    
24              }              }
25              else              else
26              {              {
27                  return string.Format(@"{0}\{1}", DEFAULT_FOLDER, string.Format("{0}.tmp", guid.ToString()));                  if (this.TemporaryFolder != string.Empty)
28                    {
29                        return string.Format(@"{0}\{1}\{2}", DEFAULT_FOLDER, TemporaryFolder, string.Format("{0}.tmp", guid.ToString()));
30                    }
31                    else
32                    {
33                        return string.Format(@"{0}\{1}", DEFAULT_FOLDER, string.Format("{0}.tmp", guid.ToString()));
34                    }
35              }              }
36          }          }
37          private const string DEFAULT_FOLDER = "tmp";  
38          private const string DEFAULT_FILENAME = "SerializedMemoryResults.tmp";   public const string DEFAULT_FOLDER = "tmp";
39          private static string DEFAULT_PATH = string.Format(@"{0}\{1}", DEFAULT_FOLDER, DEFAULT_FILENAME);   protected const string DEFAULT_FILENAME = "SerializedMemoryResults.tmp";
40            //private static string DEFAULT_PATH = string.Format(@"{0}\{1}", DEFAULT_FOLDER, DEFAULT_FILENAME);
41          //public SerializationReader() : this(CreateFilename(Guid.Empty)) { CreateReader(Guid.Empty); }          //public SerializationReader() : this(CreateFilename(Guid.Empty)) { CreateReader(Guid.Empty); }
42          public SerializationReader(Guid guid) : this(CreateFilename(guid)) { CreateReader(guid); }          public SerializationReader(Guid guid) { CreateFilename(guid); CreateReader(guid); }
43          protected SerializationReader(string filename) { FileName = filename; }          //protected SerializationReader(string filename) { FileName = filename; }
44    
45            protected virtual string TemporaryFolder { get { return string.Empty; } }
46    
47          protected bool Cancelled { get; set; }          protected bool Cancelled { get; set; }
48    

Legend:
Removed from v.446  
changed lines
  Added in v.448

  ViewVC Help
Powered by ViewVC 1.1.22