Exemple #1
0
        private void GetAllTimeSliceGroups(PlaylistInfo playlistInfo)
        {
            if (playlistInfo.Items == null || playlistInfo.Items.Length == 0)
            {
                return;
            }
            foreach (LibraryAdapter adapter in playlistInfo.Items)
            {
                if (adapter.Target != null)
                {
                    switch (adapter.Target.Type)
                    {
                    case LibraryType.TimeSliceGroup:
                        TimeSliceGroupInfo group = adapter.Target as TimeSliceGroupInfo;
                        if (!string.IsNullOrEmpty(group.CurrentMessageAdapterID) && group.Items.Length > 0 && group.GetMessageInfo(group.CurrentMessageAdapterID) != null)
                        {
                            _alltimeSliceGroups.Add(adapter.Target as TimeSliceGroupInfo);
                        }
                        break;

                    case LibraryType.Playlist:
                        PlaylistInfo playlist = adapter.Target as PlaylistInfo;
                        if (playlist.Items != null && playlist.Items.Length > 0)
                        {
                            GetAllTimeSliceGroups(playlist);
                        }
                        break;
                    }
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// Function:Get all TimeSliceGroups in this playlist
        /// Author:Jerry Xu
        /// Date:2008-11-27
        /// </summary>
        private void GetAllTimeSliceGroupAdapters()
        {
            _timeSliceGroupAdapters = new List <TimeSliceGroupAdapterInfo>();
            TimeSliceGroupInfo group = null;

            foreach (LibraryAdapter adapter in _items)
            {
                switch (adapter.Target.Type)
                {
                case LibraryType.TimeSliceGroup:
                    if (adapter.Target != null)
                    {
                        group = adapter.Target as TimeSliceGroupInfo;
                        if (!string.IsNullOrEmpty(group.CurrentMessageAdapterID) && group.Items.Length > 0 && group.GetMessageInfo(group.CurrentMessageAdapterID) != null)
                        {
                            _timeSliceGroupAdapters.Add(adapter as TimeSliceGroupAdapterInfo);
                        }
                    }
                    break;

                case LibraryType.Playlist:
                    PlaylistInfo playlist = adapter.Target as PlaylistInfo;
                    if (playlist.Items != null && playlist.Items.Length > 0)
                    {
                        GetTimeSliceGroups(playlist);
                    }
                    break;
                }
            }
        }
Exemple #3
0
 private void GetPlaylists(PlaylistInfo playlistInfo, bool isAll)
 {
     if (playlistInfo.Items == null || playlistInfo.Items.Length == 0)
     {
         return;
     }
     foreach (LibraryAdapter adapter in playlistInfo.Items)
     {
         if (adapter.Target != null && adapter.Target.Type == LibraryType.Playlist)
         {
             PlaylistInfo playlist = adapter.Target as PlaylistInfo;
             if (playlist.Items != null && playlist.Items.Length > 0)
             {
                 if (isAll)
                 {
                     _allPlaylists.Add(playlist);
                 }
                 else
                 {
                     if (!IsExistPlaylist(_allPlaylists, playlist))
                     {
                         _playlists.Add(playlist);
                     }
                 }
                 GetPlaylists(playlist, isAll);
             }
         }
     }
 }
Exemple #4
0
 /// <summary>
 /// Function:Get all Playlists in this playlist
 /// Author:Jerry Xu
 /// Date:2008-12-05
 /// </summary>
 private void GetAllPlaylists(bool isAll)
 {
     _allPlaylists = new List <PlaylistInfo>();
     foreach (LibraryAdapter adapter in _items)
     {
         if (adapter.Target != null && adapter.Target.Type == LibraryType.Playlist)
         {
             PlaylistInfo playlist = adapter.Target as PlaylistInfo;
             if (playlist.Items != null && playlist.Items.Length > 0)
             {
                 if (isAll)
                 {
                     _allPlaylists.Add(playlist);
                 }
                 else
                 {
                     if (!IsExistPlaylist(_allPlaylists, playlist))
                     {
                         _playlists.Add(playlist);
                     }
                 }
                 GetPlaylists(playlist, isAll);
             }
         }
     }
 }
Exemple #5
0
 private bool IsExistPlaylist(List <PlaylistInfo> items, PlaylistInfo playlist)
 {
     if (items == null || items.Count == 0)
     {
         return(false);
     }
     foreach (PlaylistInfo item in items)
     {
         if (item.Id == playlist.Id)
         {
             return(true);
         }
     }
     return(false);
 }
Exemple #6
0
 /// <summary>
 /// Function:Get all Playlists in this playlist
 /// Author:Jerry Xu
 /// Date:2008-12-05
 /// </summary>
 private void GetAllPlaylists()
 {
     _allplaylists = new List <PlaylistInfo>();
     foreach (LibraryAdapter adapter in _items)
     {
         if (adapter.Target != null && adapter.Target.Type == LibraryType.Playlist)
         {
             PlaylistInfo playlist = adapter.Target as PlaylistInfo;
             _allplaylists.Add(playlist);
             if (playlist.Items != null && playlist.Items.Length > 0)
             {
                 GetPlaylists(playlist);
             }
         }
     }
 }
Exemple #7
0
        private void InternalFromTo(PlaylistInfo playlist)
        {
            //TODO:

            if (playlist._items == null || playlist._items.Count < 1)
            {
                return;
            }
            _items.Clear();
            _inPlaylistCounter = playlist._inPlaylistCounter;
            _nailImageID       = playlist._nailImageID;
            foreach (LibraryAdapter item in playlist._items)
            {
                _items.AddLast(item.Copy());
            }
            //_image = playlist.Image;
            //_imagePath = playlist._imagePath;
        }
Exemple #8
0
 private void GetPlaylists(PlaylistInfo playlistInfo)
 {
     if (playlistInfo.Items == null || playlistInfo.Items.Length == 0)
     {
         return;
     }
     foreach (LibraryAdapter adapter in playlistInfo.Items)
     {
         if (adapter.Target != null && adapter.Target.Type == LibraryType.Playlist)
         {
             PlaylistInfo playlist = adapter.Target as PlaylistInfo;
             _allplaylists.Add(playlist);
             if (playlist.Items != null && playlist.Items.Length > 0)
             {
                 GetPlaylists(playlist);
             }
         }
     }
 }
Exemple #9
0
        private void GetTimeSliceGroups(PlaylistInfo playlistInfo, bool isAll)
        {
            if (playlistInfo.Items == null || playlistInfo.Items.Length == 0)
            {
                return;
            }
            foreach (LibraryAdapter adapter in playlistInfo.Items)
            {
                if (adapter.Target != null)
                {
                    switch (adapter.Target.Type)
                    {
                    case LibraryType.TimeSliceGroup:
                        TimeSliceGroupInfo group = adapter.Target as TimeSliceGroupInfo;
                        //if (!string.IsNullOrEmpty(group.ImageMessageAdapterName) && group.Items.Length > 0 && group.GetMessageInfo(group.ImageMessageAdapterName) != null)
                        if (group.Items != null && group.Items.Length > 0)
                        {
                            if (isAll)
                            {
                                _allTimeSliceGroups.Add(group);
                            }
                            else
                            {
                                if (!IsExistTimeSliceGroup(_timeSliceGroups, group))
                                {
                                    _timeSliceGroups.Add(group);
                                }
                            }
                        }
                        break;

                    case LibraryType.Playlist:
                        PlaylistInfo playlist = adapter.Target as PlaylistInfo;
                        if (playlist.Items != null && playlist.Items.Length > 0)
                        {
                            GetTimeSliceGroups(playlist, isAll);
                        }
                        break;
                    }
                }
            }
        }
Exemple #10
0
        /// <summary>
        /// Function:Get all TimeSliceGroups in this playlist
        /// Author:Jerry Xu
        /// Date:2008-11-27
        /// </summary>
        private void GetAllTimeSliceGroups(bool isAll)
        {
            _allTimeSliceGroups = new List <TimeSliceGroupInfo>();
            TimeSliceGroupInfo group = null;

            foreach (AppointmentInfo appoint in _items)
            {
                if (appoint.Target != null)
                {
                    switch (appoint.Target.Type)
                    {
                    case LibraryType.TimeSliceGroup:
                        group = appoint.Target as TimeSliceGroupInfo;
                        //if (!string.IsNullOrEmpty(group.ImageMessageAdapterName) && group.Items.Length > 0 && group.GetMessageInfo(group.ImageMessageAdapterName) != null)
                        if (group.Items != null && group.Items.Length > 0)
                        {
                            if (isAll)
                            {
                                _allTimeSliceGroups.Add(group);
                            }
                            else
                            {
                                if (!IsExistTimeSliceGroup(_timeSliceGroups, group))
                                {
                                    _timeSliceGroups.Add(group);
                                }
                            }
                        }
                        break;

                    case LibraryType.Playlist:
                        PlaylistInfo playlist = appoint.Target as PlaylistInfo;
                        if (playlist.Items != null && playlist.Items.Length > 0)
                        {
                            GetTimeSliceGroups(playlist, isAll);
                        }
                        break;
                    }
                }
            }
        }
Exemple #11
0
        /// <summary>
        /// Function:Get all Messages in this playlist
        /// Author:Jerry Xu
        /// Date:2008-11-27
        /// </summary>
        private void GetAllMessages()
        {
            _allmessages = new List <MessageInfo>();
            foreach (LibraryAdapter adapter in _items)
            {
                if (adapter.Target != null)
                {
                    switch (adapter.Target.Type)
                    {
                    case LibraryType.Message:
                        if (adapter.Target.Length > 0)
                        {
                            _allmessages.Add(adapter.Target as MessageInfo);
                        }
                        break;

                    case LibraryType.TimeSliceGroup:
                        TimeSliceGroupInfo group = adapter.Target as TimeSliceGroupInfo;

                        //if (!string.IsNullOrEmpty(group.CurrentMessageAdapterID) && group.Items.Length > 0 && group.GetMessageInfo(group.CurrentMessageAdapterID) != null)
                        if (group.Items != null && group.Items.Length > 0)
                        {
                            foreach (MessageAdapterInfo item in group.Items)
                            {
                                _allmessages.Add(LibraryGroup.Current.Messages.GetById(item.TargetId));
                            }
                        }
                        break;

                    case LibraryType.Playlist:
                        PlaylistInfo playlist = adapter.Target as PlaylistInfo;
                        if (playlist.Items != null && playlist.Items.Length > 0)
                        {
                            GetMessages(playlist);
                        }
                        break;
                    }
                }
            }
        }
 public PlaylistAdapterInfo(PlaylistInfo playlist) : base(playlist)
 {
 }
Exemple #13
0
        private void GetMessages(PlaylistInfo playlistInfo, bool isAll)
        {
            if (playlistInfo.Items == null || playlistInfo.Items.Length == 0)
            {
                return;
            }
            foreach (LibraryAdapter adapter in playlistInfo.Items)
            {
                if (adapter.Target != null)
                {
                    switch (adapter.Target.Type)
                    {
                    case LibraryType.Message:
                        //if (adapter.Target.Length > 0)
                        //{
                        if (isAll)
                        {
                            _allMessages.Add(adapter.Target as MessageInfo);
                        }
                        else
                        {
                            if (!IsExistMessage(_messages, adapter.Target as MessageInfo))
                            {
                                _messages.Add(adapter.Target as MessageInfo);
                            }
                        }
                        //}
                        break;

                    case LibraryType.TimeSliceGroup:
                        TimeSliceGroupInfo group = adapter.Target as TimeSliceGroupInfo;
                        if (!string.IsNullOrEmpty(group.CurrentMessageAdapterID) && group.Items.Length > 0 && group.GetMessageInfo(group.CurrentMessageAdapterID) != null)
                        {
                            foreach (MessageAdapterInfo item in group.Items)
                            {
                                //if (item.Target != null && item.IsActive && item.Target.Length > 0)
                                if (item.Target != null && item.IsActive)
                                {
                                    if (isAll)
                                    {
                                        _allMessages.Add(adapter.Target as MessageInfo);
                                    }
                                    else
                                    {
                                        if (!IsExistMessage(_messages, item.Target as MessageInfo))
                                        {
                                            _messages.Add(item.Target as MessageInfo);
                                        }
                                    }
                                }
                            }
                        }
                        break;

                    case LibraryType.Playlist:
                        PlaylistInfo playlist = adapter.Target as PlaylistInfo;
                        if (playlist.Items != null && playlist.Items.Length > 0)
                        {
                            GetMessages(playlist, isAll);
                        }
                        break;
                    }
                }
            }
        }