/// <summary> /// This method is called by clicking the ok button and add valid input value to InputValueList. /// Listbox which is screen fills from input Value List /// </summary> public void EnterCommandExecute() { if (FilteredNumber != null) { InputValueList.Add(FilteredNumber.Value); } FilteredNumber = null; }
/// <summary> /// the input values were summed. /// </summary> private void FilterBySumInput() { var sumData = InputValueList.ToList() .Distinct() .Sum(); _outputValueList = Convert.ToString(sumData); NotifyPropertyChanged("OutputValueList"); }
/// <summary> /// Sorted input values in listbox by decreasing order.Duplicate values were skipped by distinct method /// </summary> private void FilterByDecreaseOrder() { var filteredData = InputValueList.ToList() .Distinct() .OrderByDescending(x => x); _outputValueList = string.Join(",", filteredData); NotifyPropertyChanged("OutputValueList"); }
/// <summary> /// Filtered even input values Where(x => x % 2 == 0) /// </summary> private void FilterByEvenInput() { var evenData = InputValueList.ToList() .Distinct() .Where(x => x % 2 == 0) .OrderBy(t => t); _outputValueList = string.Join(",", evenData); NotifyPropertyChanged("OutputValueList"); }