Пример #1
0
        //no

        public List <Truck> getTrucks()
        {
            List <Truck> trucks = new List <Truck>();

            if (System.Threading.Monitor.TryEnter(obj4, 45000))
            {
                try
                {
                    List <SpeedSharkServer.Model.Truck> returnList = truckCtr.getTrucks();

                    if (returnList.Count != 0)
                    {
                        foreach (SpeedSharkServer.Model.Truck hostedTruck in returnList)
                        {
                            Truck serviceTruck = new Truck();

                            serviceTruck.TruckId = hostedTruck.truckId;
                            serviceTruck.Status  = hostedTruck.status;

                            trucks.Add(serviceTruck);
                        }
                    }
                }
                catch (NullReferenceException)
                {
                }
                finally
                {
                    System.Threading.Monitor.Exit(obj4);
                }
            }

            return(trucks);
        }