List <XRControl> GetSelectedControls() { ISelectionService serv = panel.GetService(typeof(ISelectionService)) as ISelectionService; IEnumerable <XRControl> selectedComponents = panel.GetSelectedComponents() .Where <object>(item => item is XRControl && !(item is Band) && !(item is XRCrossBandControl)) .Cast <XRControl>(); List <XRControl> selectedControls = new List <XRControl>(); if (selectedComponents.Count <XRControl>() == 0) { return(selectedControls); } XRControl primaryControl = serv.PrimarySelection as XRControl ?? selectedComponents.ElementAt <XRControl>(0); foreach (XRControl item in selectedComponents) { if (ReferenceEquals(item.Band, primaryControl.Band)) { selectedControls.Add(item as XRControl); } } return(selectedControls); }
Boolean IsXRLabelSelected() { object[] controls = panel.GetSelectedComponents(); foreach (object obj in controls) { if (obj is XRLabel) { return(true); } } return(false); }