private void PreLoadingItemCompleted(object sender, PreLoadingItemCompleteEventArgs eventArgs)
 {
     IPreLoadable item = eventArgs.Item;
     string str = this._downloading[item];
     this._completed.Add(item, str);
     this._downloading.Remove(item);
     if (this.ItemLoaded != null)
     {
         LoadedEventArgs e = new LoadedEventArgs {
             Loaded = item,
             Key = str
         };
         this.ItemLoaded(this, e);
     }
     if (this.AutoAdvance)
     {
         this.LoadNext();
     }
 }
        private void ClientOpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
        {
            if (e.Error != null)
            {
                var ex = e.Error;
                System.Diagnostics.Debug.WriteLine(ex.Message);
                System.Diagnostics.Debug.WriteLine(ex.StackTrace);
                while(ex.InnerException != null)
                {
                    ex = ex.InnerException;
                    System.Diagnostics.Debug.WriteLine(ex.Message);
                    System.Diagnostics.Debug.WriteLine(ex.StackTrace);
                }

                if (e.Error.InnerException != null)
                    throw e.Error.InnerException;

                throw e.Error;
            }
            this.Stream = e.Result;
            if (this.OnPreLoaded != null)
            {
                PreLoadingItemCompleteEventArgs args = new PreLoadingItemCompleteEventArgs {
                    Item = this
                };
                this.OnPreLoaded(this, args);
            }
        }