Exemplo n.º 1
0
 public void Dispose()
 {
     if (!owner.disposed)
     {
         owner.SetState(0, _twi._owner);
     }
     JsExtLib.ClearTimeout(_ctx);
 }
Exemplo n.º 2
0
            private JSC.JSValue SetAlarm(JSC.JSValue func, JSC.JSValue time)
            {
                var jd = time.Value as JSL.Date;

                if (jd != null)
                {
                    return(JsExtLib.SetTimer(func, jd.ToDateTime(), _ctx));
                }
                else
                {
                    throw new ArgumentException("SetAlarm(, Date)");
                }
            }
Exemplo n.º 3
0
        public void Tick1()
        {
            if (_owner.disposed && !Disposed)
            {
                Disposed = true;
                foreach (var p in _pins.Where(z => z.Owner.parent != _owner))
                {
                    p.DeleteLink(this);
                }
                _pins.Clear();
                if (_ctx != null)
                {
                    JsExtLib.ClearTimeout(_ctx);
                }
                _ctx      = null;
                _self     = null;
                _calcFunc = null;
                return;
            }
            var ln = 0;

            foreach (var p in _pins.Where(z => z.Source != this && z.Layer > 0))
            {
                if (ln < p.Layer)
                {
                    ln = p.Layer;
                }
            }
            ln++;
            if (_layer != ln)
            {
                List <ILoItem> route = new List <ILoItem>();
                foreach (var p in _pins.Where(z => z.Source != this && z.Layer > 0))
                {
                    if (p.Route != null)
                    {
                        route.AddRange(p.Route);
                    }
                }
                route.Add(this);
                Route  = route.ToArray();
                _layer = ln;
                foreach (var p in _pins.Where(z => z.Source == this))
                {
                    _pl.EnqueueIn(p);
                }
                //Log.Debug(this.ToString());
            }
        }
Exemplo n.º 4
0
 private JSC.JSValue SetInterval(JSC.JSValue func, int interval)
 {
     return(JsExtLib.SetTimer(func, interval, interval, _ctx));
 }
Exemplo n.º 5
0
 private JSC.JSValue SetTimeout(JSC.JSValue func, int to)
 {
     return(JsExtLib.SetTimer(func, to, -1, _ctx));
 }