Changeset 2147


Ignore:
Timestamp:
Dec 1, 2010, 5:23:01 PM (11 years ago)
Author:
Matthäus Wander
Message:

fixed #163

  • DataManager is able to find data files again
  • cause: Data directory has moved from top level Data\ to CrypPlugins\Data\
Location:
trunk
Files:
3 edited

Legend:

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

    r1425 r2147  
    2020using System.IO;
    2121using System.Reflection;
     22using Cryptool.PluginBase.IO;
    2223
    2324namespace Cryptool.PluginBase.Miscellaneous
     
    2930        private const string MetaSuffix = ".metainfo";
    3031
    31         private readonly string customDataStore;
    32 
    3332        private readonly string globalDataStore;
    3433
    3534        public DataManager()
    3635        {
    37             this.customDataStore = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), DataDirecory);
    38             this.globalDataStore = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), DataDirecory);
     36            this.globalDataStore = Path.Combine(DirectoryHelper.DirectoryCrypPlugins, DataDirecory);
    3937        }
    4038
    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         }
    4639        /// <summary>
    4740        /// Maps filename to metainfo.
     
    5346            Dictionary<string, DataFileMetaInfo> filesDict = new Dictionary<string, DataFileMetaInfo>();
    5447
    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             }
     48            // TODO: enable custom data store
     49            DirectoryInfo dir = new DirectoryInfo(Path.Combine(globalDataStore, datatype));
    6550            if (dir.Exists)
    6651            {
     
    7257            return filesDict;
    7358        }
    74 
    75 
    7659
    7760        private void LoadFiles(DirectoryInfo dir, Dictionary<string, DataFileMetaInfo> filesDict)
  • trunk/CrypPlugins/CostFunction/CostFunction.cs

    r2086 r2147  
    5959
    6060       
    61         private DataManager dataMgr = new DataManager(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));
     61        private DataManager dataMgr = new DataManager();
    6262        private const string DATATYPE = "transposition";
    6363
  • trunk/CrypPlugins/CostFunction/CostFunctionSettings.cs

    r2042 r2147  
    3636        private String bytesToUse = "256";
    3737        private int bytesToUseInteger = 256;
    38 
    39         private static DataManager dataMgr = new DataManager();
    40         private const string DATATYPE = "transposition";
    41         private static IDictionary<String, DataFileMetaInfo> txtList;
    42         private static string[] files;
    4338        #endregion
    4439
Note: See TracChangeset for help on using the changeset viewer.