/// <summary>
        /// Checks if data source has a element after the passed as parameter
        /// </summary>
        /// <param name="current">Current element</param>
        /// <returns>True, if there is a next element, false if there is not</returns>
        public bool HasNext(Entities.specialplacesCollectionSchema current)
        {
            if (current == null || !_data.Any())
            {
                return(false);
            }

            return(_data.IndexOf(current) < _data.Count - 1);
        }
        /// <summary>
        /// Checks if data source has a element before the passed as parameter
        /// </summary>
        /// <param name="current">Current element</param>
        /// <returns>True, if there is a previous element, false if there is not</returns>
        public bool HasPrevious(Entities.specialplacesCollectionSchema current)
        {
            if (current == null || !_data.Any())
            {
                return(false);
            }

            return(_data.IndexOf(current) > 0);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Checks if data source has a element after the passed as parameter
        /// </summary>
        /// <param name="current">Current element</param>
        /// <returns>True, if there is a next element, false if there is not</returns>
        public bool HasNext(Entities.specialplacesCollectionSchema current)
        {
            var data = GetData();

            if (current == null || !data.Any())
            {
                return(false);
            }

            return(data.IndexOf(current) < data.Count - 1);
        }
        /// <summary>
        /// Retrieves the next element from source.
        /// </summary>
        /// <param name="current">Current element</param>
        /// <returns>The next element from items, if it exists. Otherwise, returns null</returns>
        public Entities.specialplacesCollectionSchema Next(Entities.specialplacesCollectionSchema current)
        {
            if (current == null || !_data.Any())
            {
                return(null);
            }

            if (_data.Last().Equals(current))
            {
                return(null);
            }

            return(_data[_data.IndexOf(current) + 1]);
        }
        /// <summary>
        /// Retrieves the previous element from source.
        /// </summary>
        /// <param name="current">Current element</param>
        /// <returns>The previous element from items, if it exists. Otherwise, returns null</returns>
        public Entities.specialplacesCollectionSchema Previous(Entities.specialplacesCollectionSchema current)
        {
            if (current == null || !_data.Any())
            {
                return(null);
            }

            if (_data.First().Equals(current))
            {
                return(null);
            }

            return(_data[_data.IndexOf(current) - 1]);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Retrieves the next element from source.
        /// </summary>
        /// <param name="current">Current element</param>
        /// <returns>The next element from items, if it exists. Otherwise, returns null</returns>
        public Entities.specialplacesCollectionSchema Next(Entities.specialplacesCollectionSchema current)
        {
            var data = GetData();

            if (current == null)
            {
                return(data.FirstOrDefault());
            }

            if (data.Any() && data.Last().Equals(current))
            {
                return(null);
            }

            return(data[data.IndexOf(current) + 1]);
        }