This document is archived and information here might be outdated.  Recommended version.


INAWindow.ActiveCategory Property (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference (NetworkAnalystUI)  

INAWindow.ActiveCategory Property

The current category shown in the window.

[Visual Basic .NET]
Public Property ActiveCategory As INAWindowCategory
[C#]
public INAWindowCategory ActiveCategory {get; set;}

Product Availability

Available with ArcGIS Desktop. Requires Network Analyst Extension.

Remarks

The ActiveCategory is the current category of network locations selected in the NAWindow.  Examples of categories include Stops, Barriers, Incidents, Facilities, Routes, etc.

The INAWindowCategory returned by ActiveCategory has methods to get the NALayer's sublayer or the NAClass.

[C#]
public void ShowActiveCategory(IApplication app)
{
  INetworkAnalystExtension networkAnalystExtension=app.FindExtensionByName("Network Analyst") as INetworkAnalystExtension;
  
  INAWindow naWindow=networkAnalystExtension.NAWindow;
  
  INAWindowCategory naWindowCategory=naWindow.ActiveCategory;
  
  MessageBox.Show(string.Format("ActiveCategory Layer Name: {0}", naWindowCategory.Layer.Name));
  MessageBox.Show(string.Format("ActiveCategory NAClass Name: {0}", naWindowCategory.NAClass.ClassDefinition.Name));
}
[Visual Basic .NET]
Public  Sub ShowActiveCategory(ByVal app As IApplication)
  Dim networkAnalystExtension As INetworkAnalystExtension=app.FindExtensionByName("Network Analyst")
 
  Dim naWindow As INAWindow=networkAnalystExtension.NAWindow 
 
  Dim naWindowCategory As INAWindowCategory=naWindow.ActiveCategory 
 
  MessageBox.Show(String.Format("ActiveCategory Layer Name: {0}", naWindowCategory.Layer.Name))
  MessageBox.Show(String.Format("ActiveCategory NAClass Name: {0}", naWindowCategory.NAClass.ClassDefinition.Name))
End Sub

See Also

INAWindow Interface