Esempio n. 1
0
        private static Stop StopFromRecord(MetroDBContext context, StopRecord record, char type = 'I')
        {
            Location location = context.Locations
                                .Where(l => l.ShortForm == record.Location).FirstOrDefault();

            return(new Stop
            {
                Location = location,
                Time = new TimeSpan(0, record.Time.Hours, record.Time.Minutes, record.Time.Seconds),
                StopType = type
            });
        }
Esempio n. 2
0
        private static Stop StopFromRecord(StopRecord stop, CifSQLContext context, char stoptype = 'I')
        {
            int locationid = context.Locations
                             .Where(l => l.ShortForm == stop.Location).FirstOrDefault().Id;

            Stop s = new Stop
            {
                LocationId = locationid,
                Time       = new TimeSpan(0, stop.Time.Hours, stop.Time.Minutes, stop.Time.Seconds),
                StopType   = stoptype
            };

            return(s);
        }
Esempio n. 3
0
            public void Stop()
            {
                var now = DateTime.Now;

                _stopDateTime = now;
                var stopRecord = new StopRecord()
                {
                    StopDateTime = now,
                    ElapsedTime  = now.Subtract(_startDateTime),
                    Timer        = _parentTimer,
                    TimingId     = _id
                };

                _parentTimer._stopWriter.Write(ref stopRecord);
            }
Esempio n. 4
0
        private void ProcessStopRecord(string data)
        {
            CurrentState = DebuggerState.Paused;

            var stopRecord = StopRecord.FromArgumentList(data.ToNameValuePairs());

            if (InternalStopped != null)
            {
                InternalStopped(this, stopRecord);
            }

            if (Stopped != null && StoppedEventIsEnabled)
            {
                Task.Factory.StartNew(() => { Stopped(this, stopRecord); });
            }
        }