コード例 #1
0
        public TrainsScheduleDGridController(TrainsScheduleDGrid view,
            TrainInfoCollection collection)
        {
            if (view == null)
                throw new ArgumentNullException("view");
            if (collection == null)
                throw new ArgumentNullException("collection");

            this.view = view;
            cView = new PagedCollectionView(collection) {PageSize = 10};
        }
コード例 #2
0
ファイル: App.xaml.cs プロジェクト: ArtemyB/TrainsSchedule
 private void App_OnStartup(object sender, StartupEventArgs e)
 {
     try
     {
         TrainInfoCollection = new TrainInfoCollection();
         //{
         //    new TrainInfo("2345", "Минск", "Вильнюс",
         //        new DateTime(2015, 8, 31, 7, 40, 0),
         //        new DateTime(2015, 8, 31, 11, 0, 0)),
         //    new TrainInfo("6743", "Минск", "Берлин",
         //        new DateTime(2015, 8, 31, 9, 30, 0),
         //        new DateTime(2015, 8, 31, 23, 0, 0)),
         //    new TrainInfo("9074", "Минск", "Вильнюс",
         //        new DateTime(2015, 8, 31, 7, 40, 0),
         //        new DateTime(2015, 8, 31, 11, 0, 0)),
         //    new TrainInfo("5831", "Прага", "Варшава",
         //        new DateTime(2015, 9, 1, 8, 40, 0),
         //        new DateTime(2015, 9, 1, 12, 0, 0)),
         //    new TrainInfo("5831", "Прага", "Варшава",
         //        new DateTime(2015, 9, 1, 8, 40, 0),
         //        new DateTime(2015, 9, 1, 12, 0, 0)),
         //    new TrainInfo("5831", "Прага", "Варшава",
         //        new DateTime(2015, 9, 1, 8, 40, 0),
         //        new DateTime(2015, 9, 1, 12, 0, 0)),
         //    new TrainInfo("5831", "Прага", "Варшава",
         //        new DateTime(2015, 9, 1, 8, 40, 0),
         //        new DateTime(2015, 9, 1, 12, 0, 0)),
         //    new TrainInfo("5831", "Прага", "Варшава",
         //        new DateTime(2015, 9, 1, 8, 40, 0),
         //        new DateTime(2015, 9, 1, 12, 0, 0)),
         //    new TrainInfo("5831", "Прага", "Варшава",
         //        new DateTime(2015, 9, 1, 8, 40, 0),
         //        new DateTime(2015, 9, 1, 12, 0, 0)),
         //    new TrainInfo("5831", "Прага", "Варшава",
         //        new DateTime(2015, 9, 1, 8, 40, 0),
         //        new DateTime(2015, 9, 1, 12, 0, 0)),
         //    new TrainInfo("5831", "Прага", "Варшава",
         //        new DateTime(2015, 9, 1, 8, 40, 0),
         //        new DateTime(2015, 9, 1, 12, 0, 0)),
         //    new TrainInfo("5831", "Прага", "Варшава",
         //        new DateTime(2015, 9, 1, 8, 40, 0),
         //        new DateTime(2015, 9, 1, 12, 0, 0))
         //};
         MainWindow mainWindow = new MainWindow();
         mainWindow.Show();
     }
     catch (Exception exception)
     {
         Debug.WriteLine(exception);
     }
 }
コード例 #3
0
ファイル: App.xaml.cs プロジェクト: ArtemyB/TrainsSchedule
 private void App_OnStartup(object sender, StartupEventArgs e)
 {
     try
     {
         TrainInfoCollection = new TrainInfoCollection();
         //{
         //    new TrainInfo("2345", "Минск", "Вильнюс",
         //        new DateTime(2015, 8, 31, 7, 40, 0),
         //        new DateTime(2015, 8, 31, 11, 0, 0)),
         //    new TrainInfo("6743", "Минск", "Берлин",
         //        new DateTime(2015, 8, 31, 9, 30, 0),
         //        new DateTime(2015, 8, 31, 23, 0, 0)),
         //    new TrainInfo("9074", "Минск", "Вильнюс",
         //        new DateTime(2015, 8, 31, 7, 40, 0),
         //        new DateTime(2015, 8, 31, 11, 0, 0)),
         //    new TrainInfo("5831", "Прага", "Варшава",
         //        new DateTime(2015, 9, 1, 8, 40, 0),
         //        new DateTime(2015, 9, 1, 12, 0, 0)),
         //    new TrainInfo("5831", "Прага", "Варшава",
         //        new DateTime(2015, 9, 1, 8, 40, 0),
         //        new DateTime(2015, 9, 1, 12, 0, 0)),
         //    new TrainInfo("5831", "Прага", "Варшава",
         //        new DateTime(2015, 9, 1, 8, 40, 0),
         //        new DateTime(2015, 9, 1, 12, 0, 0)),
         //    new TrainInfo("5831", "Прага", "Варшава",
         //        new DateTime(2015, 9, 1, 8, 40, 0),
         //        new DateTime(2015, 9, 1, 12, 0, 0)),
         //    new TrainInfo("5831", "Прага", "Варшава",
         //        new DateTime(2015, 9, 1, 8, 40, 0),
         //        new DateTime(2015, 9, 1, 12, 0, 0)),
         //    new TrainInfo("5831", "Прага", "Варшава",
         //        new DateTime(2015, 9, 1, 8, 40, 0),
         //        new DateTime(2015, 9, 1, 12, 0, 0)),
         //    new TrainInfo("5831", "Прага", "Варшава",
         //        new DateTime(2015, 9, 1, 8, 40, 0),
         //        new DateTime(2015, 9, 1, 12, 0, 0)),
         //    new TrainInfo("5831", "Прага", "Варшава",
         //        new DateTime(2015, 9, 1, 8, 40, 0),
         //        new DateTime(2015, 9, 1, 12, 0, 0)),
         //    new TrainInfo("5831", "Прага", "Варшава",
         //        new DateTime(2015, 9, 1, 8, 40, 0),
         //        new DateTime(2015, 9, 1, 12, 0, 0))
         //};
         MainWindow mainWindow = new MainWindow();
         mainWindow.Show();
     }
     catch (Exception exception)
     {
         Debug.WriteLine(exception);
     }
 }
コード例 #4
0
        public void LoadFile()
        {
            OpenFileDialog dialog = new OpenFileDialog()
            {
                Filter          = fileFilter,
                AddExtension    = true,
                CheckPathExists = true,
                DefaultExt      = "schd"
            };

            dialog.ShowDialog();
            dataSource.Clear();
            foreach (var item in TrainInfoCollection.Load(dialog.FileName))
            {
                dataSource.Add(item);
            }
        }
コード例 #5
0
        public TrainsScheduleDGridController(TrainsScheduleDGrid view,
                                             TrainInfoCollection collection)
        {
            if (view == null)
            {
                throw new ArgumentNullException("view");
            }
            if (collection == null)
            {
                throw new ArgumentNullException("collection");
            }

            this.view = view;
            cView     = new PagedCollectionView(collection)
            {
                PageSize = 10
            };
        }