private void OnTileSelected(object sender, TileSelectedEventArgs e)
 {
     if (e.SelectedTile.PresentationImage != null)
     {
         //the presentation image selected event will fire and take care of this.
         return;
     }
     _referenceLineTool.RefreshAllReferenceLines();
     Draw(_referenceLineTool.GetImagesToRedraw());
 }
        private void DrawImageBoxes(IEnumerable <IImageBox> imageBoxes)
        {
            List <IImageBox> imageBoxesToDraw = new List <IImageBox>(imageBoxes);

            //Then calculate the reference lines.
            _referenceLineTool.RefreshAllReferenceLines();

            foreach (IPresentationImage image in _referenceLineTool.GetImagesToRedraw())
            {
                //Only draw images that won't be drawn as a result of the image boxes being drawn.
                if (!imageBoxesToDraw.Contains(image.ParentDisplaySet.ImageBox))
                {
                    image.Draw();
                }
            }

            Draw(imageBoxesToDraw);
        }