Exemplo n.º 1
0
 public static void DrawBookmarks(
     LJD.Graphics g,
     ViewMetrics viewMetrics,
     IViewEvents eventsHandler)
 {
     foreach (var evt in Metrics.GetBookmarksMetrics(g, viewMetrics, eventsHandler))
     {
         g.DrawLine(viewMetrics.BookmarkPen, evt.VertLineA, evt.VertLineB);
         if (evt.Icon != null)
         {
             g.DrawImage(evt.Icon, evt.IconRect);
         }
     }
 }
Exemplo n.º 2
0
 public static CursorType GetCursor(
     Point pt,
     ViewMetrics vm,
     IViewEvents eventsHandler,
     Func <LJD.Graphics> graphicsFactory
     )
 {
     foreach (var a in Metrics.GetActivitiesMetrics(vm, eventsHandler))
     {
         bool overLink = false;
         overLink = overLink || (a.BeginTriggerLinkRect.HasValue && a.BeginTriggerLinkRect.Value.Contains(pt));
         overLink = overLink || (a.EndTriggerLinkRect.HasValue && a.EndTriggerLinkRect.Value.Contains(pt));
         overLink = overLink || a.Milestones.Any(ms => ms.Bounds.HasValue && ms.Bounds.Value.Contains(pt));
         if (overLink)
         {
             return(CursorType.Hand);
         }
     }
     using (var g = graphicsFactory())
     {
         foreach (var bmk in Metrics.GetBookmarksMetrics(g, vm, eventsHandler))
         {
             if (bmk.IsOverLink(pt))
             {
                 return(CursorType.Hand);
             }
         }
         foreach (var evt in Metrics.GetEventMetrics(g, eventsHandler, vm))
         {
             if (evt.IsOverLink(pt))
             {
                 return(CursorType.Hand);
             }
         }
     }
     return(CursorType.Default);
 }