예제 #1
0
파일: Form1.cs 프로젝트: LooWooTech/Traffic
 private void ShowAttribute(IGeometry geometry)
 {
     IFeatureClass CurrentFeatureClass = null;
     string LayerName = string.Empty;
     switch (dataType)
     {
         case DataType.Road:
             LayerName = RoadName;
             CurrentFeatureClass = RoadFeatureClass;
             break;
         case DataType.BusLine:
             LayerName = BusLineName;
             CurrentFeatureClass = BusLineFeatureClass;
             break;
         case DataType.BusStop:
             LayerName = BusStopName;
             CurrentFeatureClass = BusStopFeatureClass;
             break;
         case DataType.Parking:
             LayerName = ParkingName;
             CurrentFeatureClass = ParkingFeatureClass;
             break;
         case DataType.Bike:
             LayerName = BikeName;
             CurrentFeatureClass = BikeFeatureClass;
             break;
         case DataType.Flow:
             LayerName = FlowName;
             CurrentFeatureClass = FlowFeatureClass;
             break;
     }
     IArray array = AttributeHelper.Identify(CurrentFeatureClass, geometry,"");
     if (array != null)
     {
         IFeatureIdentifyObj featureIdentifyObj = array.get_Element(0) as IFeatureIdentifyObj;
         IIdentifyObj identifyObj = featureIdentifyObj as IIdentifyObj;
         IRowIdentifyObject rowidentifyObject = featureIdentifyObj as IRowIdentifyObject;
         IFeature feature = rowidentifyObject.Row as IFeature;
         //IFeature feature = AttributeHelper.Identify2(RoadFeatureClass, geometry);
         if (feature != null)
         {
             Twinkle(feature);
             AttributeForm form = new AttributeForm(feature, CurrentFeatureClass, null, null, LayerName);
             form.ShowDialog(this);
         }
     }
 }
예제 #2
0
 private void View(IFeature Feature)
 {
     AttributeForm form = new AttributeForm(Feature, Father.BusLineFeatureClass, null, null, Father.BusLineName);
     form.Show(Father);
 }