コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DigitalWatch.Components.TimeComponent"/> class.
 /// </summary>
 /// <param name="timeToken">Time token.</param>
 public TimeComponent(object timeToken)
 {
     timeManager    = TimeManager.GetInstance();
     inEditorMode   = false;
     this.timeToken = timeToken;
     timeManager.AddInterval(new TimeReached(OnTimeUpdate), timeToken);
 }
コード例 #2
0
 /// <summary>
 /// Start/resume this instance.
 /// The Time component will automaticly acquire a timeToken if the token was not supplied
 /// in the contructor.
 /// </summary>
 public void Start()
 {
     if (timeToken == null)
     {
         timeToken = timeManager.GetTimeToken();
         timeManager.AddInterval(new TimeReached(OnTimeUpdate), timeToken);
     }
     else
     {
         timeManager.ResumeInterval(timeToken);
     }
     ForceScreenUpdate();
 }