示例#1
0
        public NeuronTreePaneViewModel(INeuronApplicationService neuronApplicationService = null, INeuronQueryService neuronQueryService = null, INotificationApplicationService notificationApplicationService = null,
                                       IStatusService statusService = null, IDialogService dialogService = null, IOriginService originService = null)
        {
            this.dialogService                  = dialogService ?? Locator.Current.GetService <IDialogService>();
            this.neuronApplicationService       = neuronApplicationService ?? Locator.Current.GetService <INeuronApplicationService>();
            this.neuronQueryService             = neuronQueryService ?? Locator.Current.GetService <INeuronQueryService>();
            this.notificationApplicationService = notificationApplicationService ?? Locator.Current.GetService <INotificationApplicationService>();
            this.statusService                  = statusService ?? Locator.Current.GetService <IStatusService>();
            this.originService                  = originService ?? Locator.Current.GetService <IOriginService>();

            this.statusService.WhenPropertyChanged(s => s.Message)
            .Subscribe(s => this.StatusMessage = s.Sender.Message);

            bool DefaultPredicate(Node <Neuron, int> node) => node.IsRoot;

            var cache = new SourceCache <Neuron, int>(x => x.UIId);

            this.AddCommand       = ReactiveCommand.Create <object>(async(parameter) => await this.OnAddClicked(cache, parameter));
            this.SetRegionCommand = ReactiveCommand.Create <object>(async(parameter) => await this.OnSetRegionIdClicked(parameter));
            this.ReloadCommand    = ReactiveCommand.Create(async() => await this.OnReloadClicked(cache));

            this.cleanUp = cache.AsObservableCache().Connect()
                           .TransformToTree(child => child.CentralUIId, Observable.Return((Func <Node <Neuron, int>, bool>)DefaultPredicate))
                           .Transform(e =>
                                      e.Item.Type == RelativeType.Postsynaptic ?
                                      (NeuronViewModelBase)(new PostsynapticViewModel(this, e.Item.Tag, e, cache)) :
                                      (NeuronViewModelBase)(new PresynapticViewModel(this, e.Item.Tag, e, cache)))
                           .Bind(out this.children)
                           .DisposeMany()
                           .Subscribe();

            this.Target         = null;
            this.Loading        = false;
            this.IconSourcePath = @"pack://application:,,,/d23-wpf;component/images/hierarchy.ico";
        }
示例#2
0
 public PlantInfoController(IPlantInfoService plantInfoService, IOriginService originService, IPhotoService photoService, IUserService userService)
 {
     _plantInfoService = plantInfoService;
     _originService    = originService;
     _photoService     = photoService;
     _userService      = userService;
 }
示例#3
0
 public EventController(IMapper mapper, IInternService internService, IEventService eventService, IEventTypeService eventTypeService, IOriginService origin)
 {
     _mapper           = mapper;
     _origin           = origin;
     _internService    = internService;
     _eventService     = eventService;
     _eventTypeService = eventTypeService;
 }
 public SpecimenController(ISpecimenService specimenService, IInventoryService inventoryService, IPhotoService photoService, IOriginService originService, IUserService userService)
 {
     _specimenService  = specimenService;
     _inventoryService = inventoryService;
     _photoService     = photoService;
     _originService    = originService;
     _userService      = userService;
 }
 public ProductController(IProductService productService, ISizeService sizeService, ITypeService typeService, IOriginService originService, IModelService modelService)
 {
     _productService = productService;
     _sizeService = sizeService;
     _typeService = typeService;
     _originService = originService;
     _modelService = modelService;
 }
示例#6
0
        public void SetUp()
        {
            _originService = Substitute.For <IOriginService>();
            _mapper        = Substitute.For <IMapper>();
            _characterRandomNameService = Substitute.For <ICharacterRandomNameService>();

            _originsController = new OriginsController(_originService, _mapper, _characterRandomNameService);
        }
 public UserController(IMapper mapper, IUserService userService,
                       IOptions <AppSettings> appSettings, IOriginService origin)
 {
     _origin      = origin;
     _mapper      = mapper;
     _userService = userService;
     _appSettings = appSettings.Value;
 }
示例#8
0
        public SynonymProcessor(ISynonymService synonymService, IOriginService originService, ITaxonService taxonService)
        {
            _synonymService = synonymService;
            _originService  = originService;
            _taxonService   = taxonService;

            Taxons  = new List <Taxon>();
            Origins = new List <Origin>();
        }
