private void OnFileWrited(int fileNum, int fileCount) { if (LogManager != null) { LogManager.DebugFormat("OnFileWrited: fileNum={0}, fileCount={1}", fileNum, fileCount); } WriteDirectoryEventArgs args = new WriteDirectoryEventArgs(fileNum, fileCount); if (WriteStatusChanged != null) { if (OwnerDispatcher != null && !OwnerDispatcher.CheckAccess()) { OwnerDispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new WriteStatusChangedEventHandler((s, e) => { WriteStatusChanged(s, e); }), this, args); } else WriteStatusChanged(this, args); } }