public FaceRecognitionLogin(TakenBookPresenter takenBookPresenter,
                             ILibraryData libraryData, UserPresenter userPresenter, IExceptionLogger exceptionLogger)
 {
     _libraryForm     = new Library(takenBookPresenter, libraryData, userPresenter, exceptionLogger);
     _faceRecognition = new EigenFaceRecognition(StaticStrings.FaceDetectionTrainingFile,
                                                 StaticStrings.FaceImagesPerUser, exceptionLogger);
 }
Beispiel #2
0
 private static async Task <List <BookModel> > GetBooksData(ILibraryData libraryClient)
 {
     return(await Policy
            .Handle <ApiException>(ex => ex.StatusCode == HttpStatusCode.TooManyRequests)
            .WaitAndRetryAsync(5, retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)))
            .ExecuteAsync(async() => await libraryClient.GetAllBooksAsync()));
 }
Beispiel #3
0
        public Library(TakenBookPresenter takenBookPresenter, ILibraryData libraryData, UserPresenter userPresenter,
                       IExceptionLogger exceptionLogger)
        {
            _takenBookPresenter = takenBookPresenter;
            _libraryData        = libraryData;
            _userPresenter      = userPresenter;
            _exceptionLogger    = exceptionLogger;

            InitializeComponent();


            try
            {
                var userTakenBooks = _takenBookPresenter.FindUserTakenBooks();

                foreach (var book in userTakenBooks)
                {
                    bookListBox.Items.Add(book.Author + book.Title + Translations.GetTranslatedString("returnOn") +
                                          book.HasToBeReturned);
                }
            }
            catch (Exception)
            {
                return;
            }
        }
Beispiel #4
0
        //three constructors depending on original init
        private AnimeItemAbstraction(ILibraryData entry, int?id = null)
        {
            if (entry != null)
            {
                EntryData   = entry;
                MyStartDate = entry.MyStartDate;
                MyEndDate   = entry.MyEndDate;
            }

            if (ResourceLocator.AiringInfoProvider.TryGetAiringDay(Id, out DayOfWeek day))
            {
                AirDay = (int)day + 1;
            }
            else
            {
                AirDay = -1;
            }

            if (!DataCache.TryRetrieveDataForId(id ?? Id, out VolatileDataCache data))
            {
                return;
            }
            VolatileData   = data;
            LoadedVolatile = true;
        }
Beispiel #5
0
        private static async Task GetBookData(ILibraryData libraryClient, ILibraryService libraryService)
        {
            try
            {
                var books = await GetBooksData(libraryClient);

                foreach (var book in books)
                {
                    var bookmodel = new Book()
                    {
                        Id        = book.Id,
                        Name      = book.Name,
                        Publisher = book.Publisher,
                        Country   = book.Country,
                        Released  = Convert.ToDateTime(book.Released)
                    };

                    libraryService.Add(bookmodel);
                }
            }
            catch (ApiException ex)
            {
                var content = ex.GetContentAs <Dictionary <String, String> >();
                Console.WriteLine(ex.StatusCode);
            }
        }
 public AnimeLibraryItemData(ILibraryData other)
 {
     Id          = other.Id;
     Title       = other.Title;
     AllEpisodes = other.AllEpisodes;
     ImgUrl      = other.ImgUrl;
     Type        = other.Type;
 }
Beispiel #7
0
 public LendingController(ILendingData lendingData, IClientData clientData, IBookCopiesData bookCopiesData, IBookData bookData, ILibraryData libraryData)
 {
     this.lendingData    = lendingData;
     this.clientData     = clientData;
     this.bookCopiesData = bookCopiesData;
     this.bookData       = bookData;
     this.libraryData    = libraryData;
 }
Beispiel #8
0
 public Login(TakenBookPresenter takenBookPresenter, ILibraryData libraryData, UserPresenter userPresenter,
              IExceptionLogger exceptionLogger)
 {
     _exceptionLogger = exceptionLogger;
     _mUserRepository = libraryData.userRepository;
     _libraryForm     = new Library(takenBookPresenter, libraryData, userPresenter, _exceptionLogger);
     InitializeComponent();
 }
        public BookActions(TakenBookPresenter takenBookPresenter, ILibraryData libraryData,
                           UserPresenter userPresenter, IExceptionLogger exceptionLogger)
        {
            InitializeComponent();
            ScannedBookInfo.Enabled = false;
            Info.Enabled            = false;

            _libraryForm = new Library(_mTakenBookPresenter, _libraryData, _userPresenter, _exceptionLogger);

            _userPresenter       = userPresenter;
            _libraryData         = libraryData;
            _mTakenBookPresenter = takenBookPresenter;
            _exceptionLogger     = exceptionLogger;
        }
        //three constructors depending on original init
        private AnimeItemAbstraction(ILibraryData entry, int? id = null)
        {
            if (entry != null)
            {
                EntryData = entry;
                MyStartDate = entry.MyStartDate;
                MyEndDate = entry.MyEndDate;
            }

            VolatileDataCache data;
            if (!DataCache.TryRetrieveDataForId(id ?? Id, out data)) return;
            VolatileData = data;
            LoadedVolatile = true;
        }
