public MetadataReferenceUpdatedEventArgs(MonoDevelopMetadataReference reference)
 {
     OldSnapshot = reference.CurrentSnapshot;
     NewSnapshot = new Lazy <PortableExecutableReference> (() => {
         reference.UpdateSnapshot();
         return(reference.CurrentSnapshot);
     });
 }
        Task <bool> WaitForSnapshotChange(MonoDevelopMetadataReference item)
        {
            var tcs = new TaskCompletionSource <bool> ();
            var cts = new CancellationTokenSource();

            cts.Token.Register(() => tcs.TrySetResult(false));
            item.UpdatedOnDisk += (sender, args) => {
                // This routes through file service
                item.UpdateSnapshot();
                tcs.TrySetResult(true);
            };

            // 1 minute should be enough.
            cts.CancelAfter(1000 * 60);

            return(tcs.Task);
        }