Changeset 1425


Ignore:
Timestamp:
May 13, 2010, 11:49:57 AM (12 years ago)
Author:
malischewski
Message:

Added support for customDataStore

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPluginBase/Miscellaneous/DataManager.cs

    r947 r1425  
    3939        }
    4040
     41        public DataManager(string customDataStore)
     42        {
     43            this.customDataStore = Path.Combine(customDataStore, DataDirecory);
     44            this.globalDataStore = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), DataDirecory);
     45        }
    4146        /// <summary>
    4247        /// Maps filename to metainfo.
     
    4853            Dictionary<string, DataFileMetaInfo> filesDict = new Dictionary<string, DataFileMetaInfo>();
    4954
    50             // TODO: enable custom data store
    51             DirectoryInfo dir = new DirectoryInfo(Path.Combine(globalDataStore, datatype));
     55           
     56            DirectoryInfo dir;
     57            if (customDataStore != null)
     58            {
     59                dir = new DirectoryInfo(Path.Combine(customDataStore, datatype));
     60            }
     61            else
     62            {
     63                dir = new DirectoryInfo(Path.Combine(globalDataStore, datatype));
     64            }
    5265            if (dir.Exists)
    5366            {
     
    5972            return filesDict;
    6073        }
     74
     75
    6176
    6277        private void LoadFiles(DirectoryInfo dir, Dictionary<string, DataFileMetaInfo> filesDict)
Note: See TracChangeset for help on using the changeset viewer.