Beispiel #11
0
        public Opening(TakenBookPresenter takenBookPresenter, ILibraryData libraryData,
                       IInputValidator validator, IExceptionLogger exceptionLogger, UserPresenter userPresenter)
        {
            InitializeComponent();

            _takenBookPresenter       = takenBookPresenter;
            _libraryData              = libraryData;
            _validator                = validator;
            _exceptionLogger          = exceptionLogger;
            _userPresenter            = userPresenter;
            _faceRecognitionLoginForm = new FaceRecognitionLogin(takenBookPresenter, libraryData, userPresenter, _exceptionLogger);
            _registrationForm         = new Registration(_libraryData, _validator);
            _loginForm                = new Login(_takenBookPresenter, _libraryData, _userPresenter, _exceptionLogger);
        }
        //three constructors depending on original init
        private AnimeItemAbstraction(ILibraryData entry, int?id = null)
        {
            if (entry != null)
            {
                EntryData   = entry;
                MyStartDate = entry.MyStartDate;
                MyEndDate   = entry.MyEndDate;
            }

            if (!DataCache.TryRetrieveDataForId(id ?? Id, out VolatileDataCache data))
            {
                return;
            }
            VolatileData   = data;
            LoadedVolatile = true;
        }
Beispiel #13
0
        //three constructors depending on original init
        private AnimeItemAbstraction(ILibraryData entry, int?id = null)
        {
            if (entry != null)
            {
                EntryData = entry;
            }
            VolatileDataCache data;

            if (!DataCache.TryRetrieveDataForId(id ?? Id, out data))
            {
                return;
            }
            LoadedVolatile = true;
            AirDay         = data.DayOfAiring;
            GlobalScore    = data.GlobalScore;
            AirStartDate   = data.AirStartDate;
        }
Beispiel #14
0
        public Registration(ILibraryData libraryData, IInputValidator inputValidator)
        {
            _inputValidator = inputValidator;

            _usernameErrorProvider    = new ErrorProvider();
            _nameErrorProvider        = new ErrorProvider();
            _surnameErrorProvider     = new ErrorProvider();
            _emailErrorProvider       = new ErrorProvider();
            _passwordErrorProvider    = new ErrorProvider();
            _repPasswordErrorProvider = new ErrorProvider();

            InitializeComponent();
            SetupErrorProviders();

            registerButton.Enabled = false;

            _mUserPresenter = new UserPresenter(this, libraryData.userRepository);
        }
Beispiel #15
0
        public LibraryDataSet(ILibraryData data)
        {
            OverloadsHashMap = new HashMap <string, IReadOnlyGenericArray <LSLLibraryFunctionSignature> >();
            ConstantSet      = new HashSet <LSLLibraryConstantSignature>();
            EventSet         = new HashSet <LSLLibraryEventSignature>();
            FunctionSet      = new HashSet <LSLLibraryFunctionSignature>();
            EventHashMap     = new HashMap <string, LSLLibraryEventSignature>();
            ConstantHashMap  = new HashMap <string, LSLLibraryConstantSignature>();

            foreach (var f in data.LSLFunctions())
            {
                if (OverloadsHashMap.ContainsKey(f.Name))
                {
                    ((GenericArray <LSLLibraryFunctionSignature>)OverloadsHashMap[f.Name]).Add(f);
                }
                else
                {
                    OverloadsHashMap.Add(f.Name, new GenericArray <LSLLibraryFunctionSignature> {
                        f
                    });
                }

                FunctionSet.Add(f);
            }

            foreach (var f in data.LSLEvents())
            {
                EventHashMap.Add(f.Name, f);
                EventSet.Add(f);
            }

            foreach (var f in data.LSLConstants())
            {
                ConstantHashMap.Add(f.Name, f);
                ConstantSet.Add(f);
            }
        }
 public LibraryBL(ILibraryData data)
 {
     _dataLayer = data;
 }
 public AuthorsController(ILibraryData data)
 {
     this.data = data;
 }
Beispiel #18
0
 public void AddProvider(ILibraryData p)
 {
     _providers.Add(p);
 }
Beispiel #19
0
 public BooksController(ILibraryData data)
 {
     this.data = data;
 }
 public GenresController(ILibraryData data)
 {
     this.data = data;
 }
 public BookCopiesController(IBookCopiesData bookCopiesData, ILibraryData libraryData, IBookData bookData)
 {
     this.bookCopiesData = bookCopiesData;
     this.libraryData    = libraryData;
     this.bookData       = bookData;
 }
Beispiel #22
0
 public DetailsModel(ILibraryData libraryData)
 {
     this.library = libraryData;
 }
 public ListModel(IConfiguration configuration, ILibraryData libraryData)
 {
     Configuration    = configuration;
     this.libraryData = libraryData;
 }
Beispiel #24
0
 public ListModel(IConfiguration config, ILibraryData libraryData)
 {
     this.Config      = config;
     this.libraryData = libraryData;
 }
Beispiel #25
0
 public UpdateModel(ILibraryData libraryData, IHtmlHelper htmlHelper)
 {
     this.libraryData = libraryData;
     this.htmlHelper  = htmlHelper;
 }
 public GenresController(ILibraryData data)
 {
     this.data = data;
 }
 public LibraryController(ILibraryData libraryData)
 {
     this.libraryData = libraryData;
 }
Beispiel #28
0
 public AuthorsController(ILibraryData data)
 {
     this.data = data;
 }
 public BooksController(ILibraryData data)
 {
     this.data = data;
 }