public void Execute()
{
// Load Selected Features
LoadSelectedFeatures();
// Show the form
IntPtr p = new IntPtr(m_pApp.hWnd);
Show((Form)System.Windows.Forms.Form.FromHandle(p));
}
private void LoadSelectedFeatures()
{
// Get the active map and use it to get the current selection
IMap pMap = m_MxDoc.FocusMap;
IEnumFeature pFeatures = (IEnumFeature)pMap.FeatureSelection;
IFeature pFea = pFeatures.Next();
while (pFea != null)
{
// If the feature has a gas trace weight field, then try to interpret it
int gasTraceWeightFI = pFea.Fields.FindField("GasTraceWeight");
if (gasTraceWeightFI > -1)
{
if (pFea.Shape.GeometryType == esriGeometryType.esriGeometryPolyline)
InterpretLineFeature(pFea, gasTraceWeightFI);
else if (pFea.Shape.GeometryType == esriGeometryType.esriGeometryPoint)
InterpretPointFeature(pFea, gasTraceWeightFI);
}
pFea = pFeatures.Next();
}
}