/// <summary>
 /// Initializes a new instance of the DivisionViewModel class.
 /// </summary>
 /// <param name="parent"></param>
 /// <param name="controlService"></param>
 /// <param name="division"></param>
 /// <param name="sharedService"></param>
 /// <param name="lazyLoadChildren"></param>
 public DivisionNodeViewModel(ITreeViewItemViewModel parent, ISeasonStandingsControlService controlService,
                              Division division, ISharedService sharedService = null, bool lazyLoadChildren = false)
     : base(parent, controlService, sharedService, lazyLoadChildren)
 {
     // Assign argument values to member fields.
     _division = division ?? throw new ArgumentNullException("division");
 }
Exemple #2
0
 public void SetUp()
 {
     _parent         = A.Fake <TreeViewItemViewModel>();
     _controlService = A.Fake <ISeasonStandingsControlService>();
     _division       = new Division();
     _sharedService  = A.Fake <ISharedService>();
 }
 public void SetUp()
 {
     _parent         = A.Fake <ITreeViewItemViewModel>();
     _controlService = A.Fake <ISeasonStandingsControlService>();
     _conference     = new Conference();
     _sharedService  = A.Fake <ISharedService>();
 }
Exemple #4
0
 /// <summary>
 /// Initializes a new instance of the Conference class.
 /// </summary>
 /// <param name="parent"></param>
 /// <param name="controlService"></param>
 /// <param name="conference"></param>
 /// <param name="sharedService"></param>
 /// <param name="lazyLoadChildren"></param>
 public ConferenceNodeViewModel(ITreeViewItemViewModel parent, ISeasonStandingsControlService controlService,
                                Conference conference, ISharedService sharedService = null, bool lazyLoadChildren = true)
     : base(parent, controlService, sharedService, lazyLoadChildren)
 {
     // Assign argument values to member fields.
     _conference = conference ?? throw new ArgumentNullException("conference");
 }
 public void SetUp()
 {
     _parentControl        = A.Fake <ILeaguesTreeViewViewModel>();
     _controlService       = A.Fake <ISeasonStandingsControlService>();
     _league               = new League();
     _conferenceRepository = A.Fake <IRepository <Conference> >();
     _sharedService        = A.Fake <ISharedService>();
 }
        /// <summary>
        /// Initializes a new instance of the StandingsControlViewModel class
        /// </summary>
        /// <param name="controlService"></param>
        public SeasonStandingsControlViewModel(ISharedService sharedService,
                                               ISeasonStandingsControlService controlService, IRepository <Conference> conferenceRepository)
            : base(sharedService)
        {
            _controlService       = controlService;
            _conferenceRepository = conferenceRepository;

            _leaguesTreeViewViewModel = null;
        }
        /// <summary>
        /// Initializes a new instance of the LeagueNodeViewModel class.
        /// </summary>
        /// <param name="parentControl"></param>
        /// <param name="controlService"></param>
        /// <param name="league"></param>
        /// <param name="conferenceRepository"></param>
        /// <param name="sharedService"></param>
        /// <param name="lazyLoadChildren"></param>
        public LeagueNodeViewModel(ILeaguesTreeViewViewModel parentControl,
                                   ISeasonStandingsControlService controlService, League league,
                                   IRepository <Conference> conferenceRepository, ISharedService sharedService = null,
                                   bool lazyLoadChildren = true)
            : base(null, controlService, sharedService, lazyLoadChildren)
        {
            _parentControl = parentControl ?? throw new ArgumentNullException("parentControl");
            _league        = league ?? throw new ArgumentNullException("league");

            _conferenceRepository = conferenceRepository;
        }
        /// <summary>
        /// Initializes a new instance of the TreeViewItemViewModel class.
        /// </summary>
        /// <param name="parent"></param>
        /// <param name="controlService"></param>
        /// <param name="sharedService"></param>
        /// <param name="lazyLoadChildren"></param>
        protected TreeViewItemViewModel(ITreeViewItemViewModel parent, ISeasonStandingsControlService controlService,
                                        ISharedService sharedService = null, bool lazyLoadChildren = true)
            : base(sharedService)
        {
            Parent          = parent;
            _controlService = controlService;

            try
            {
                Children = new ObservableCollection <ITreeViewItemViewModel>();
                if (lazyLoadChildren)
                {
                    Children.Add(DummyChild);
                }
            }
            catch (Exception ex)
            {
                _sharedService.ShowExceptionMessage(ex);
            }
        }
Exemple #9
0
        /// <summary>
        /// Initializes a new instance of the LeaguesTreeViewViewModel class
        /// </summary>
        /// <param name="dbContext"></param>
        /// <param name="parentControl"></param>
        /// <param name="leagues"></param>
        /// <param name="WpfGlobals"></param>
        /// <param name="leagueNodes"></param>
        public LeaguesTreeViewViewModel(ISeasonStandingsControlViewModel parentControl,
                                        ISeasonStandingsControlService controlService, IEnumerable <League> leagues,
                                        IRepository <Conference> conferenceRepository, ReadOnlyCollection <ITreeViewItemViewModel> leagueNodes = null)
            : base(null)
        {
            _parentControl  = parentControl ?? throw new ArgumentNullException("parentControl");
            _controlService = controlService ?? throw new ArgumentNullException("service");

            try
            {
                LeagueNodes = leagueNodes ?? new ReadOnlyCollection <ITreeViewItemViewModel>((
                                                                                                 from league in leagues
                                                                                                 select new LeagueNodeViewModel(this, _controlService, league, conferenceRepository))
                                                                                             .ToList <ITreeViewItemViewModel>());
            }
            catch (Exception ex)
            {
                _sharedService.ShowExceptionMessage(ex);
            }
        }
Exemple #10
0
 public void SetUp()
 {
     _sharedService        = A.Fake <ISharedService>();
     _controlService       = A.Fake <ISeasonStandingsControlService>();
     _conferenceRepository = A.Fake <IRepository <Conference> >();
 }