示例#9
0
 public OriginsController(
     ILogger <OriginsController> logger,
     IOriginService origin,
     IMailAccountService mailAccount)
 {
     _logger      = logger;
     _origin      = origin;
     _mailAccount = mailAccount;
 }
 public OriginsController(
     IOriginService originService,
     IMapper mapper,
     ICharacterRandomNameService characterRandomNameService
     )
 {
     _originService = originService;
     _mapper        = mapper;
     _characterRandomNameService = characterRandomNameService;
 }
 public void Init()
 {
     TestUtil.DeleteDataInDatabase();
     TestUtil.InsertDataDatabase();
     AutoMapperConfiguration.Configure();
     _originElasticsearch = new OriginElasticsearch();
     _context = new MicrobrewitContext();
     _repository = new OriginRepository();
     _originService = new OriginService(_originElasticsearch,_repository);
     _controller = new OriginController(_originService);
 }
示例#12
0
 public void Init()
 {
     TestUtil.DeleteDataInDatabase();
     TestUtil.InsertDataDatabase();
     AutoMapperConfiguration.Configure();
     _originElasticsearch = new OriginElasticsearch();
     _context             = new MicrobrewitContext();
     _repository          = new OriginRepository();
     _originService       = new OriginService(_originElasticsearch, _repository);
     _controller          = new OriginController(_originService);
 }
示例#13
0
 public SendMailController(
     ILogger <SendMailController> logger
     , IMailAccountService mailAccount
     , IAllowedSiteService allowedSite
     , IOriginService origin)
 {
     _logger      = logger;
     _mailAccount = mailAccount;
     _allowedSite = allowedSite;
     _origin      = origin;
 }
示例#14
0
        public PlantInfoProcessor(ILifeformService lifeformService, IOriginService originService, IPlantInfoService plantInfoService, ITaxonService taxonService, ILocationService locationService)
        {
            _lifeformService  = lifeformService;
            _originService    = originService;
            _plantInfoService = plantInfoService;
            _taxonService     = taxonService;
            _locationService  = locationService;

            Lifeforms = new List <Lifeform>();
            Taxons    = new List <Taxon>();
            Origins   = new List <Origin>();
        }
示例#15
0
        public PlantInfoProcessor(ILifeformService lifeformService, IOriginService originService, IPlantInfoService plantInfoService, ITaxonService taxonService,
                                  ILocationService locationService, IIndex <SearchModels.PlantInfo, PlantInfo> plantInfoIndex, List <Lifeform> lifeforms, List <Taxon> taxons, List <Origin> origins)
        {
            _lifeformService  = lifeformService;
            _originService    = originService;
            _plantInfoService = plantInfoService;
            _taxonService     = taxonService;
            _locationService  = locationService;
            _plantInfoIndex   = plantInfoIndex;

            Origins   = origins;
            Lifeforms = lifeforms;
            Taxons    = taxons;
        }
 public ImportTransformOrchestrator(ILifeformService lifeformService, IOriginService originService, IPlantInfoService plantInfoService,
                                    ILocationService locationService, ITaxonService taxonService, ISynonymService synonymService, IRepository <PlantInfo> plantInfoRepository, IRepository <Specimen> specimenRepository,
                                    ISearchClient <SearchModels.PlantInfo> searchClient, IIndex <SearchModels.PlantInfo, Emergence.Data.Shared.Models.PlantInfo> plantInfoIndex,
                                    IIndex <SearchModels.Specimen, Emergence.Data.Shared.Models.Specimen> specimenIndex)
 {
     _lifeformService     = lifeformService;
     _originService       = originService;
     _plantInfoService    = plantInfoService;
     _locationService     = locationService;
     _taxonService        = taxonService;
     _synonymService      = synonymService;
     _plantInfoRepository = plantInfoRepository;
     _specimenRepository  = specimenRepository;
     _searchClient        = searchClient;
     _plantInfoIndex      = plantInfoIndex;
     _specimenIndex       = specimenIndex;
 }
示例#17
0
 public InventoryService(IRepository <Data.Shared.Stores.Inventory> inventoryRepository, IRepository <Data.Shared.Stores.InventoryItem> inventoryItemRepository, IOriginService originService)
 {
     _inventoryRepository     = inventoryRepository;
     _inventoryItemRepository = inventoryItemRepository;
     _originService           = originService;
 }
 public OriginController(IOriginService service)
 {
     this.service = service;
 }
示例#19
0
 public InternController(IServiceFactory factory, IMapper mapper, IOriginService origin)
 {
     _serviceFactory = factory;
     _mapper         = mapper;
     _origin         = origin;
 }
示例#20
0
 public TrainingController(IMapper mapper, IServiceFactory factory, IOriginService origin)
 {
     _origin         = origin;
     _mapper         = mapper;
     _serviceFactory = factory;
 }
示例#21
0
 public OriginController(IOriginService originService, IUserService userService, IPhotoService photoService)
 {
     _originService = originService;
     _userService   = userService;
     _photoService  = photoService;
 }
 public OriginsController(IOriginService originService)
 {
     _originService = originService;
 }
 public OriginController(IOriginService originService)
 {
     _originService = originService;
 }