示例#1
0
        private void InitDataAdapter()
        {
            string configPath = ReturnConfigPath();

            var drive = new DriveInfo(_driverLetter);

            if (drive.IsReady)
            {
                if (!Directory.Exists(configPath))
                {
                    Directory.CreateDirectory(configPath);
                }

                DataAdapter = new JsonFileDataAdapter(configPath);
            }
            else
            {
                DataAdapter = new EmptyDataAdapter();
            }
        }
 public FileSystemWithPathContextHandler(string path)
 {
     DataAdapter = new JsonFileDataAdapter(path);
 }
示例#3
0
 public FileSystemContextHandler()
 {
     DataAdapter = new JsonFileDataAdapter(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData));
 }