time enabled layer throug ARCobject DOTNET SDK

Discussion created by nqazi on Apr 29, 2013
I am using ARCObject SDK 10.1  to develop a  Add-in to display time enabled layer. I. following is the code that  i used to dispaly time enable data layer on every second.
While my following code is work good . however there is a a problem which is not clear. when i run the following code than i assume that on every second it should display one point , but contrary to this it actually displays two point.  I called this method on a timer event with values form 1 to 100. it is working but it is displaying two points as shown in the figure. I have used this code from ESRI samples. Any suggestion please.

public void UpdateCurrentTime(double progress)
      if (progress <= 0)
        progress = 0.05;
      else if (progress >= 100)
        progress = 0.95;
        //Calculate how far into the layer to jump
      ITimeDuration offsetToNewCurrentTime = m_myLayerTimeExtent.QueryTimeDuration();
      IMxDocument pMxDoc = ArcMap.Document;
      IMap pMap = pMxDoc.FocusMap;
      IActiveView pActiveView = pMap as IActiveView;
      IScreenDisplay pScreenDisplay = pActiveView.ScreenDisplay;
      ITimeDisplay pTimeDisplay = pScreenDisplay as ITimeDisplay;

      ITime startTime = m_myLayerTimeExtent.StartTime;
      ITime endTime = (ITime)((IClone)startTime).Clone();
      ITimeExtent pTimeExt = new TimeExtentClass();
      pTimeExt.SetExtent(startTime, endTime);
      pTimeExt.Empty = false;
        pTimeDisplay.TimeValue = pTimeExt as ITimeValue;


    protected override void OnUpdate()
      Enabled = true;