示例#1
0
        private void SelectContentBasedOnItem(string itemSelected, ManipulationStates state)
        {
            bool hasContent = _contentManagement.LoadItemContents(itemSelected, state);

            if (hasContent)
            {
                if (!IsVideoPlaying)
                {
                    MediaSource = _contentManagement.MoveNext().ContentPath;
                }
            }
            else
            {
                ConfigurationProvider cp = new ConfigurationProvider();
                IConfigSettings       cs = cp.Load();
                ErrorMessage = String.Format(@"Media Content is missing in the following directory: {0}\{1}, for interaction {2}", cs.RootContentDirectory, itemSelected, state.ToString());
            }
        }
示例#2
0
        private void SelectContentBasedOnItem(string itemSelected, ManipulationStates state)
        {
            bool hasContent = _contentManagement.LoadItemContents(itemSelected, state);

            if (hasContent)
            {
                if (!IsVideoPlaying)
                    MediaSource = _contentManagement.MoveNext().ContentPath;
            }
            else
            {
                ConfigurationProvider cp = new ConfigurationProvider();
                IConfigSettings cs = cp.Load();
                ErrorMessage = String.Format(@"Media Content is missing in the following directory: {0}\{1}, for interaction {2}", cs.RootContentDirectory, itemSelected, state.ToString());
            }
        }
        public bool LoadItemContents(string item, ManipulationStates itemState)
        {
            _filteredContentList = null;
            _filteredContentList = _allItemContentList.Where(x => x.ContentFolder.ToLower() == item.ToLower() && x.ItemState.ToLower() == itemState.ToString().ToLower());

            // if _filteredContentList is null, return default content
            if (_filteredContentList == null || _filteredContentList.Count() == 0)
            {
                _filteredContentList = _defaultItemContentList.Where(x => x.ContentFolder.ToLower() == item.ToLower());
            }

            if (_filteredContentList != null && _filteredContentList.Count() > 0)
            {
                return(true);        // has content
            }
            else
            {
                return(false);
            }
        }