public static CurveByInference RunTest(String FeatureDatasetName, String CadastralFabricName, string whereClause = null, string OrderBy = null, String GDBPath = null, bool withUpdate = false) { if (String.IsNullOrEmpty(GDBPath)) GDBPath = baseGeodatabasePath; if (!System.IO.Directory.Exists(GDBPath)) Assert.Inconclusive(String.Format("The path '{0}' can not be found", GDBPath)); //Load the geodatabase IWorkspaceFactory workspaceFactory = new ESRI.ArcGIS.DataSourcesGDB.FileGDBWorkspaceFactory(); workspace = workspaceFactory.OpenFromFile(GDBPath, 0); IFeatureWorkspace featureWorksapce = (IFeatureWorkspace)workspace; IFeatureDataset featureDataset = featureWorksapce.OpenFeatureDataset(FeatureDatasetName); IFeatureDatasetExtensionContainer featureDatasetExtContainer = (IFeatureDatasetExtensionContainer)featureDataset; IDatasetContainer2 datasetContainer = (IDatasetContainer2)featureDatasetExtContainer.FindExtension(esriDatasetType.esriDTCadastralFabric); ICadastralFabric cadFabric = (ICadastralFabric)datasetContainer.get_DatasetByName(esriDatasetType.esriDTCadastralFabric, CadastralFabricName); IFeatureClass featureClass = (IFeatureClass)cadFabric.get_CadastralTable(esriCadastralFabricTable.esriCFTLines); int idxParcelIDFld = featureClass.Fields.FindField("ParcelID"); int idxCENTERPTID = featureClass.Fields.FindField("CenterPointID"); int idxRADIUS = featureClass.Fields.FindField("Radius"); CurveByInference curveByInference = new CurveByInference() { messageBox = new MyMessageBox() }; curveByInference.FindCurves("test", featureClass, null, whereClause, new myProgessor()); Console.WriteLine(Framework.GenerateConstructorStatment(curveByInference.Curves)); if(withUpdate) { curveByInference.UpdateCurves(cadFabric, featureClass, curveByInference.Curves, new myProgessor()); } return curveByInference; }
public static CurveByInference RunFeatureClassTest(String featureDataset, String CenterpointFC, String LineFC, string whereClause = null, string OrderBy = null, String GDBPath = null) { if (String.IsNullOrEmpty(GDBPath)) GDBPath = baseDevGeodatabasePath; if (!System.IO.Directory.Exists(GDBPath)) Assert.Inconclusive(String.Format("The path '{0}' can not be found", GDBPath)); //Load the geodatabase IWorkspaceFactory workspaceFactory = new ESRI.ArcGIS.DataSourcesGDB.FileGDBWorkspaceFactory(); workspace = workspaceFactory.OpenFromFile(GDBPath, 0); IFeatureWorkspace featureWorksapce = (IFeatureWorkspace)workspace; IFeatureClassContainer featuredataset = (IFeatureClassContainer)featureWorksapce.OpenFeatureDataset(featureDataset); IFeatureClass featureClass = featuredataset.get_ClassByName(LineFC); CurveByInference curveByInference = new CurveByInference() { messageBox = new MyMessageBox() }; curveByInference.FindCurves("test", featureClass, null, whereClause, new myProgessor()); Console.WriteLine(Framework.GenerateConstructorStatment(curveByInference.Curves)); return curveByInference; }
private void Clear_Click(object sender, RoutedEventArgs e) { CurveByInference context = new CurveByInference(); this.DataContext = context; }
private void Find_Click(object sender, RoutedEventArgs e) { CurveByInference context = new CurveByInference(); this.DataContext = context; context.FindCurves(); }