Exemplo n.º 1
0
 public ImageController(IRepository repository, IRatingCalculator rating, ISortCalculator sort, IImageFolder folder)
 {
     _repository = repository;
     _rating     = rating;
     _sort       = sort;
     _folder     = folder;
 }
Exemplo n.º 2
0
 public CommunityController(IBnhConfig config, IBnhRepositories repos, IRatingCalculator rating)
     : base(config, repos, rating)
 {
     this.config = config;
     this.repos = repos;
     this.rating = rating;
 }
Exemplo n.º 3
0
 public AdminController(IBnhRepositories repos, IRatingCalculator rating, IBnhConfig config, IPathMapper pathMapper, ISearchProvider searcher)
 {
     this.repos = repos;
     this.rating = rating;
     this.config = config;
     this.pathMapper = pathMapper;
     this.searcher = searcher;
 }
        public SceneViewModelContext(Controller controller, IConfig config, IRepositories repos, IRatingCalculator rating, ISceneHolder sceneHolder)
            : base(controller, config, repos, rating)
        {
            this.SceneHolder = sceneHolder;

            this.LinkableBricks = new Lazy<Dictionary<string,Brick>>(() =>
                this.Repos.SpecialScenes.Single(s => s.SceneId == Constants.LinkableBricksSceneId)
                    .Scene.Walls.SelectMany(w => w.Bricks)
                    .ToDictionary(b => b.BrickId, b => b));
        }
 public MainWindow()
 {
     var factory = new BasicFactory();
     InitializeComponent();
     _repository = factory.GetRepository(RepositoryType.FILEREPOSITORY);
     _calculator = factory.GetCalculator(CalculatorType.HSERATINGCALCULATOR);
     _repository.GradesChanged += RefreshGrid;
     _repository.IOExceptionOccured += IOExceptionAlert;
     dataGridGrades.ItemsSource = _repository.Grades;
 }
Exemplo n.º 6
0
 public ChampionshipManager(TeamCreator teamCreator,
                            IMatchResultGatherer matchResultGatherer,
                            IScoreCalculator scoreCalculator,
                            IRatingCalculator ratingCalculator,
                            IRepository repository)
 {
     TeamCreator         = teamCreator;
     MatchResultGatherer = matchResultGatherer;
     ScoreCalculator     = scoreCalculator;
     RatingCalculator    = ratingCalculator;
     Repository          = repository;
 }
Exemplo n.º 7
0
        public ViewModelContext(Controller controller, IConfig config, IRepositories repos, IRatingCalculator rating)
        {
            this.controller = controller;

            this.UrlHelper = new UrlHelper(controller.HttpContext.Request.RequestContext);

            this.HtmlHelper = new HtmlHelper(new ViewContext(controller.ControllerContext, new WebFormView(
                controller.ControllerContext, "fake"), new ViewDataDictionary(), new TempDataDictionary(), new StringWriter()), new ViewPage());

            this.Config = config;
            this.Repos = repos;
            this.RatingCalculator = rating;

            this.ViewBag = controller.ViewBag;
        }
        public AddEditStudentWindow(Student student, IRatingCalculator calculator)
        {
            InitializeComponent();
            _calculator = calculator;

            if (student != null)
            {
                Title                      = "Edit student";
                textBoxName.Text           = student.Name;
                dataGridGrades.ItemsSource = student.Grades;
                textBlockRating.Text       = $"Rating: {_calculator.GetRating(student)}";
            }
            else
            {
                Title = "Add course";
            }
            textBoxName.Focus();
            Student = student;
        }
Exemplo n.º 9
0
 public PlayerRepository(ApplicationDbContext context, IRatingCalculator calc)
 {
     _context = context ?? throw new ArgumentNullException(nameof(context));
     _calc    = calc ?? throw new ArgumentNullException(nameof(calc));
 }
 public TemplateSceneController(IConfig config, IRepositories repos, IRatingCalculator rating)
     : base(config, repos, rating)
 {
     this.repos = repos;
 }
Exemplo n.º 11
0
 public RatingUpdater(TContext context, IRatingCalculator ratingCalculator) : base(ratingCalculator)
 {
     _context = context;
 }
Exemplo n.º 12
0
 public UpdateImageRating(IRepository repository, IRatingCalculator rating, ISortCalculator sort)
 {
     _repository = repository;
     _rating     = rating;
     _sort       = sort;
 }
Exemplo n.º 13
0
 public SceneController(IConfig config, IRepositories repos, IRatingCalculator rating)
 {
     this.config = config;
     this.repos = repos;
     this.rating = rating;
 }
Exemplo n.º 14
0
 /// <summary>
 /// Initialize the <see cref="IRatingUpdater"/>.
 /// </summary>
 /// <param name="ratingCalculator">The rating calculator.</param>
 protected RatingUpdaterBase(IRatingCalculator ratingCalculator)
 {
     _ratingCalculator = ratingCalculator;
 }