Ejemplo n.º 1
0
 private void fcCombo_CurrentChanged(object sender, RibbonPropertyChangedEventArgs e)
 {
     try
     {
         RibbonCombo ribbonCombo = sender as RibbonCombo;
         RibbonLabel ribbonLabel = ribbonCombo.Current as RibbonLabel;
         if (ribbonLabel != null)
         {
             FCTag           fCTag                 = (FCTag)ribbonLabel.Tag;
             MSCFeatureClass featureClass          = fCTag.GetFeatureClass(AfaDocData.ActiveDocData.DocDataset);
             MSCFeatureClass topActiveFeatureClass = AfaDocData.ActiveDocData.GetTopActiveFeatureClass();
             if (featureClass != topActiveFeatureClass)
             {
                 AfaDocData.ActiveDocData.SetActiveFeatureClass(featureClass);
                 ArcGISRibbon.SetSubTypeComboToDefault(featureClass);
             }
             ArcGISRibbon.SetFeatureClassButtonState(AfaDocData.ActiveDocData.GetActiveFeatureClassOrSubtype());
         }
     }
     catch
     {
         AfaDocData.ActiveDocData.ClearActiveFeatureClass();
         ArcGISRibbon.ClearSubtypeCombo();
         ArcGISRibbon.SetFeatureClassButtonState(AfaDocData.ActiveDocData.GetActiveFeatureClassOrSubtype());
     }
 }