예제 #1
0
        ///////////////////////////////////////////////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Gets sorted collection.
        /// </summary>
        /// <returns>Sorted barrier collection (sorted by creation time).</returns>
        private AppData.SortedDataObjectCollection <Barrier> _GetSortedCollection()
        {
            AppData.IDataObjectCollection <Barrier> collection =
                App.Current.Project.Barriers.SearchAll(true);

            var sortedCollection =
                new AppData.SortedDataObjectCollection <Barrier>(collection,
                                                                 new CreationTimeComparer <Barrier>());

            return(sortedCollection);
        }
        /// <summary>
        /// Inits collection of route.
        /// </summary>
        private void _InitDataGridCollection()
        {
            var routes = DataKeeper.Routes;

            // init source collection
            var sortedRoutesCollection = new AppData.SortedDataObjectCollection <Route>(routes, new RoutesComparer());

            DataGridCollectionViewSource collectionSource =
                (DataGridCollectionViewSource)layoutRoot.FindResource(COLLECTION_SOURCE_KEY);

            collectionSource.Source = sortedRoutesCollection;
        }
        ///////////////////////////////////////////////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// Gets sorted collection.
        /// </summary>
        /// <returns>Sorted barrier collection (sorted by creation time).</returns>
        private AppData.SortedDataObjectCollection<Barrier> _GetSortedCollection()
        {
            AppData.IDataObjectCollection<Barrier> collection =
                App.Current.Project.Barriers.SearchAll(true);

            var sortedCollection =
                new AppData.SortedDataObjectCollection<Barrier>(collection,
                                                                new CreationTimeComparer<Barrier>());

            return sortedCollection;
        }