private void CancelFilterByTimeAction()
 {
     if (CurrentTab.IsAllTab())
     {
         // do nothing
     }
     else
     {
         LogEntriesCollectionView.Filter = null;
     }
 }
        private void LoadStartingFromIDAction(object id)
        {
            if (!CurrentTab.IsAllTab())
            {
                return;
            }
            uint startFromID;
            uint i = id is uint?(uint)id : 0;

            if (i == 0)
            {
                string s = id as string;
                if (s == null)
                {
                    return;
                }
                if (!uint.TryParse(s, out startFromID))
                {
                    return;
                }
            }
            else
            {
                startFromID = i;
            }

            var da = CurrentTab.LoadEntries(startFromID);

            // let's select loaded entry
            if (da != null)
            {
                da.Completed += (sender, args) => {
                    foreach (Log9KEntry entry in LogEntriesCollectionView.Cast <Log9KEntry>().Where(entry => entry.ID == startFromID))
                    {
                        SelectedEntry = entry;
                    }
                };
            }
        }
        /// <summary>
        /// Set time filter for collection view
        /// </summary>
        private void FilterByTimeAction(object timeEnd)
        {
            bool a = false;

            if (timeEnd != null)
            {
                a = timeEnd is string;
            }

            if (!a)
            {
                _timeEndSuccess = DateTime.TryParse(FilterTimeEnd, out _endDateTime);
            }
            else
            {
                _timeEndSuccess = DateTime.TryParse((string)timeEnd, out _endDateTime);
            }

            _timeStartSuccess = DateTime.TryParse(FilterTimeStart, out _startDateTime);
            if (!(_timeStartSuccess || _timeEndSuccess))
            {
                LogEntriesCollectionView.Filter = null;
                return;
            }
            if (!_timeEndSuccess)
            {
                _endDateTime = DateTime.MaxValue;
            }
            if (CurrentTab.IsAllTab())
            {
                CurrentTab.FilterByTime(_startDateTime, _endDateTime);
            }
            else
            {
                LogEntriesCollectionView.Filter = Filter;
            }
        }