Browse Source

Minor code reformat.

pull/494/head
Matt Ward 11 years ago
parent
commit
876f5b3615
  1. 19
      src/AddIns/DisplayBindings/FormsDesigner/Project/Src/FormKeyHandler.cs

19
src/AddIns/DisplayBindings/FormsDesigner/Project/Src/FormKeyHandler.cs

@ -135,18 +135,17 @@ namespace ICSharpCode.FormsDesigner
selectionService.SetSelectedComponents(components); selectionService.SetSelectedComponents(components);
} }
return true; return true;
} } else if (keyPressed == Keys.Escape) {
else if(keyPressed == Keys.Escape) { ISelectionService selectionService = (ISelectionService)formDesigner.Host.GetService(typeof(ISelectionService));
ISelectionService selectionService = (ISelectionService)formDesigner.Host.GetService(typeof(ISelectionService)); ICollection components = selectionService.GetSelectedComponents();
ICollection components = selectionService.GetSelectedComponents();
if (components.Count == 1) { if (components.Count == 1) {
Control ctrl = components.OfType<Control>().FirstOrDefault(); Control ctrl = components.OfType<Control>().FirstOrDefault();
if (ctrl != null && ctrl.Parent != null) { if (ctrl != null && ctrl.Parent != null) {
selectionService.SetSelectedComponents(new IComponent[] { ctrl.Parent }, SelectionTypes.Primary); selectionService.SetSelectedComponents(new IComponent[] { ctrl.Parent }, SelectionTypes.Primary);
} }
} }
return true; return true;
} }
return false; return false;
} }

Loading…
Cancel
Save