Exemplo n.º 1
0
        private void SyncFolderWithVKAsync(object sender, DoWorkEventArgs e)
        {
            SoundHandler = new SynhronizeAdapter<Sound>(Properties.Settings.Default.DownloadFolderPath,
                                                        "*.mp3",
                                                        Properties.Settings.Default.ThreadCountToUse);

            SoundHandler.OnDone += AdapterSyncFolderWithVKAsyncDone;
            SoundHandler.OnProgress += AdapterSyncFolderWithVKAsyncOnProgress;
            SoundHandler.OnReadDataInfoEvent += new SynhronizerBase.HandleDataEvent(FilFromDiskItem);
            SoundHandler.OnUploadAction += new SynhronizerBase.HandleDataEvent(UploadItem);

            IEnumerable<SoundModelView> selected = Sounds.Where(p => p.Checked);

            SoundHandler.SyncFolderWithList<SoundModelView>(selected.ToList());
        }
Exemplo n.º 2
0
        public void LoadAudioInfo()
        {
            SoundHandler = new SynhronizeAdapter<Sound>(Properties.Settings.Default.DownloadFolderPath,
                                                        "*.mp3",
                                                        Properties.Settings.Default.ThreadCountToUse);

            //SoundHandler.OnDone += AdapterSyncFolderWithVKAsyncDone;
            //SoundHandler.OnProgress += AdapterSyncFolderWithVKAsyncOnProgress;

            SoundHandler.OnReadDataInfoEvent += FilFromDiskItem;

            Func<Sound> Creator = () => { return new Sound(); };

            SoundHandler.ComputeModList(Creator, DownloadProcces);

            SoundsData = new List<Sound>();
            foreach (var item in SoundHandler.ComputedFileList)
            {
                SoundsData.Add(item);
            }

            Application.Current.Dispatcher.Invoke(new Action(() =>
            {
                FillFromData(SoundsData);

            }), new object[] { });
        }