/// <summary>Set the selected controls.</summary> public static void Host_Controls_SelectedSet(IDesignerHost host, List <Control> controls) { if (host == null) { return; } ISelectionService selService = UIDesigner_Service.ISelectionService_FromHost(host); selService.SetSelectedComponents(controls); }
/// <summary>Return the selected controls.</summary> public static List <Control> Host_Controls_Selected(IDesignerHost host) { if (host == null) { return(null); } ISelectionService selectionService = UIDesigner_Service.ISelectionService_FromHost(host); return(selectionService.GetSelectedComponents().OfType <Control>().ToList()); }
/// <summary>Set the selected controls.</summary> public static void Host_Controls_SelectedSet1(IDesignerHost host, Component control) { if (host == null) { return; } ISelectionService selService = UIDesigner_Service.ISelectionService_FromHost(host); var controls = new List <Component>(); controls.Add(control); selService.SetSelectedComponents(controls); }
/// <summary>Return the selected controls.</summary> public static void Host_Controls_SelectionChange(IDesignerHost host, EventHandler selectionChanged, bool remove = false) { if (host == null) { return; } ISelectionService selService = UIDesigner_Service.ISelectionService_FromHost(host); selService.SelectionChanged -= selectionChanged; if (remove == false) { selService.SelectionChanged += selectionChanged; } }