public void init(int programID, AxMapControl mc, Intersect.ProgramStepUserControl.OnFinish of, MainWindow mw) { inited = true; if (program == null) program = new Program(); program.id = programID; program.select(); if (project == null) project = new Project(); project.id = program.projectID; project.select(); NetSizeUserControl.init(program.id); ConditionUserControl.init(program.id); mapControl = mc; onFinish = of; mainWindow = mw; mapControlMouseDown = null; //在初始化时就要对valid进行判断. Thread t = new Thread(delegate() { System.Threading.Thread.Sleep(500); Dispatcher.BeginInvoke((ThreadStart)delegate() { if (isValid()) { valid = true; onFinish(true); IFeatureClass resultFeatureClass; if ((resultFeatureClass = GisUtil.getFeatureClass(System.IO.Path.GetDirectoryName(project.path), "评价结果.shp")) != null) { IFeatureLayer resultFeatureLayer = new FeatureLayerClass(); resultFeatureLayer.FeatureClass = resultFeatureClass; mapControl.AddLayer(resultFeatureLayer); } else { SiteSelector siteSelector = new SiteSelector(mapControl, program.id); siteSelector.startSelectSite(); } } }); }); t.Start(); }
public void init(int programID, AxMapControl mc, Intersect.ProgramStepUserControl.OnFinish of) { inited = true; if (program == null) program = new Program(); program.id = programID; program.select(); if (project == null) project = new Project(); project.id = program.projectID; project.select(); NetSizeUserControl.init(program.id); ConditionUserControl.init(program.id); mapControl = mc; onFinish = of; mapControlMouseDown = null; //在初始化时就要对valid进行判断. Thread t = new Thread(delegate() { System.Threading.Thread.Sleep(500); Dispatcher.BeginInvoke((ThreadStart)delegate() { if (isValid()) { valid = true; onFinish(true); SiteSelector siteSelector = new SiteSelector(mapControl, program.id); siteSelector.startSelectSite(); } }); }); t.Start(); }
public void init(int programID, AxMapControl mc, Intersect.ProgramStepUserControl.OnFinish of) { inited = true; onFinish = of; program = new Program(); program.id = programID; program.select(); housePlacerIndexCount = 0; villageList = program.getAllRelatedVillage(); if (villageList == null) { villageList = new ObservableCollection<Village>(); } else { ObservableCollection<Village> inUseVillageList = new ObservableCollection<Village>(); foreach (Village village in villageList) { if (village.inUse) { inUseVillageList.Add(village); CommonHouse commonHouse = village.getRelatedCommonHouse(); if (commonHouse == null) { commonHouse = CommonHouse.GetDefaultCommonHouse(); commonHouse.villageID = village.id; } village.commonHouse = commonHouse; ObservableCollection<House> houseList = village.getAllRelatedHouse(); if (houseList == null) houseList = new ObservableCollection<House>(); else { foreach (House house in houseList) { house.housePlacerListIndex = housePlacerIndexCount++; } } village.houseList = houseList; village.innerRoad = village.getRelatedInnerRoad(); } } villageList = inUseVillageList; } mapControl = mc; dirty = false; prePlaced = false; mapControlMouseDown = null; HousePlacerListBox.ItemsSource = villageList; Thread t = new Thread(delegate() { System.Threading.Thread.Sleep(500); Dispatcher.BeginInvoke((ThreadStart)delegate() { if (isValid()) { valid = true; onFinish(true); } }); }); t.Start(); }
public void init(int programID, AxMapControl mc, AxToolbarControl tc, Intersect.ProgramStepUserControl.OnFinish of, MainWindow mw) { inited = true; villageColorRandomer = new VillageColorRandomer(); program = new Program(); program.id = programID; program.select(); villageList = program.getAllRelatedVillage(); if (villageList == null) { villageList = new ObservableCollection<Village>(); } else { foreach (Village village in villageList) { village.polygonElementColorString = villageColorRandomer.randomColor(); InnerRoad innerRoad = village.getRelatedInnerRoad(); village.innerRoad = innerRoad; } } mapControl = mc; toolbarControl = tc; mainWindow = mw; foreach (Village village in villageList) { GisUtil.drawPolygonElement(village.polygonElement, mapControl); GisUtil.UpdatePolygonElementColor(village.polygonElement, mapControl , VillageColorRandomer.GetRedFromColorString(village.polygonElementColorString) , VillageColorRandomer.GetGreenFromColorString(village.polygonElementColorString) , VillageColorRandomer.GetBlueFromColorString(village.polygonElementColorString)); if (village.innerRoad.lineElement != null) GisUtil.DrawPolylineElement(village.innerRoad.lineElement, mapControl); if (village.inUse) { string reverseColorString = VillageColorRandomer.GetReverseVillageColorString(village.polygonElementColorString); GisUtil.UpdatePolygonElementOutline(village.polygonElement, mapControl , VillageColorRandomer.GetRedFromColorString(reverseColorString) , VillageColorRandomer.GetGreenFromColorString(reverseColorString) , VillageColorRandomer.GetBlueFromColorString(reverseColorString)); } } valid = isValid(); dirty = false; onFinish = of; mapControlMouseDown = null; VillageListBox.ItemsSource = villageList; }
public void init(int programID, Intersect.ProgramStepUserControl.OnFinish of, AxMapControl mc, AxToolbarControl tc, MainWindow mainWindow) { inited = true; onFinish = of; Pager.nowStep = 1; Pager.totalStep = 2; Pager.update(); Pager.nextStepButtonCheck = nextStepCheckValid; Pager.nextStepButtonClick += new EventHandler(nextStepClick); Pager.previewStepButtonClick += new EventHandler(previewStepClick); mapControl = mc; toolbarControl = tc; mapControlMouseDown = onMapControlMouseDown; SelectMainRoadUserControl.init(programID, mapControl, toolbarControl, mainWindow); SelectVillageUserControl.init(programID, mapControl, toolbarControl, of, mainWindow); Thread t = new Thread(delegate() { System.Threading.Thread.Sleep(500); Dispatcher.BeginInvoke((ThreadStart)delegate() { if (isValid()) { onFinish(true); } }); }); t.Start(); }