示例#1
0
 public ProfileLogic(ProfileModel model, AdaptersExtender adaptersExtender, CityLogic city)
 {
     _profileModel                = model;
     _adaptersExtender            = adaptersExtender;
     _city                        = city;
     city.CurrentLocationChanged += CityLogic_LocationChanged;
     if (_city.CurrentLocation.HasValue)
     {
         _profileModel.CurrentLocation = _city.CurrentLocation.Value;
     }
     //UpdateCurrentLocation();
     //adaptersExtender.ServicesFactory.GetCurrentHardwareService().LocationChanged += ProfileLogic_LocationChanged;
 }
示例#2
0
 public PersonLogic(PersonModel model, AdaptersExtender adaptersExtender, CityLogic city)
 {
     _personModel      = model;
     _adaptersExtender = adaptersExtender;
     _city             = city;
 }
 public DriverAuthenticationRequestLogic(DriverAuthenticationRequestModel model, AdaptersExtender adaptersExtender, CityLogic city)
     : base(model, adaptersExtender, city)
 {
     _model = model;
 }
示例#4
0
 internal DriverProfileLogic(DriverProfileModel model, AdaptersExtender adaptersExtender, CityLogic city)
     : base(model, adaptersExtender, city)
 {
     _model = model;
     model.InitResponseDelegate = InitResponse;
     model.EnumeratePedestrianRequestsDelegate = EnumeratePedestrianRequests;
     model.EnumeratePedestriansDelegate        = EnumeratePedestrians;
     model.EnumerateCurrentResponsesDelegate   = EnumerateCurrentResponses;
     _pedestrians        = new UpdatableCollectionLoadDecorator <PedestrianLogic, IPedestrianInfo>(RetrivePedestrians, ComparePedestriansInfo, p => p.IsOnline, CreatePedestrianLogic);
     _pedestrianRequests = new UpdatableCollectionLoadDecorator <PedestrianRequestLogic, IPedestrianRequest>(RetrivePedestrianRequests, ComparePedestrianRequests, ValidatePedestrianRequest, CreatePedestrianRequestLogic);
     _currentResponses   = new UpdatableCollectionLoadDecorator <DriverProfileResponseLogic, IDriverResponse>(RetriveDriverResponses, CompareDriverResponses, ValidateDriverResponse, CreateDriverResponseLogic);
     _adaptersExtender.ServicesFactory.GetCurrentHardwareService().IncomingCallArrived  += HardwareService_IncomingCallArrived;
     _adaptersExtender.ServicesFactory.GetCurrentDataService().PedestrianRequestChanged += DataService_PedestrianRequestChanged;
     _adaptersExtender.ServicesFactory.GetCurrentDataService().PedestrianInfoChanged    += DataService_PedestrianInfoChanged;
     _pedestrians.ItemsCollectionChanged        += Pedestrians_ItemsCollectionChanged;
     _pedestrians.RequestFailed                 += Pedestrians_RequestFailed;
     _pedestrianRequests.ItemsChanged           += PedestrianRequests_ItemsChanged;
     _pedestrianRequests.ItemsCollectionChanged += PedestrianRequests_ItemsCollectionChanged;
     _pedestrianRequests.RequestFailed          += PedestrianRequests_RequestFailed;
 }
 public PedestrianAuthenticationRequestLogic(PedestrianAuthenticationRequestModel model, AdaptersExtender adaptersExtender, CityLogic city)
     : base(model, adaptersExtender, city)
 {
     _model = model;
 }
示例#6
0
 public PedestrianLogic(PedestrianModel model, AdaptersExtender adaptersExtender, CityLogic city)
     : base(model, adaptersExtender, city)
 {
     _model = model;
 }
示例#7
0
        public static AuthenticationRequestLogic Create(AuthenticationRequestModel model, AdaptersExtender adaptersExtender, CityLogic city)
        {
            switch (model.ParticipantType)
            {
            case ParticipantTypes.Driver:
                return(new DriverAuthenticationRequestLogic((DriverAuthenticationRequestModel)model, adaptersExtender, city));

                break;

            case ParticipantTypes.Pedestrian:
                return(new PedestrianAuthenticationRequestLogic((PedestrianAuthenticationRequestModel)model, adaptersExtender, city));

                break;

            default:
                throw new NotImplementedException();
                break;
            }
        }
示例#8
0
 public AuthenticationRequestLogic(AuthenticationRequestModel model, AdaptersExtender adaptersExtender, CityLogic city)
 {
     _model            = model;
     _adaptersExtender = adaptersExtender;
     _city             = city;
 }
示例#9
0
 private bool CompareCityInfo(CityLogic logic, ICityInfo slo)
 {
     return(logic.Model.Id == slo.Id);
 }
示例#10
0
 public DriverLogic(DriverModel model, AdaptersExtender adaptersExtender, CityLogic city)
     : base(model, adaptersExtender, city)
 {
     _model = model;
 }
示例#11
0
 public PedestrianProfileLogic(PedestrianProfileModel model, AdaptersExtender adaptersExtender, CityLogic city)
     : base(model, adaptersExtender, city)
 {
     _model = model;
     model.InitRequestDelegate                = InitRequest;
     model.EnumerateDriversDelegate           = EnumerateDrivers;
     model.EnumerateRequestsDelegate          = EnumerateRequests;
     model.EnumerateAcceptedResponsesDelegate = EnumerateAcceptedResponses;
     model.CallToDriverDelegate               = CallToDriver;
     _drivers           = new UpdatableCollectionLoadDecorator <DriverLogic, IDriverInfo>(RetriveDrivers, CompareDriversInfo, p => p.IsOnline, CreateDriverLogic);
     _requests          = new UpdatableCollectionLoadDecorator <PedestrianProfileRequestLogic, IPedestrianRequest>(RetriveRequests, CompareRequestsInfo, ValidateRequest, CreateRequestLogic);
     _acceptedResponses = new SimpleCollectionLoadDecorator <DriverResponseLogic>(RetriveAcceptedResponse);
     _adaptersExtender.ServicesFactory.GetCurrentDataService().DriverInfoChanged += DataService_DriverInfoChanged;
     _drivers.ItemsCollectionChanged           += Drivers_ItemsCollectionChanged;
     _acceptedResponses.ItemsCollectionChanged += AcceptedResponses_ItemsCollectionChanged;
 }