Exemplo n.º 1
0
        private void StartTimer(string id)
        {
            string      elid = string.Format("timer-{0}", id);
            ReportTimer t    = new ReportTimer
            {
                Interval           = 100
                , Enabled          = false
                , ElapsedFromStart = 0
                , Element          = wbReports.Document != null?wbReports.Document.GetElementById(elid) : null
            };

            t.Elapsed += (sender, e) =>
            {
                t.ElapsedFromStart += 100;
                if (null == t.Element)
                {
                    return;
                }
                double seconds = (double)t.ElapsedFromStart / 1000;
                t.Element.InnerHtml = string.Format("{0:0.0} sec", seconds);
            };
            _timers.Add(id, t);
            t.Start();
        }
Exemplo n.º 2
0
 private void StartTimer(string id)
 {
     string elid = string.Format("timer-{0}", id);
     ReportTimer t = new ReportTimer
     {
         Interval = 100
         , Enabled = false
         , ElapsedFromStart = 0
         , Element = wbReports.Document != null ? wbReports.Document.GetElementById(elid) : null
     };
     t.Elapsed += (sender, e) =>
     {
         t.ElapsedFromStart += 100;
         if (null == t.Element) return;
         double seconds = (double) t.ElapsedFromStart/1000;
         t.Element.InnerHtml = string.Format("{0:0.0} sec", seconds);
     };
     _timers.Add(id, t);
     t.Start();
 }