/// <summary>
 /// Add from this device to application data.
 /// </summary>
 /// <param name="path">System path od adding file.</param>
 /// <param name="category">Category of file</param>
 /// <returns></returns>
 public Task AddFile(string path, Category category)
 {
     dataHolder.Load();
     return(Task.Run(() =>
     {
         FileInfo info = new FileInfo(path);
         MyDevice device = GetLocalDeviceInstance();
         MyDisk disk = GetDiskInstance(info);
         MyFile f = disk.AddFile(path, category, syncManager);
         syncManager.AddGeneratedSyncEvent(new FileAddEv(new FilesEvents(disk.Id, device.Id, f.FilePath), category, f.InfoFilePath));
     }));
 }
        /// <summary>
        ///
        /// </summary>
        /// <param name="oldAppTreePath"></param>
        /// <param name="newAppTreePath"></param>
        /// <param name="removeOld"></param>
        /// <returns></returns>
        public Task <MyFile> PathChanged(string oldAppTreePath, string newAppTreePath, bool removeOld)
        {
            dataHolder.Load();
            return(Task.Run <MyFile>(() =>
            {
                var sO = oldAppTreePath.Split(new char[] { '\\' }, 3);
                var oldEnd = dataHolder.Select(sO[0], sO[1]).GetFile(sO[2]);
                var sN = newAppTreePath.Split(new char[] { '\\' }, 3);
                MyDisk d = dataHolder.Select(sN[0], sN[1]);
                MyFile f = d.AddFile(sN[2], oldEnd);

                if (removeOld)
                {
                    dataHolder.Select(sO[0], sO[1]).RemoveFile(sO[2]);
                }

                return f;
            }));
        }