Exemplo n.º 1
0
 private void importStationList_Click(object sender, RoutedEventArgs e)
 {
     Microsoft.Win32.OpenFileDialog openDlg = new Microsoft.Win32.OpenFileDialog();
     openDlg.DefaultExt = ".msn";
     openDlg.Filter     = "Master Station Name List (msn)|*.msn";
     openDlg.Title      = "Station List to import";
     if (openDlg.ShowDialog(this) == true)
     {
         IFileController cntrl  = new StationFileControl();
         FileParseBase   parser = new FileParseBase();
         parser.MessageToDisplay += new FileParseBase.MessageDisplayDel(parser_MessageToDisplay);
         ProvInfo         provInfo = new ProvInfo(txtName.Text, this.rbUri.IsChecked == true);
         List <Exception> Errors;
         IGraph           stationNameGraph = parser.ParseFile(openDlg.FileName, provInfo, cntrl, out Errors, this.viewModel, Properties.Settings.Default.fNameFormat);
         saveGraphToTurtle(stationNameGraph);
         saveGraphToRDF(stationNameGraph);
     }
 }
Exemplo n.º 2
0
        private void combinedImport(object args)
        {
            IFileController cntrl = new StationFileControl();

            FileParseBase parser = new FileParseBase();

            parser.MessageToDisplay += new FileParseBase.MessageDisplayDel(parser_MessageToDisplay);
            this.viewModel           = new MainWindowViewModel();
            List <Exception> Errors;
            IGraph           combinedGraph  = parser.ParseFile(((CominedImportArgs)args).StationNameList, ((CominedImportArgs)args).Prov, cntrl, out Errors, this.viewModel, Properties.Settings.Default.fNameFormat);
            IFileController  scheduledCntrl = new ScheduleFileControl();
            List <Exception> ErrorsTwo;
            IGraph           resultingGraph = parser.ParseFile(((CominedImportArgs)args).ScheduleFile, ((CominedImportArgs)args).Prov, scheduledCntrl, combinedGraph, out ErrorsTwo, this.viewModel, Properties.Settings.Default.ScheduleFNameFormat);
            //Dispatcher.BeginInvoke(new Action(() =>
            //{
            //    saveGraphToTurtle(resultingGraph);
            //}));
            //  saveGraphToRDF(resultingGraph);
        }