public DefaultController(IContentManagerService cms, IOptionsCache optionsCache, IMetasManagerService mms, ICache cache) { this.cms = cms; this.optionsCache = optionsCache; this.mms = mms; this.cache = cache; }
public EditPlaylistViewModel(IViewModelFactory viewModelFactory, IContentManagerService contentManagerService, IPlaylistViewModel playlistViewModel) { PlaylistViewModel = playlistViewModel; DisplayName = playlistViewModel.Playlist.Name; HashSet <Track> playlistTracks = new HashSet <Track>(playlistViewModel.Playlist.Tracks.Select(playlistTrack => playlistTrack.Track)); TrackSource = viewModelFactory.MakeViewModel <ITrackSinkViewModel>(contentManagerService.RetrieveTracks() .Where(track => !playlistTracks.Contains(track)) .Select(track => viewModelFactory.MakeViewModel <ITrackViewModel>(new PlaylistTrack(0, track))), "Plus"); PlaylistTarget = viewModelFactory.MakeViewModel <ITrackSinkViewModel>(playlistViewModel.Tracks, "Minus"); EventHandler <TracksReleasedEventArgs> MakeAddTracksEventHandler(ITrackSinkViewModel target) { return((sender, e) => { target.AddTracks(e.Tracks); ModifiedTrackCountChanged(); }); } TrackSource.TracksReleased += MakeAddTracksEventHandler(PlaylistTarget); PlaylistTarget.TracksReleased += MakeAddTracksEventHandler(TrackSource); }
public ThemeAttributeImpl(IOptionsCache optionsCache, IContentManagerService cms, IPageCache pageCache, IModelMetadataProvider _modelMetadataProvider) { this.optionsCache = optionsCache; this.cms = cms; this.pageCache = pageCache; this._modelMetadataProvider = _modelMetadataProvider; }
public EditorController(IContentManagerService contentManagerService, IContentCategoryRepository contentCategoryRepository, IRegisteredUserRepository registeredUserRepository, IFashionFlavorRepository fashionFlavorRepository) { this.contentManagerService = contentManagerService; this.registeredUserRepository = registeredUserRepository; this.fashionFlavorRepository = fashionFlavorRepository; this.contentCategoryRepository = contentCategoryRepository; }
public ContentController(IContentManagerService cms, IMetasManagerService mms, IFilesManagerService fms, IHostingEnvironment hostingEnvironment) { this.cms = cms; this.mms = mms; this.fms = fms; this.hostingEnvironment = hostingEnvironment; }
public void CanSendToEditor() { IContentManagerService cs = CreateContentManagerService(); Content c = cs.SendToReview(1, 2); Assert.IsTrue(c.AssignedTo == 2); }
public TrackViewModel(IContentManagerService contentManagerService, IMusicPlayerService musicPlayerService, IWebService webService, PlaylistTrack playlistTrack) { _contentManagerService = contentManagerService; _musicPlayerService = musicPlayerService; _webService = webService; PlaylistTrack = playlistTrack; }
public void CanApproveContent() { IContentManagerService cs = CreateContentManagerService(); Content c = cs.Approve(1); Assert.IsTrue(c.Status == ContentStatus.Published); }
public DefaultController(IUsersManagerService ums, IPageCache pageCache, IOptionsCache optionsCache, IContentManagerService cms, ICommentManagerService coms) { this.ums = ums; this.pageCache = pageCache; this.optionsCache = optionsCache; this.cms = cms; this.coms = coms; }
public void CanDisableContent() { IContentManagerService cs = CreateContentManagerService(); cs.Approve(1); Content c = cs.Disable(1); Assert.IsTrue(c.LastContentPublished.Status == ContentPublishedStatus.Disabled); }
public ContentController(IContentManagerService cms, ICommentManagerService coms, IPageCache pageCache, IOptionsCache optionsCache , IActionCooldownService _actioncd) { this.cms = cms; this.coms = coms; this.pageCache = pageCache; this.optionsCache = optionsCache; this._actioncd = _actioncd; }
public void CanNotScheduleContent() { IContentManagerService cs = CreateContentManagerService(); DateTime from = DateTime.Today; DateTime to = DateTime.Today.AddDays(-30); Content c = cs.ScheduleContent(1, from, to); }
public void CanScheduleContent() { IContentManagerService cs = CreateContentManagerService(); DateTime from = DateTime.Today; DateTime to = DateTime.Today.AddDays(30); Content c = cs.ScheduleContent(1, from, to); Assert.IsTrue(DateTime.Today >= c.ScheduleFrom & DateTime.Today <= c.ScheduleTo); }
public PlaylistEditorViewModel(IEventAggregator eventAggregator, IViewModelFactory viewModelFactory, IContentManagerService contentManagerService, IDialogService dialogService, IPlaylistCollectionViewModel playlistCollectionViewModel) { _eventAggregator = eventAggregator; _viewModelFactory = viewModelFactory; _contentManagerService = contentManagerService; _dialogService = dialogService; Items.AddRange(playlistCollectionViewModel.Playlists .OfType <ICustomPlaylistViewModel>() .Select(playlist => viewModelFactory.MakeViewModel <IEditPlaylistViewModel>(playlist))); }
public ManagedPlaylistViewModel ( IViewModelFactory viewModelFactory, IEventAggregator eventAggregator, IContentManagerService contentManagerService, IMusicPlayerService musicPlayerService, Playlist playlist ) : base(viewModelFactory, eventAggregator, contentManagerService, musicPlayerService, playlist) { _viewModelFactory = viewModelFactory; }
public CustomPlaylistViewModel ( IViewModelFactory viewModelFactory, IEventAggregator eventAggregator, IContentManagerService contentManagerService, IMusicPlayerService musicPlayerService, Playlist playlist ) : base(viewModelFactory, eventAggregator, contentManagerService, musicPlayerService, playlist) { Items.AddRange(playlist.Tracks.Select(track => viewModelFactory.MakeViewModel <ITrackViewModel>(track))); }
public void CanCreateContent() { IContentManagerService cs = CreateContentManagerService(); string title = "Title Separated Let's try"; Content c = cs.Create(title, "Test content body", "key words test", "Promotional Text", new ContentCategory(1), 1, CreateContentFashionFlavors(), CreateSections()); Assert.IsTrue(c.Title == title); Assert.IsTrue(c.UserFriendlyTitle == "/Content/Blog/title-separated-let-s-try/0/default.aspx", c.UserFriendlyTitle); Assert.IsTrue(c.Status == ContentStatus.Draft); Assert.IsTrue(c.Flavors.Count == 4); Assert.IsTrue(c.Sections.Count == 4); }
public void CanEditContent() { IContentManagerService cs = CreateContentManagerService(); string title = "Title edited"; string body = "body edited"; Content c = cs.Edit(1, title, body, "key words test", "Promotional Text", new ContentCategory(1), ContentType.Blog, CreateContentFashionFlavors(), CreateSections()); Assert.IsTrue(c.Title == title); Assert.IsTrue(c.UserFriendlyTitle == "/Content/Blog/title-edited/1/default.aspx"); Assert.IsTrue(c.Status == ContentStatus.Draft); Assert.IsTrue(c.Flavors.Count == 4); Assert.IsTrue(c.Sections.Count == 4); }
private protected PlaylistViewModel(IViewModelFactory viewModelFactory, IEventAggregator eventAggregator, IContentManagerService contentManagerService, IMusicPlayerService musicPlayerService, Playlist playlist) { _viewModelFactory = viewModelFactory; _contentManagerService = contentManagerService; _musicPlayerService = musicPlayerService; _tracksView = CollectionViewSource.GetDefaultView(Items); DisplayName = playlist.Name; Playlist = playlist; SelectedIndex = Playlist.SelectedTrackIndex; _tracksView.SortDescriptions.Add(new SortDescription(nameof(ITrackViewModel.PlaylistTrack), ListSortDirection.Ascending)); eventAggregator.Subscribe(this); Playlist.PropertyChanged += (sender, e) => { if (e.PropertyName == nameof(Playlist.IsShuffled)) { _tracksView.Refresh(); } }; }
public void CanNotDisableContent() { IContentManagerService cs = CreateContentManagerService(); Content c = cs.Disable(1); }
public void CanNotApproveContent() { IContentManagerService cs = CreateContentManagerService(); Content c = cs.Approve(3); }
public GridController(IContentManagerService contentManagerService, IContentCategoryRepository contentCategoryRepository) { this.contentManagerService = contentManagerService; this.contentCategoryRepository = contentCategoryRepository; }
public PlaylistCollectionViewModel(IViewModelFactory viewModelFactory, IEventAggregator eventAggregator, IContentManagerService contentManagerService, IDataService dataService, ILayoutService layoutService) { _eventAggregator = eventAggregator; _dataService = dataService; AppLayout = layoutService.AppLayout; eventAggregator.Subscribe(this); Items.AddRange(contentManagerService.RetrieveManagedPlaylists() .Values .Select(managedPlaylist => viewModelFactory.MakeViewModel <IManagedPlaylistViewModel>(managedPlaylist))); Items.AddRange(contentManagerService.RetrievePlaylists() .Select(playlist => viewModelFactory.MakeViewModel <ICustomPlaylistViewModel>(playlist))); int activePlaylist = dataService.Load <int>(Constants.DataStoreNames.ActivePlaylist); ActivateItem(Items[activePlaylist]); CollectionViewSource.GetDefaultView(Items) .SortDescriptions .Add ( new SortDescription ( string.Join(".", nameof(IPlaylistViewModel.Playlist), nameof(IPlaylistViewModel.Playlist.Name)), ListSortDirection.Ascending ) ); }
public PageCache(ICache cache, IContentManagerService cms) { this.cache = cache; this.cms = cms; }
public FilesController(IFilesManagerService fms, IContentManagerService cms, ContentExtension ce) { this.fms = fms; this.cms = cms; this.ce = ce; }
public ContentExtension(IContentManagerService cms) { this.cms = cms; }
public ArchivesController(IContentManagerService cms) { this.cms = cms; }