Exemplo n.º 1
0
        public void Import(string dbFilePath)
        {
            var existed = GetKeysAll();

            using (var binaryDataSet = new BinaryDataSet(dbFilePath, ExecuteWithLockDelegate))
            {
                var importKeys = binaryDataSet.GetKeysAll();

                var newKeys     = importKeys.Where(item => !existed.Contains(item)).ToArray();
                var currentKeys = new HashSet <string>();

                for (var z = 0; z < newKeys.Length; z++)
                {
                    currentKeys.Add(newKeys[z]);

                    if (currentKeys.Count == 20 || z == newKeys.Length - 1)
                    {
                        AddChangedBinaryData(binaryDataSet.GetByKeys(currentKeys).ToArray());
                        SaveBinaryData();
                    }
                }
            }
        }
Exemplo n.º 2
0
 public void SaveChanges()
 {
     AudioBookSet.SaveAudioBooks();
     AudioBookGroupSet.SaveAudioBookGroups();
     BinaryDataSet.SaveBinaryData();
 }