Exemplo n.º 1
0
 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);
        }
Exemplo n.º 3
0
 public ThemeAttributeImpl(IOptionsCache optionsCache, IContentManagerService cms, IPageCache pageCache, IModelMetadataProvider _modelMetadataProvider)
 {
     this.optionsCache           = optionsCache;
     this.cms                    = cms;
     this.pageCache              = pageCache;
     this._modelMetadataProvider = _modelMetadataProvider;
 }
Exemplo n.º 4
0
 public EditorController(IContentManagerService contentManagerService, IContentCategoryRepository contentCategoryRepository, IRegisteredUserRepository registeredUserRepository, IFashionFlavorRepository fashionFlavorRepository)
 {
     this.contentManagerService     = contentManagerService;
     this.registeredUserRepository  = registeredUserRepository;
     this.fashionFlavorRepository   = fashionFlavorRepository;
     this.contentCategoryRepository = contentCategoryRepository;
 }
Exemplo n.º 5
0
 public ContentController(IContentManagerService cms, IMetasManagerService mms, IFilesManagerService fms, IHostingEnvironment hostingEnvironment)
 {
     this.cms = cms;
     this.mms = mms;
     this.fms = fms;
     this.hostingEnvironment = hostingEnvironment;
 }
Exemplo n.º 6
0
        public void CanSendToEditor()
        {
            IContentManagerService cs = CreateContentManagerService();

            Content c = cs.SendToReview(1, 2);

            Assert.IsTrue(c.AssignedTo == 2);
        }
Exemplo n.º 7
0
        public TrackViewModel(IContentManagerService contentManagerService, IMusicPlayerService musicPlayerService, IWebService webService, PlaylistTrack playlistTrack)
        {
            _contentManagerService = contentManagerService;
            _musicPlayerService    = musicPlayerService;
            _webService            = webService;

            PlaylistTrack = playlistTrack;
        }
Exemplo n.º 8
0
        public void CanApproveContent()
        {
            IContentManagerService cs = CreateContentManagerService();

            Content c = cs.Approve(1);

            Assert.IsTrue(c.Status == ContentStatus.Published);
        }
Exemplo n.º 9
0
 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;
 }
Exemplo n.º 10
0
        public void CanDisableContent()
        {
            IContentManagerService cs = CreateContentManagerService();

            cs.Approve(1);
            Content c = cs.Disable(1);

            Assert.IsTrue(c.LastContentPublished.Status == ContentPublishedStatus.Disabled);
        }
Exemplo n.º 11
0
 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;
 }
Exemplo n.º 12
0
        public void CanNotScheduleContent()
        {
            IContentManagerService cs = CreateContentManagerService();

            DateTime from = DateTime.Today;
            DateTime to   = DateTime.Today.AddDays(-30);

            Content c = cs.ScheduleContent(1, from, to);
        }
Exemplo n.º 13
0
        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)));
 }
Exemplo n.º 17
0
        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);
        }
Exemplo n.º 18
0
        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);
        }
Exemplo n.º 19
0
        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();
                }
            };
        }
Exemplo n.º 20
0
 public void CanNotDisableContent()
 {
     IContentManagerService cs = CreateContentManagerService();
     Content c = cs.Disable(1);
 }
Exemplo n.º 21
0
 public void CanNotApproveContent()
 {
     IContentManagerService cs = CreateContentManagerService();
     Content c = cs.Approve(3);
 }
Exemplo n.º 22
0
 public GridController(IContentManagerService contentManagerService, IContentCategoryRepository contentCategoryRepository)
 {
     this.contentManagerService     = contentManagerService;
     this.contentCategoryRepository = contentCategoryRepository;
 }
Exemplo n.º 23
0
        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
                )
            );
        }
Exemplo n.º 24
0
 public PageCache(ICache cache, IContentManagerService cms)
 {
     this.cache = cache;
     this.cms   = cms;
 }
Exemplo n.º 25
0
 public FilesController(IFilesManagerService fms, IContentManagerService cms, ContentExtension ce)
 {
     this.fms = fms;
     this.cms = cms;
     this.ce  = ce;
 }
Exemplo n.º 26
0
 public ContentExtension(IContentManagerService cms)
 {
     this.cms = cms;
 }
Exemplo n.º 27
0
 public ArchivesController(IContentManagerService cms)
 {
     this.cms = cms;
 }