// event - Drawing of Overlay has Started void loTracking_Drawing(object sender, DrawingOverlayEventArgs e) { Boolean bOutCome; string sInform; DateTime TheDateTime; LayerOverlay TheLayerOverlay; clsTrackingLayerOverlayItem oTrackingLayerOverlay; // get the time as the Drawing Start Time TheDateTime = DateTime.Now; // get the LayerOverlay TheLayerOverlay = (LayerOverlay)sender; // get Tracking LayerOverlay Item bOutCome = cTrackingLayerOverlay.TryGetValue(TheLayerOverlay.Name, out oTrackingLayerOverlay); if (bOutCome == false) { sInform = string.Format("Unable to Locate TrackingLayerOverlayItem, LayerOverylay={0}", TheLayerOverlay.Name); bOutCome = Variables.gLogInform.LogInform((OriStarTools.UtlLogInform.LogInformFunction.EventLog), "TrackingOverlay.loTracking_Drawing", sInform, EventLogEntryType.Error); return; } // save the Drawing Start Time oTrackingLayerOverlay.TheDateTimeDrawing = TheDateTime; // indicate drawing InProgress oTrackingLayerOverlay.bDrawingInProgress = true; return; } // event - Drawing of Overlay has Ended void loTracking_Drawn(object sender, DrawnOverlayEventArgs e) { Boolean bOutCome; string sInform; double TheDrawingTime; TimeSpan TheTimeSpanDrawingDrawn; DateTime TheDateTime; LayerOverlay TheLayerOverlay; clsTrackingLayerOverlayItem oTrackingLayerOverlay; // get the time as the Drawing End Time TheDateTime = DateTime.Now; // get the LayerOverlay TheLayerOverlay = (LayerOverlay)sender; // get Tracking LayerOverlay Item bOutCome = cTrackingLayerOverlay.TryGetValue(TheLayerOverlay.Name, out oTrackingLayerOverlay); if (bOutCome == false) { sInform = string.Format("Unable to Locate TrackingLayerOverlayItem, LayerOverylay={0}", TheLayerOverlay.Name); bOutCome = Variables.gLogInform.LogInform((OriStarTools.UtlLogInform.LogInformFunction.EventLog), "TrackingOverlay.loTracking_Drawn", sInform, EventLogEntryType.Error); return; } // save the Drawing End Time oTrackingLayerOverlay.TheDateTimeDrawn = TheDateTime; // calculate the Drawing Time TheTimeSpanDrawingDrawn = (oTrackingLayerOverlay.TheDateTimeDrawn - oTrackingLayerOverlay.TheDateTimeDrawing); TheDrawingTime = TheTimeSpanDrawingDrawn.TotalMilliseconds; // compare to Minimum/Maximum Times if (TheDrawingTime < oTrackingLayerOverlay.MinDrawingTime) { oTrackingLayerOverlay.MinDrawingTime = TheDrawingTime; sInform = string.Format("Drawing Time: Overylay={0}, Time={1}, MinTime={2}, MaxTime={3}", TheLayerOverlay.Name, TheDrawingTime, oTrackingLayerOverlay.MinDrawingTime, oTrackingLayerOverlay.MaxDrawingTime); bOutCome = Variables.gLogInform.LogInform((OriStarTools.UtlLogInform.LogInformFunction.EventLog), "TrackingOverlay.loTracking_Drawn", sInform, EventLogEntryType.SuccessAudit); } if (TheDrawingTime > oTrackingLayerOverlay.MaxDrawingTime) { oTrackingLayerOverlay.MaxDrawingTime = TheDrawingTime; sInform = string.Format("Drawing Time: Overylay={0}, Time={1}, MinTime={2}, MaxTime={3}", TheLayerOverlay.Name, TheDrawingTime, oTrackingLayerOverlay.MinDrawingTime, oTrackingLayerOverlay.MaxDrawingTime); bOutCome = Variables.gLogInform.LogInform((OriStarTools.UtlLogInform.LogInformFunction.EventLog), "TrackingOverlay.loTracking_Drawn", sInform, EventLogEntryType.SuccessAudit); } // indicate drawing complete oTrackingLayerOverlay.bDrawingInProgress = false; return; }