i'm trying to saving car Trail info from the example:
DesktopEditionSample_BreadCrumbTrail_CS_100428
to shape file for view in ESRI ArcView
but i can't manage to do it.
InMemoryFeatureLayer breadCrumbTrailInMemoryFeatureLayer = (InMemoryFeatureLayer)m_carOverlay.Layers["CarTrail"];
System.Collections.ObjectModel.Collection<DbfColumn> cols = new System.Collections.ObjectModel.Collection<DbfColumn>();
DbfColumn s = new DbfColumn("Spatial", DbfColumnType.String, 1, 0);
cols.Add(s);
ShapeFileFeatureLayer.CreateShapeFile(ShapeFileType.Multipoint, @"C:\Temp\TESTXX.shp", cols);
ShapeFileFeatureLayer shapeFileLayer = new ShapeFileFeatureLayer(@"C:\Temp\TESTXX.shp", ShapeFileReadWriteMode.ReadWrite);
shapeFileLayer.Open();
try
{
shapeFileLayer.EditTools.BeginTransaction();
foreach (var feature in breadCrumbTrailInMemoryFeatureLayer.InternalFeatures)
{
shapeFileLayer.EditTools.Add(feature);
}
TransactionResult result = shapeFileLayer.EditTools.CommitTransaction();
ShapeFileFeatureLayer.BuildIndexFile(@"C:\Temp\TESTXX.shp");
}
finally
{
shapeFileLayer.Close();
}
please add some code sample...
10x