await QueuedTask.Run(() => { MapMemberIDSet rootNodes = MapView.Active.GetRootNodes(); var rootNodeDict = rootNodes.ToDictionary(); // rootNodeDict is a Dictionary<MapMember, List<long>> // access a particular mapMember in the Dictionary if (rootNodeDict.ContainsKey(mapMember)) { var oids = rootNodeDict[mapMember]; } // OR iterate through the dictionary foreach (var (mm, oids) in rootNodeDict) { // do something } });
await QueuedTask.Run(() => { var dict = new Dictionary<MapMember, List<long>>(); dict.Add(entityLayer, oids); MapMemberIDSet mmIDSet = MapMemberIDSet.FromDictionary(dict); MapView.Active.SetRootNodes(mmIDSet); });
await QueuedTask.Run(() => { var mapSel = MapView.Active.Map.GetSelection(); MapView.Active.SetRootNodes(mapSel); });
await QueuedTask.Run(() => { var dict = new Dictionary<MapMember, List<long>>(); dict.Add(entityLayer, oids); dict.Add(entityLayer2, oids2); MapMemberIDSet mmIDSet = MapMemberIDSet.FromDictionary(dict); MapView.Active.SelectRootNodes(mmIDSet); });
System.Object
ArcGIS.Desktop.Mapping.MapMemberIDSet
ArcGIS.Desktop.Mapping.SelectionSet
Target Platforms: Windows 11, Windows 10