コード例 #1
0
        private static List<DarwinCallingPoint> createCallingPointList(ArrayOfCallingPoints[] arrayOfCallingPoints)
        {
            List<DarwinCallingPoint> result = new List<DarwinCallingPoint>();
            if(arrayOfCallingPoints==null)
                return result;
            foreach (ArrayOfCallingPoints arrayOfPoints in arrayOfCallingPoints)//This does throw away some information that I'm not modelling
                foreach (CallingPoint cp in arrayOfPoints.callingPoint)
                {
                    DateTime? scheduled = parseScheduled(cp.st);
                    DateTime? actual = ParseEstimatedDateTime(cp.at, scheduled);//this also passes "On time" if it matches the schedule
                    DateTime? estimate = ParseEstimatedDateTime(cp.et, scheduled);
                    DarwinCallingPoint toAdd = new DarwinCallingPoint(
                        cp.locationName, cp.crs, scheduled, estimate, actual, cp.isCancelled, cp.length, cp.detachFront, cp.adhocAlerts);
                    result.Add(toAdd);

                }
            return result;
        }
        private static List <DarwinCallingPoint> createCallingPointList(ArrayOfCallingPoints[] arrayOfCallingPoints)
        {
            List <DarwinCallingPoint> result = new List <DarwinCallingPoint>();

            if (arrayOfCallingPoints == null)
            {
                return(result);
            }
            foreach (ArrayOfCallingPoints arrayOfPoints in arrayOfCallingPoints)//This does throw away some information that I'm not modelling
            {
                foreach (CallingPoint cp in arrayOfPoints.callingPoint)
                {
                    DateTime?          scheduled = parseScheduled(cp.st);
                    DateTime?          actual    = ParseEstimatedDateTime(cp.at, scheduled);//this also passes "On time" if it matches the schedule
                    DateTime?          estimate  = ParseEstimatedDateTime(cp.et, scheduled);
                    DarwinCallingPoint toAdd     = new DarwinCallingPoint(
                        cp.locationName, cp.crs, scheduled, estimate, actual, cp.isCancelled, cp.length, cp.detachFront, cp.adhocAlerts);
                    result.Add(toAdd);
                }
            }
            return(result);
        }