Ejemplo n.º 1
0
        /// <summary>
        /// Sorts the scalars.
        /// </summary>
        private void SortScalars()
        {
            IList <IDataListItemModel> newScalarCollection = ScalarCollection.OrderBy(c => c.DisplayName).Where(c => !c.IsBlank).ToList();

            ScalarCollection.Clear();
            foreach (IDataListItemModel item in newScalarCollection)
            {
                ScalarCollection.Add(item);
            }
            ScalarCollection.Add(DataListItemModelFactory.CreateDataListModel(string.Empty));
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     Sorts the scalars.
        /// </summary>
        private void SortScalars(bool ascending)
        {
            IList <IDataListItemModel> newScalarCollection;

            if (ascending)
            {
                newScalarCollection = ScalarCollection.OrderBy(c => c.DisplayName)
                                      .Where(c => !c.IsBlank).ToList();
            }
            else
            {
                newScalarCollection = ScalarCollection.OrderByDescending(c => c.DisplayName)
                                      .Where(c => !c.IsBlank).ToList();
            }
            ScalarCollection.Clear();
            foreach (var item in newScalarCollection)
            {
                ScalarCollection.Add(item);
            }
            ScalarCollection.Add(DataListItemModelFactory.CreateDataListModel(string.Empty));
        }