Esempio n. 1
0
        public static void Main()
        {
            Database.SetInitializer(new CreateDatabaseIfNotExists<PhotoContext>());

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //var repository = new EFPhotoRepository();
            var repository = new XMLPhotoRepository();

            var newTripFrom = new NewTripForm();
            var process = new MainProcess(repository, newTripFrom);

            Application.Run(new MainWindow(process));
        }
Esempio n. 2
0
        public MainWindow(MainProcess process)
        {
            _process = process;
            InitializeComponent();

            IList<string> trips = _process.AvailableTrips();
            foreach (var trip in trips)
            {
                //TODO make this a new method
                var menuItem = new ToolStripMenuItem
                                   {
                                       Text = trip,
                                       Name = trip + "ToolStripMenuItem",
                                   };

                menuItem.Click += TripClicked_Event;

                recentToolStripMenuItem.DropDownItems.Add(menuItem);
            }

            PictureIndex.KeyPress += PictureIndex_KeyPress;
        }