private void LoadDirectory() { if (!Object.ReferenceEquals(loader, null)) { loader.Abort = true; } WorkerThreadPool.Instance.StartWork(new Work( delegate(IWork w) { if (!Object.ReferenceEquals(loader, null)) { loader.Abort = true; loader = null; } transactionId.Start(); }, delegate(IWork w) { try { loader = new TagModelList.TagListLoader( this.Path.Value, VirtualDrive.GetFiles(this.Path.Value, "*.mp3")); loader.Run(); } catch (Exception e) { Logger.WriteLine(Tokens.Exception, e); } }, delegate(IWork w) { if (!Object.ReferenceEquals(loader, null) && !loader.Abort) { History.Instance.ExecuteInTransaction( delegate() { TagModelList.SetFiles(loader); Dirty.Value = false; }, transactionId.CurrentId, "Document.OnLoadingFinished"); } transactionId.End(); })); }
public TagModeListDropTarget(TagModelList tml) { Model = tml; }