Beispiel #1
0
        /// <summary>
        /// Populates the properties of <see cref="BaseViewModel" /> which can be inherited from parent nodes
        /// </summary>
        /// <param name="model">The model.</param>
        /// <param name="latestService">The latest service.</param>
        /// <param name="socialMediaService">The social media service.</param>
        /// <param name="eastSussex1SpaceService">The east sussex1 space service.</param>
        /// <param name="webChatSettingsService">The web chat settings service.</param>
        /// <param name="escisService">The ESCIS service.</param>
        /// <exception cref="System.ArgumentNullException">model</exception>
        public void PopulateBaseViewModelWithInheritedContent(BaseViewModel model, ILatestService latestService, ISocialMediaService socialMediaService, IEastSussex1SpaceService eastSussex1SpaceService, IWebChatSettingsService webChatSettingsService, IEscisService escisService)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }

            if (latestService != null)
            {
                model.Latest = latestService.ReadLatestSettings().LatestHtml;
            }
            if (eastSussex1SpaceService != null)
            {
                model.ShowEastSussex1SpaceWidget = eastSussex1SpaceService.ShowSearch();
            }
            if (escisService != null)
            {
                model.ShowEscisWidget = escisService.ShowSearch();
            }
            if (socialMediaService != null)
            {
                model.SocialMedia = socialMediaService.ReadSocialMediaSettings();
            }
            if (webChatSettingsService != null)
            {
                model.WebChat = webChatSettingsService.ReadWebChatSettings();
            }
        }
Beispiel #2
0
        /// <summary>
        /// Populates the properties of <see cref="BaseViewModel" /> which can be inherited from parent nodes
        /// </summary>
        /// <param name="model">The model.</param>
        /// <param name="latestService">The latest service.</param>
        /// <param name="socialMediaService">The social media service.</param>
        /// <param name="eastSussex1SpaceService">The east sussex1 space service.</param>
        /// <param name="escisService">The ESCIS service.</param>
        /// <exception cref="System.ArgumentNullException">model</exception>
        public void PopulateBaseViewModelWithInheritedContent(Models.BaseViewModel model, latest.ILatestService latestService, ISocialMediaService socialMediaService, IEastSussex1SpaceService eastSussex1SpaceService, IEscisService escisService, IRatingSettingsProvider ratingSettings = null)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }

            if (latestService != null)
            {
                model.Latest = latestService.ReadLatestSettings().LatestHtml;
            }
            if (eastSussex1SpaceService != null)
            {
                model.ShowEastSussex1SpaceWidget = eastSussex1SpaceService.ShowSearch();
            }
            if (escisService != null)
            {
                model.ShowEscisWidget = escisService.ShowSearch();
            }
            if (socialMediaService != null)
            {
                model.SocialMedia = socialMediaService.ReadSocialMediaSettings();
            }
            if (ratingSettings != null)
            {
                model.RatingSettings = ratingSettings.ReadRatingSettings();
            }
        }