Пример #1
0
        /// <summary>
        /// Returns a reference to the <see cref="Tracker"/> class object.
        /// </summary>
        /// <param name="solver">The solver to be used by the returned tracker.</param>
        /// <param name="geocoder">The geocoder to be used by the returned tracker.</param>
        /// <param name="messageReporter">The messageReporter to be used by the returned
        /// tracker.</param>
        /// <returns>A new <see cref="Tracker"/> class instance.</returns>
        /// <exception cref="ArgumentNullException"><paramref name="solver"/>,
        /// <paramref name="geocoder"/> or <paramref name="messageReporter"/> is a null
        /// reference.</exception>
        public Tracker GetTracker(
            IVrpSolver solver,
            IGeocoder geocoder,
            IMessageReporter messageReporter)
        {
            CodeContract.RequiresNotNull("solver", solver);
            CodeContract.RequiresNotNull("geocoder", geocoder);
            CodeContract.RequiresNotNull("messageReporter", messageReporter);

            _CheckSettings(_settings);

            var settings = new TrackingSettings
            {
                BreakTolerance = _settings.TrackingSettings.BreakTolerance ?? 0,
            };

            var uri     = new Uri(_settings.TrackingServiceInfo.RestUrl);
            var service = FeatureService.Create(uri, Server);
            var trackingServiceClient = new TrackingServiceClient(service);

            var trackingService        = new TrackingServiceClient(service);
            var synchronizationService = new SynchronizationService(trackingServiceClient);

            return(new Tracker(
                       settings,
                       trackingService,
                       synchronizationService,
                       solver,
                       geocoder,
                       messageReporter));
        }
        /// <summary>
        /// Returns a reference to the <see cref="Tracker"/> class object.
        /// </summary>
        /// <param name="solver">The solver to be used by the returned tracker.</param>
        /// <param name="geocoder">The geocoder to be used by the returned tracker.</param>
        /// <param name="messageReporter">The messageReporter to be used by the returned
        /// tracker.</param>
        /// <returns>A new <see cref="Tracker"/> class instance.</returns>
        /// <exception cref="ArgumentNullException"><paramref name="solver"/>,
        /// <paramref name="geocoder"/> or <paramref name="messageReporter"/> is a null
        /// reference.</exception>
        public Tracker GetTracker(
            IVrpSolver solver,
            IGeocoder geocoder,
            IMessageReporter messageReporter)
        {
            CodeContract.RequiresNotNull("solver", solver);
            CodeContract.RequiresNotNull("geocoder", geocoder);
            CodeContract.RequiresNotNull("messageReporter", messageReporter);

            _CheckSettings(_settings);

            var settings = new TrackingSettings
            {
                BreakTolerance = _settings.TrackingSettings.BreakTolerance ?? 0,
            };

            var uri = new Uri(_settings.TrackingServiceInfo.RestUrl);
            var service = FeatureService.Create(uri, Server);
            var trackingServiceClient = new TrackingServiceClient(service);

            var trackingService = new TrackingServiceClient(service);
            var synchronizationService = new SynchronizationService(trackingServiceClient);

            return new Tracker(
                settings,
                trackingService,
                synchronizationService,
                solver,
                geocoder,
                messageReporter);
        }