Beispiel #1
0
 public PictureView()
 {
     InitializeComponent();
     horzScroll.GotFocus          += new EventHandler(restoreFocus);
     vertScroll.GotFocus          += new EventHandler(restoreFocus);
     renderer.ChangeShowScroll    += new Action <bool>(renderer_ChangeShowScroll);
     renderer.UpdateImageSize     += new Action(renderer_UpdateImageSize);
     renderer.ImageLoadingChanged += new Action <bool>((b) => { if (ImageLoadingChanged != null)
                                                                {
                                                                    ImageLoadingChanged.Invoke(b);
                                                                }
                                                       });
     renderer.FileChanged += new Action <string>((s) => { if (FileChanged != null)
                                                          {
                                                              FileChanged.Invoke(s);
                                                          }
                                                 });
     renderer.PositionUpdateRequired += new Action <Point>(renderer_PositionUpdateRequired);
 }
Beispiel #2
0
 void CurrentOperation_IndexUpdated()
 {
     curElem = Core.CurrentOperation.GetCurrentElement();
     //バッファリングされているかのチェック
     if (curElem != null && !curElem.IsBuffered && !curElem.LoadFailed)
     {
         if (ImageLoadingChanged != null)
         {
             ImageLoadingChanged.Invoke(true);
         }
         System.Diagnostics.Debug.WriteLine("Self fetch start... =>" + curElem.ImageSourcePath);
         var invoke = new Action <Data.GroupingElement>(Subsystem.Prefetch.Instance.Loader.LoadImageByElem);
         invoke.BeginInvoke(curElem, (iar) =>
         {
             ((Action <Data.GroupingElement>)iar.AsyncState).EndInvoke(iar);
             this.Invoke(new Action(() =>
             {
                 if (ImageLoadingChanged != null)
                 {
                     ImageLoadingChanged.Invoke(false);
                 }
                 if (UpdateImageSize != null)
                 {
                     UpdateImageSize.Invoke();
                 }
             }));
         }, invoke);
     }
     if (curElem != null)
     {
         if (FileChanged != null)
         {
             FileChanged.Invoke(curElem.ImageSourcePath);
         }
     }
     else
     {
         if (FileChanged != null)
         {
             FileChanged.Invoke(String.Empty);
         }
     }
     if (Core.Config.DisplayConfig.OverlapThumbnailConfig.Show)
     {
         nextElem = Core.CurrentOperation.GetNextElement();
         if (nextElem != null && !nextElem.IsBuffered)
         {
             System.Diagnostics.Debug.WriteLine("Self thumbnail fetch start... =>" + curElem.ImageSourcePath);
             var invoke = new Action <Data.GroupingElement>(Subsystem.Prefetch.Instance.Loader.LoadImageByElem);
             invoke.BeginInvoke(curElem, (iar) =>
             {
                 ((Action <Data.GroupingElement>)iar.AsyncState).EndInvoke(iar);
                 this.Invoke(new Action(() =>
                 {
                     this.Refresh();
                 }));
             }, invoke);
         }
     }
     if (UpdateImageSize != null)
     {
         UpdateImageSize.Invoke();
     }
 }