CacheLocation

Jan 11, 2010 at 10:21 PM

Hi *,

Great framework :) I really like it :)

One question:

is there a reason why is CacheLocation always set to -> System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData) + Path.DirectorySeparatorChar + "GMap.NET" + Path.DirectorySeparatorChar;

Why am I asking?

eg. WPF example:

Try to set in MainWindow CacheLocation to some other location:

MainMap.CacheLocation = "C:\\specific_cache_location\\";

Make no sense because CacheLocation is always overwritten in SQLitePureImageCache() constructor and in core StartSystem()

So my proposal is following (check if CacheLocation is set by user):

public SQLitePureImageCache()
      {
          if (CacheLocation == null)
          {
              CacheLocation = System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData) + Path.DirectorySeparatorChar + "GMap.NET" + Path.DirectorySeparatorChar;
          }
      }

and

in Core.cs -> StartSystem()

if (Cache.Instance.CacheLocation == null)
    {
       Cache.Instance.CacheLocation = System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData) + Path.DirectorySeparatorChar + "GMap.NET" + Path.DirectorySeparatorChar;
    }

Correct me if I'm wrong but I think that this is a little bug ;)

 

Great job, nice coding

Keep a good work, thumb up

Regards,

G.M.-Smile

Coordinator
Jan 11, 2010 at 10:57 PM

done!