From the original source ArcGIS Engine edit-Iworkspaceedit
In this example, I created 1000 elements, combined with buffering to write the data to a file, and added time statistics, of course, I fabricated the data, but also forgive me, this time spent 0.978 seconds, speed is OK.
Iworkspacefactory pwsf = new Shapefileworkspacefactory ();
Ifeatureworkspace Pftws = Pwsf.openfromfile (@ "E:\arcgis\Engine\ data", 0) as Ifeatureworkspace;
Ifeatureclass Pftclass = Pftws.openfeatureclass ("edit");
Ifeaturelayer pFt = new Featurelayerclass ();
Pft.featureclass = Pftclass;
Pft.name = "Draw Line";
AxMapControl1.Map.AddLayer (pFt as ILayer);
Axmapcontrol1.refresh ();
To further illustrate Idataset, I purposely from the following code
Idataset Pdataset = Pftclass as Idataset;
Iworkspace pWs = pdataset.workspace;
Pwsedit = PWs as Iworkspaceedit;
Pwsedit.startediting (TRUE);
Pwsedit.starteditoperation ();
Pboolstart = pwsedit.isbeingedited ();
System.Diagnostics.Stopwatch Timewatch = new System.Diagnostics.Stopwatch ();
Timewatch.start ();
Ifeaturebuffer Pfeaturebuffer = Pftclass.createfeaturebuffer ();
Ifeaturecursor pftcusor = Pftclass.insert (true);
ESRI. ArcGIS.Geometry.IPolyline polyline = new ESRI. ArcGIS.Geometry.PolylineClass ();
ESRI. ArcGIS.Geometry.IPoint ppoint = new ESRI. ArcGIS.Geometry.PointClass ();
ESRI. ArcGIS.Geometry.IPoint PPoint2 = new ESRI. ArcGIS.Geometry.PointClass ();
for (int i = 0; i <; i++)
{
Ppoint.x = + i * 102;
PPOINT.Y = + I * 10;
Polyline. Frompoint = PPoint;
ppoint2.x = 480 + i * 10;
PPOINT2.Y = 615 + i * 102;
Polyline. Topoint = PPoint2;
Pfeaturebuffer.shape = polyline;
Pfeaturebuffer.set_value (2, I);
Object pfeatureoid = Pftcusor.insertfeature (Pfeaturebuffer);
}
Pftcusor.flush ();
Pwsedit.stopediting (TRUE);
Axmapcontrol1.refresh ();
Timewatch.stop ();
MessageBox.Show (TimeWatch.Elapsed.Milliseconds.ToString ());
The effect is as follows:
Editor5
ArcGIS Engine Edit-Iworkspaceedit