Beispiel #1
0
        public void Init()
        {
            LumenApplication             app        = LumenApplication.Instance;
            IObservable <ScaricoFotoMsg> observable = app.bus.Observe <ScaricoFotoMsg>();

            observable.Subscribe(this);

            this._scaricatoreImpl = new ScaricatoreFotoSrvImpl();
            _scaricatoreImpl.start();

            // -------
            using (LumenEntities dbContext = new LumenEntities())
            {
                InfoFissa i = dbContext.InfosFisse.Single <InfoFissa>(f => f.id == "K");

                // Se hai fatto bene la configurazione, il fotografo artista deve sempre esistere
                _artista = dbContext.Fotografi.Single(f => f.id == Configurazione.ID_FOTOGRAFO_DEFAULT);
            }

            String doveSono = Assembly.GetExecutingAssembly().Location;

            string appPath  = Path.GetDirectoryName(doveSono);
            string cartella = Path.Combine(appPath, "images");
            string nomeSrc  = Directory.GetFiles(cartella, "barCode.jpg").ElementAt(0);

            FileInfo fiInfo = new FileInfo(nomeSrc);

            ParamScarica param = new ParamScarica();

            param.nomeFileSingolo      = nomeSrc;
            param.cartellaSorgente     = null;
            param.eliminaFilesSorgenti = false;

            param.flashCardConfig = new Config.FlashCardConfig(_artista);
            _scaricatoreImpl.scarica(param);

            while (!_puoiTogliereLaFlashCard)
            {
                Thread.Sleep(10000);
            }

            Console.Write("ok puoi togliere la flash card. Attendere elaborazione in corso ...");

            while (!_elaborazioneTerminata)
            {
                Thread.Sleep(10000);
            }

            Console.WriteLine("Ecco finito");


            this._barCodeimpl = new BarCodeSrvImpl();

            IRicercatoreSrv srv2 = app.creaServizio <IRicercatoreSrv>();
        }
Beispiel #2
0
        public void Init()
        {
            LumenApplication             app        = LumenApplication.Instance;
            IObservable <ScaricoFotoMsg> observable = app.bus.Observe <ScaricoFotoMsg>();

            observable.Subscribe(this);

            _impl = new ScaricatoreFotoSrvImpl();
            _impl.start();



            // -------
            using (LumenEntities dbContext = new LumenEntities()) {
                InfoFissa i = dbContext.InfosFisse.Single <InfoFissa>(f => f.id == "K");

                _mario = Utilita.ottieniFotografoMario(dbContext);

                // Se hai fatto bene la configurazione, il fotografo artista deve sempre esistere
                _artista = dbContext.Fotografi.Single(f => f.id == Configurazione.ID_FOTOGRAFO_DEFAULT);

                // cerco l'evento con la descrizione
                _ballo = (from e in dbContext.Eventi
                          where e.descrizione == "BALLO"
                          select e).FirstOrDefault();

                if (_ballo == null)
                {
                    _ballo = new Evento();

                    _ballo.descrizione = "BALLO";
                    _ballo.id          = Guid.NewGuid();
                    dbContext.Eventi.Add(_ballo);
                }

                _briscola = (from e in dbContext.Eventi
                             where e.descrizione == "BRISCOLA"
                             select e).FirstOrDefault();

                if (_briscola == null)
                {
                    _briscola             = new Evento();
                    _briscola.id          = Guid.NewGuid();
                    _briscola.descrizione = "BRISCOLA";
                    dbContext.Eventi.Add(_briscola);
                }

                dbContext.SaveChanges();
            }
        }