Exemplo n.º 1
0
        /*
         *  TODO:
         *      Filtering through Combobox
         */

        public AnnoWindow(AnnoDB db, MeteoDB mdb)
        {
            InitializeComponent();
            annoDB  = db;
            meteoDB = mdb;
            annoDB.makeList();
            libDB = (LibDB)DataFactory.getDataContext(DataFactory.DataType.LibObject);
            libDB.makeList(mdb.MeteoTable.ToList());
            annoLib                  = libDB.library;
            annoCollection           = annoDB.AnnoCol;
            AnnoDataGrid.DataContext = annoDB;
            AnnoDataGrid.ItemsSource = annoCollection;
            AnnoDataGrid.Items.Refresh();
        }
Exemplo n.º 2
0
        public MainWindow()
        {
            InitializeComponent();

            meteoDB = (MeteoDB)DataFactory.getDataContext(DataFactory.DataType.Meteorite);
            annoDB  = (AnnoDB)DataFactory.getDataContext(DataFactory.DataType.Annotation);
            annoWin = new AnnoWindow(annoDB, meteoDB);
            annoWin.Show();
            //MeteoDataGrid.DataContext = meteoDB;
            //MeteoDataGrid.ItemsSource = meteoDB.MeteoTable;

            mvc = new MapVizContainer();
            mvc.CurrentSelectionChanged += Mvc_CurrentSelectionChanged;

            initializeData(); //this should have been in the presentation. it was missing due to a bad conflict merge on github hence Jason's utter confusion during the presentation
            mvc.updateMap(mainMap);
        }
Exemplo n.º 3
0
        private static void createMDF(DataType dtype)
        {
            string connectionString;

            switch (dtype)
            {
            case DataType.Annotation:
                connectionString = createConnectionString(ANNOMDFFILENAME);
                using (AnnoDB db = new AnnoDB(connectionString))
                {
                    if (db.DatabaseExists())
                    {
                        db.DeleteDatabase();
                    }
                    db.CreateDatabase();
                }
                break;

            case DataType.Meteorite:
                connectionString = createConnectionString(METEOMDFFILENAME);
                using (MeteoDB db = new MeteoDB(connectionString))
                {
                    if (db.DatabaseExists())
                    {
                        db.DeleteDatabase();
                    }
                    db.CreateDatabase();
                    //db.MeteoTable.InsertOnSubmit(new Meteorite());
                }
                break;

            case DataType.LibObject:
                connectionString = createConnectionString(LIBRARYFILENAME);
                using (LibDB db = new LibDB(connectionString))
                {
                    if (db.DatabaseExists())
                    {
                        db.DeleteDatabase();
                    }
                    db.CreateDatabase();
                }
                break;
            }
        }
Exemplo n.º 4
0
        internal static object getDataContext(DataType dtype)
        {
            string connectionString;

            switch (dtype)
            {
            case DataType.Annotation:
                connectionString = createConnectionString(ANNOMDFFILENAME);
                AnnoDB db = new AnnoDB(connectionString);
                {
                    if (!db.DatabaseExists())
                    {
                        createMDF(dtype);
                    }
                    return(db);
                }
                break;

            case DataType.Meteorite:
                connectionString = createConnectionString(METEOMDFFILENAME);
                MeteoDB mdb = new MeteoDB(connectionString);
                {
                    if (!mdb.DatabaseExists())
                    {
                        createMDF(dtype);
                    }
                    return(mdb);
                }
                break;

            case DataType.LibObject:
                connectionString = createConnectionString(LIBRARYFILENAME);
                LibDB lib = new LibDB(connectionString);
                {
                    if (!lib.DatabaseExists())
                    {
                        createMDF(dtype);
                    }
                    return(lib);
                }
                break;
            }
            return(null);
        }