private void HandleSystemParsed(IAsyncResult asyncResult) { ParseFileSystemDelegate parseFileSystem = asyncResult.AsyncState as ParseFileSystemDelegate; //You may put additional exception handling here. //Should always call EndInvoke (see Richter) to catch errors. parseFileSystem.EndInvoke(asyncResult); if (ParsingFinished != null) { ParsingFinished(this, new ItemEventArgs <FileSystemCache>(_fileSystem)); } }
private void ParseFileSystemAsynchronously() { ParseFileSystemDelegate parseFileSystem = ParseFileSystem; parseFileSystem.BeginInvoke(HandleSystemParsed, parseFileSystem); }