IMxDocument mxDocument = (IMxDocument)ChangeMultipleSymbology_AddIn.ArcMap.Document; IActiveView activeView = (IActiveView)mxDocument.ActiveView; IContentsView contentsView = (IContentsView)mxDocument.CurrentContentsView; System.Object x = contentsView.SelectedItem;
System.Object x = contentsView.SelectedItem if ((x is ESRI.ArcGIS.esriSystem.ISet)) { ISet set = (ISet) x; int numSelectedLyr = set.Count ...blah blah whatever code you want.... }