public ImportPage(ImportPageViewModel viewModel) { InitializeComponent(); this.viewModel = viewModel; this.DataContext = viewModel; }
public int GetNodeCount(ref ImportPageViewModel info) { int c = (from n in RNDataContext.Nodes select n).Count(); info.InfoText = "Chopper " + c; info.OnPropertyChanged("InfoText"); return(c); }
public ImportWorker(ref ImportPageViewModel infoRef, BackgroundWorker bgWorker, RoadNetworkDataContext dc) { info = infoRef; worker = bgWorker; DataContext = dc; CoordinateSystemFactory c = new CoordinateSystemFactory(); ICoordinateSystem source = c.CreateFromWkt("PROJCS[\"OSGB 1936 / British National Grid\",GEOGCS[\"OSGB 1936\",DATUM[\"OSGB_1936\",SPHEROID[\"Airy 1830\",6377563.396,299.3249646,AUTHORITY[\"EPSG\",\"7001\"]],AUTHORITY[\"EPSG\",\"6277\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4277\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",49],PARAMETER[\"central_meridian\",-2],PARAMETER[\"scale_factor\",0.9996012717],PARAMETER[\"false_easting\",400000],PARAMETER[\"false_northing\",-100000],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AUTHORITY[\"EPSG\",\"27700\"]]"); ICoordinateSystem target = c.CreateFromWkt("GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.0174532925199433]]"); CoordinateTransformationFactory trf = new CoordinateTransformationFactory(); OsgbToWgs = trf.CreateFromCoordinateSystems(source, target); }
public void ImportNetworkData(ref ImportPageViewModel info) { worker = new BackgroundWorker(); ImportWorker = new ImportWorker(ref info, worker, RNDataContext); info.MaxRecords = 1000; info.OnPropertyChanged("MaxRecords"); worker.DoWork += new DoWorkEventHandler(ImportWorker.DoWork); worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(ImportWorker.RunWorkerCompleted); worker.WorkerSupportsCancellation = true; worker.RunWorkerAsync(); }