Browse Source

More documentation

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/shortcuts@4609 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts^2
Sergej Andrejev 16 years ago
parent
commit
d0d39c4f9f
  1. 4
      src/Main/ICSharpCode.Core.Presentation/CommandsService/BindingInfoBase.cs
  2. 6
      src/Main/ICSharpCode.Core.Presentation/CommandsService/CommandsService.cs
  3. 177
      src/Main/ICSharpCode.Core.Presentation/CommandsService/Events/NotifyBindingsChangedEvent.cs
  4. 70
      src/Main/ICSharpCode.Core.Presentation/CommandsService/Events/NotifyGesturesChangedEvent.cs
  5. 24
      src/Main/ICSharpCode.Core.Presentation/CommandsService/Events/NotifyUserGestureProfileChangedEvent.cs
  6. 6
      src/Main/ICSharpCode.Core.Presentation/CommandsService/InputBindingInfo.cs
  7. 2
      src/Main/ICSharpCode.Core.Presentation/CommandsService/Profile/UserGestureManager.cs
  8. 12
      src/Main/ICSharpCode.Core.Presentation/Test/BindingGroupTests.cs
  9. 4
      src/Main/ICSharpCode.Core.Presentation/Test/CommandManagerTests.cs

4
src/Main/ICSharpCode.Core.Presentation/CommandsService/BindingInfoBase.cs

@ -221,8 +221,8 @@ namespace ICSharpCode.Core.Presentation @@ -221,8 +221,8 @@ namespace ICSharpCode.Core.Presentation
|| (args.Action == NotifyBindingsChangedAction.NamedInstanceModified && OwnerInstanceName == args.UIElementName)
|| (args.Action == NotifyBindingsChangedAction.RoutedUICommandModified && routedCommandName == args.RoutedCommandName)
|| (args.Action == NotifyBindingsChangedAction.NamedTypeModified && OwnerTypeName == args.TypeName)
|| (args.Action == NotifyBindingsChangedAction.GroupAttachmendsModified && ((OwnerTypeName != null && OwnerTypes.Any(t1 => args.AttachedInstances.Any(t2 => t1 == t2.GetType())))
|| (OwnerInstanceName != null && OwnerInstances.Any(t1 => args.AttachedInstances.Any(t2 => t1 == t2)))))
|| (args.Action == NotifyBindingsChangedAction.GroupAttachmendsModified && ((OwnerTypeName != null && OwnerTypes.Any(t1 => args.GroupHandledInstances.Any(t2 => t1 == t2.GetType())))
|| (OwnerInstanceName != null && OwnerInstances.Any(t1 => args.GroupHandledInstances.Any(t2 => t1 == t2)))))
) {
GenerateBindings();

6
src/Main/ICSharpCode.Core.Presentation/CommandsService/CommandsService.cs

@ -217,6 +217,12 @@ namespace ICSharpCode.Core.Presentation @@ -217,6 +217,12 @@ namespace ICSharpCode.Core.Presentation
}
}
/// <summary>
/// Register all input bindings from collection of <see cref="InputBindingDescriptor" />s
/// found through given path
/// </summary>
/// <param name="caller">Caller object</param>
/// <param name="path">Path to collection of <see cref="InputBindingDescriptor" />s</param>
public static void RegisterInputBindings(object caller, string path)
{
var descriptors = AddInTree.BuildItems<InputBindingDescriptor>(path, caller, false);

177
src/Main/ICSharpCode.Core.Presentation/CommandsService/Events/NotifyBindingsChangedEvent.cs

@ -7,11 +7,34 @@ using ICSharpCode.Core.Presentation; @@ -7,11 +7,34 @@ using ICSharpCode.Core.Presentation;
namespace ICSharpCode.Core.Presentation
{
/// <summary>
/// Represent a method that will handle <see cref="ICSharpCode.Core.Presentation.CommandManager.BindingsChanged" /> event
/// </summary>
public delegate void NotifyBindingsChangedEventHandler(object sender, NotifyBindingsChangedEventArgs args);
/// <summary>
/// Provides data for <see cref="ICSharpCode.Core.Presentation.CommandManager.BindingsChanged" /> event
/// </summary>
public class NotifyBindingsChangedEventArgs : EventArgs
{
private ICollection<BindingInfoTemplate> _modifiedBindingInfoTemplates;
private string _routedCommandName;
private string _typeName;
private ICollection<Type> _oldNamedTypes;
private ICollection<Type> _newNamedTypes;
private string _uiElementName;
private ICollection<UIElement> _oldNamedUIElements;
private ICollection<UIElement> _newNamedUIElements;
private ICollection<UIElement> _attachedInstances;
private BindingGroupCollection _modifiedGroups;
private NotifyBindingsChangedAction _action;
/// <summary>
/// Gets collection of templates which can identify changed
/// <see cref="CommandBindingInfo" /> and <see cref="InputBindingInfo" /> objects
///
/// Provided only when <see cref="NotifyBindingsChangedEventArgs.Action" /> is equal to <see cref="NotifyBindingsChangedAction.BindingInfoModified" />
/// </summary>
public ICollection<BindingInfoTemplate> ModifiedBindingInfoTemplates
{
get {
@ -19,7 +42,12 @@ namespace ICSharpCode.Core.Presentation @@ -19,7 +42,12 @@ namespace ICSharpCode.Core.Presentation
}
}
private string _routedCommandName;
/// <summary>
/// Gets name of changed named <see cref="System.Windows.Input.RoutedUICommand" /> as registered using
/// <see cref="CommandManager.RegisterRoutedUICommand" />
///
/// Provided only when <see cref="NotifyBindingsChangedEventArgs.Action" /> is equal to <see cref="NotifyBindingsChangedAction.RoutedUICommandModified" />
/// </summary>
public string RoutedCommandName
{
get {
@ -27,7 +55,11 @@ namespace ICSharpCode.Core.Presentation @@ -27,7 +55,11 @@ namespace ICSharpCode.Core.Presentation
}
}
private string _typeName;
/// <summary>
/// Gets name of modified named <see cref="Type" /> as registered using <see cref="CommandManager.RegisterNamedUIType" />
///
/// Provided only when <see cref="NotifyBindingsChangedEventArgs.Action" /> is equal to <see cref="NotifyBindingsChangedAction.NamedTypeModified" />
/// </summary>
public string TypeName
{
get {
@ -35,7 +67,12 @@ namespace ICSharpCode.Core.Presentation @@ -35,7 +67,12 @@ namespace ICSharpCode.Core.Presentation
}
}
private ICollection<Type> _oldNamedTypes;
/// <summary>
/// Gets collection of types associated with name provided in <see cref="NotifyBindingsChangedEventArgs.TypeName" />
/// before the modification event
///
/// Provided only when <see cref="NotifyBindingsChangedEventArgs.Action" /> is equal to <see cref="NotifyBindingsChangedAction.NamedTypeModified" />
/// </summary>
public ICollection<Type> OldNamedTypes
{
get {
@ -43,7 +80,13 @@ namespace ICSharpCode.Core.Presentation @@ -43,7 +80,13 @@ namespace ICSharpCode.Core.Presentation
}
}
private ICollection<Type> _newNamedTypes;
/// <summary>
/// Gets collection of types associated with name provided in <see cref="NotifyBindingsChangedEventArgs.TypeName" />
/// after the modification event
///
/// Provided only when <see cref="NotifyBindingsChangedEventArgs.Action" /> is equal to <see cref="NotifyBindingsChangedAction.NamedTypeModified" />
/// </summary>
public ICollection<Type> NewNamedTypes
{
get {
@ -51,23 +94,38 @@ namespace ICSharpCode.Core.Presentation @@ -51,23 +94,38 @@ namespace ICSharpCode.Core.Presentation
}
}
private string _uiElementName;
/// <summary>
/// Gets name of modified named <see cref="UIElement" /> instance as registered using <see cref="CommandManager.RegisterNamedUIElement" />
///
/// Provided only when <see cref="NotifyBindingsChangedEventArgs.Action" /> is equal to <see cref="NotifyBindingsChangedAction.NamedInstanceModified" />
/// </summary>
public string UIElementName
{
get {
return _uiElementName;
}
}
private ICollection<UIElement> _oldNamedUIElements;
/// <summary>
/// Gets collection of <see cref="UIElement" /> instances associated with name provided in <see cref="NotifyBindingsChangedEventArgs.UIElementName" /> property
/// before the modification event
///
/// Provided only when <see cref="NotifyBindingsChangedEventArgs.Action" /> is equal to <see cref="NotifyBindingsChangedAction.NamedInstanceModified" />
/// </summary>
public ICollection<UIElement> OldNamedUIElements
{
get {
return _oldNamedUIElements;
}
}
private ICollection<UIElement> _newNamedUIElements;
/// <summary>
/// Gets collection of <see cref="UIElement" /> instances associated with name provided in <see cref="NotifyBindingsChangedEventArgs.UIElementName" /> property
/// after the modification event
///
/// Provided only when <see cref="NotifyBindingsChangedEventArgs.Action" /> is equal to <see cref="NotifyBindingsChangedAction.NamedInstanceModified" />
/// </summary>
public ICollection<UIElement> NewNamedUIElements
{
get {
@ -75,23 +133,35 @@ namespace ICSharpCode.Core.Presentation @@ -75,23 +133,35 @@ namespace ICSharpCode.Core.Presentation
}
}
private ICollection<UIElement> _attachedInstances;
public ICollection<UIElement> AttachedInstances
/// <summary>
/// Gets collection of collection of modified <see cref="BindingInfoGroup" />
///
/// Provided only when <see cref="NotifyBindingsChangedEventArgs.Action" /> is equal to <see cref="NotifyBindingsChangedAction.GroupAttachmendsModified" />
/// </summary>
public BindingGroupCollection ModifiedGroups
{
get {
return _attachedInstances;
return _modifiedGroups;
}
}
private BindingGroupCollection _groups;
public BindingGroupCollection Groups
/// <summary>
/// Gets collection of instances whose <see cref="UIElement.CommandBindings" />
/// and <see cref="UIElement.InputBindings" /> collections are controled by
/// groups provided in <see cref="NotifyBindingsChangedEventArgs.ModifiedGroups" /> property
///
/// Provided only when <see cref="NotifyBindingsChangedEventArgs.Action" /> is equal to <see cref="NotifyBindingsChangedAction.GroupAttachmendsModified" />
/// </summary>
public ICollection<UIElement> GroupHandledInstances
{
get {
return _groups;
return _attachedInstances;
}
}
private NotifyBindingsChangedAction _action;
/// <summary>
/// Gets action that caused an event
/// </summary>
public NotifyBindingsChangedAction Action
{
get {
@ -99,6 +169,11 @@ namespace ICSharpCode.Core.Presentation @@ -99,6 +169,11 @@ namespace ICSharpCode.Core.Presentation
}
}
/// <summary>
/// Initializes new instance of <see cref="NotifyBindingsChangedEventArgs" /> that describes
/// <see cref="NotifyBindingsChangedAction.EnforceUpdates" /> event
/// </summary>
/// <param name="action">The action that caused this event. This can only be set to <see cref="NotifyBindingsChangedAction.EnforceUpdates" /></param>
public NotifyBindingsChangedEventArgs(NotifyBindingsChangedAction action)
{
if(action != NotifyBindingsChangedAction.EnforceUpdates) {
@ -113,6 +188,14 @@ namespace ICSharpCode.Core.Presentation @@ -113,6 +188,14 @@ namespace ICSharpCode.Core.Presentation
_action = action;
}
/// <summary>
/// Initializes new instance of <see cref="NotifyBindingsChangedEventArgs" /> that describes
/// <see cref="NotifyBindingsChangedAction.NamedTypeModified" /> event
/// </summary>
/// <param name="action">The action that caused this event. This can only be set to <see cref="NotifyBindingsChangedAction.NamedTypeModified" /></param>
/// <param name="elementName">Registered <see cref="Type" /> name (Can be different from <see cref="System.Type.Name")</param>
/// <param name="oldElements">Collection of <see cref="Type" />s associated with provided name before modification</param>
/// <param name="newElements">Collection of <see cref="Type" />s associated with provided name after modification</param>
public NotifyBindingsChangedEventArgs(NotifyBindingsChangedAction action, string typeName, ICollection<Type> oldTypes, ICollection<Type> newTypes)
{
if(action != NotifyBindingsChangedAction.NamedTypeModified) {
@ -154,6 +237,16 @@ namespace ICSharpCode.Core.Presentation @@ -154,6 +237,16 @@ namespace ICSharpCode.Core.Presentation
_newNamedTypes = newTypesArray;
}
/// <summary>
/// Initializes new instance of <see cref="NotifyBindingsChangedEventArgs" /> that describes
/// <see cref="NotifyBindingsChangedAction.NamedInstanceModified" /> event
/// </summary>
/// <param name="action">The action that caused this event. This can only be set to <see cref="NotifyBindingsChangedAction.NamedInstanceModified" /></param>
/// <param name="elementName"><see cref="UIElement" /> instance name</param>
/// <param name="oldElements">Collection of <see cref="UIElement" /> instances associated with provided name before modification</param>
/// <param name="newElements">Collection of <see cref="UIElement" /> instances associated with provided name after modification</param>
public NotifyBindingsChangedEventArgs(NotifyBindingsChangedAction action, string elementName, ICollection<UIElement> oldElements, ICollection<UIElement> newElements)
{
if(action != NotifyBindingsChangedAction.NamedInstanceModified) {
@ -195,6 +288,13 @@ namespace ICSharpCode.Core.Presentation @@ -195,6 +288,13 @@ namespace ICSharpCode.Core.Presentation
_newNamedUIElements = newElementsArray;
}
/// <summary>
/// Initializes new instance of <see cref="NotifyBindingsChangedEventArgs" /> that describes
/// <see cref="NotifyBindingsChangedAction.RoutedUICommandModified" /> event
/// </summary>
/// <param name="action">The action that caused this event. This can only be set to <see cref="NotifyBindingsChangedAction.RoutedUICommandModified" /></param>
/// <param name="routedCommandName">Registered or unregistered <see cref="RoutedUICommand" /> name</param>
public NotifyBindingsChangedEventArgs(NotifyBindingsChangedAction action, string routedCommandName)
{
if(action != NotifyBindingsChangedAction.RoutedUICommandModified) {
@ -214,6 +314,12 @@ namespace ICSharpCode.Core.Presentation @@ -214,6 +314,12 @@ namespace ICSharpCode.Core.Presentation
_routedCommandName = routedCommandName;
}
/// <summary>
/// Initializes new instance of <see cref="NotifyBindingsChangedEventArgs" /> that describes
/// <see cref="NotifyBindingsChangedAction.BindingInfoModified" /> event
/// </summary>
/// <param name="action">The action that caused this event. This can only be set to <see cref="NotifyBindingsChangedAction.BindingInfoModified" /></param>
/// <param name="templates">Collection of <see cref="BindingInfoTemplate" />s describing modified <see cref="CommandBindingInfo" />s or <see cref="InputBindingInfo" />s</param>
public NotifyBindingsChangedEventArgs(NotifyBindingsChangedAction action, IEnumerable<BindingInfoTemplate> templates)
{
if(action != NotifyBindingsChangedAction.BindingInfoModified) {
@ -233,6 +339,14 @@ namespace ICSharpCode.Core.Presentation @@ -233,6 +339,14 @@ namespace ICSharpCode.Core.Presentation
_modifiedBindingInfoTemplates = new HashSet<BindingInfoTemplate>(templates);
}
/// <summary>
/// Initializes new instance of <see cref="NotifyBindingsChangedEventArgs" /> that describes
/// <see cref="NotifyBindingsChangedAction.GroupAttachmendsModified" /> change event
/// </summary>
/// <param name="action">The action that caused this event. This can only be set to <see cref="NotifyBindingsChangedAction.GroupAttachmendsModified" /></param>
/// <param name="groups">Modified groups</param>
/// <param name="attachedInstances">Collection instances (un)registered in <see cref="BindingGroup" /></param>
public NotifyBindingsChangedEventArgs(NotifyBindingsChangedAction action, BindingGroupCollection groups, ICollection<UIElement> attachedInstances)
{
if(action != NotifyBindingsChangedAction.GroupAttachmendsModified) {
@ -253,20 +367,47 @@ namespace ICSharpCode.Core.Presentation @@ -253,20 +367,47 @@ namespace ICSharpCode.Core.Presentation
}
_action = action;
_groups = new BindingGroupCollection();
_groups.AddRange(groups);
_modifiedGroups = new BindingGroupCollection();
_modifiedGroups.AddRange(groups);
_attachedInstances = new HashSet<UIElement>(attachedInstances);
}
}
/// <summary>
/// Describes the action that caused a <see cref="ICSharpCode.Core.Presentation.CommandManager.BindingsChanged" /> event.
/// </summary>
public enum NotifyBindingsChangedAction
{
/// <summary>
/// Implicitly enforce executing all handlers
/// </summary>
EnforceUpdates,
/// <summary>
/// Binding info modified
/// </summary>
BindingInfoModified,
/// <summary>
/// Named instance modfied (new <see cref="UIElement" /> added/removed)
/// </summary>
NamedInstanceModified,
/// <summary>
/// Named type modfied (new <see cref="Type" /> added/removed)
/// </summary>
NamedTypeModified,
/// <summary>
/// <see cref="RoutedUICommand" /> registered/unregistered
/// </summary>
RoutedUICommandModified,
/// <summary>
/// Groups modified (group attached/detached to binding info or new <see cref="UIElement" />
/// is registered to be handled by <see cref="BindingGroup" />
/// </summary>
GroupAttachmendsModified
}
}

70
src/Main/ICSharpCode.Core.Presentation/CommandsService/Events/NotifyGesturesChangedEvent.cs

@ -4,11 +4,24 @@ using System.Windows.Input; @@ -4,11 +4,24 @@ using System.Windows.Input;
namespace ICSharpCode.Core.Presentation
{
/// <summary>
/// Represent a method that will handle <see cref="ICSharpCode.Core.Presentation.CommandManager.GesturesChanged" />
/// or <see cref="ICSharpCode.Core.Presentation.UserGestureProfile.GesturesChanged" /> event
/// </summary>
public delegate void NotifyGesturesChangedEventHandler(object sender, NotifyGesturesChangedEventArgs args);
/// <summary>
/// Provides data for <see cref="ICSharpCode.Core.Presentation.CommandManager.GesturesChanged" />
/// or <see cref="ICSharpCode.Core.Presentation.UserGestureProfile.GesturesChanged" /> event
/// </summary>
public class NotifyGesturesChangedEventArgs : EventArgs
{
private bool _enforceUpdates;
private List<GesturesModificationDescription> _modificationDescriptions = new List<GesturesModificationDescription>();
/// <summary>
/// When this property is set to <code>true</code> all handlers code should be executed
/// </summary>
public bool EnforceUpdates
{
get {
@ -16,8 +29,9 @@ namespace ICSharpCode.Core.Presentation @@ -16,8 +29,9 @@ namespace ICSharpCode.Core.Presentation
}
}
List<GesturesModificationDescription> _modificationDescriptions = new List<GesturesModificationDescription>();
/// <summary>
/// Gets list of modification descriptions
/// </summary>
public ICollection<GesturesModificationDescription> ModificationDescriptions
{
get
@ -26,11 +40,19 @@ namespace ICSharpCode.Core.Presentation @@ -26,11 +40,19 @@ namespace ICSharpCode.Core.Presentation
}
}
/// <summary>
/// Initializes new instance of <see cref="NotifyGesturesChangedEventArgs" /> that describes
/// <see cref="NotifyGesturesChangedEventArgs.EnforceUpdates" /> event
/// </summary>
public NotifyGesturesChangedEventArgs()
{
_enforceUpdates = true;
}
/// <summary>
/// Initializes new instance of <see cref="NotifyGesturesChangedEventArgs" /> containing a collection modification descriptions
/// </summary>
/// <param name="descriptions">Collection of modification descriptions</param>
public NotifyGesturesChangedEventArgs(IEnumerable<GesturesModificationDescription> descriptions)
{
if(descriptions == null) {
@ -40,6 +62,10 @@ namespace ICSharpCode.Core.Presentation @@ -40,6 +62,10 @@ namespace ICSharpCode.Core.Presentation
_modificationDescriptions.AddRange(descriptions);
}
/// <summary>
/// Initializes new instance of <see cref="NotifyGesturesChangedEventArgs" /> containing one modification description
/// </summary>
/// <param name="descriptions">Modification description</param>
public NotifyGesturesChangedEventArgs(GesturesModificationDescription description)
{
if(description == null) {
@ -50,28 +76,56 @@ namespace ICSharpCode.Core.Presentation @@ -50,28 +76,56 @@ namespace ICSharpCode.Core.Presentation
}
}
/// <summary>
/// Class describing single gestures modification in <see cref="InputBindingInfo" /> instance
/// </summary>
public class GesturesModificationDescription
{
private BindingInfoTemplate _inputBindingIdentifier;
private InputGestureCollection _oldGestures;
private InputGestureCollection _newGestures;
/// <summary>
/// Creates new instance of <see cref="GesturesModificationDescription" />
/// </summary>
/// <param name="inputBindingInfoTemplate"><see cref="BindingInfoTemplate" /> which identify modified <see cref="InputBindingInfo" /></param>
/// <param name="oldGestures">Active <see cref="InputGestureCollection" /> before modification</param>
/// <param name="newGestures">Active <see cref="InputGestureCollection" /> after modification</param>
public GesturesModificationDescription(BindingInfoTemplate inputBindingInfoTemplate, InputGestureCollection oldGestures, InputGestureCollection newGestures)
{
InputBindingIdentifier = inputBindingInfoTemplate;
OldGestures = oldGestures;
NewGestures = newGestures;
_inputBindingIdentifier = inputBindingInfoTemplate;
_oldGestures = oldGestures;
_newGestures = newGestures;
}
/// <summary>
/// <see cref="BindingInfoTemplate" /> which identifies modified <see cref="InputBindingInfo" />
/// </summary>
public BindingInfoTemplate InputBindingIdentifier
{
get; private set;
get {
return _inputBindingIdentifier;
}
}
/// <summary>
/// Active <see cref="InputGestureCollection" /> before modification
/// </summary>
public InputGestureCollection OldGestures
{
get; private set;
get {
return _oldGestures;
}
}
/// <summary>
/// Active <see cref="InputGestureCollection" /> after modification
/// </summary>
public InputGestureCollection NewGestures
{
get; private set;
get {
return _newGestures;
}
}
}
}

24
src/Main/ICSharpCode.Core.Presentation/CommandsService/Events/NotifyUserGestureProfileChangedEvent.cs

@ -2,9 +2,22 @@ using System; @@ -2,9 +2,22 @@ using System;
namespace ICSharpCode.Core.Presentation
{
/// <summary>
/// Represent a method that will handle <see cref="ICSharpCode.Core.Presentation.UserGestureManager.CurrentProfileChanged" /> event
/// </summary>
public delegate void NotifyUserGestureProfileChangedEventHandler(object sender, NotifyUserGestureProfileChangedEventArgs args);
/// <summary>
/// Provides data for <see cref="ICSharpCode.Core.Presentation.UserGestureManager.CurrentProfileChanged" /> event
/// </summary>
public class NotifyUserGestureProfileChangedEventArgs : EventArgs
{
private UserGestureProfile _newProfile;
private UserGestureProfile _oldProfile;
/// <summary>
/// Gets current <see cref="UserGestureProfile" /> before modification
/// </summary>
public UserGestureProfile OldProfile
{
get {
@ -12,7 +25,9 @@ namespace ICSharpCode.Core.Presentation @@ -12,7 +25,9 @@ namespace ICSharpCode.Core.Presentation
}
}
private UserGestureProfile _newProfile;
/// <summary>
/// Gets current <see cref="UserGestureProfile" /> after modification
/// </summary>
public UserGestureProfile NewProfile
{
get {
@ -20,12 +35,15 @@ namespace ICSharpCode.Core.Presentation @@ -20,12 +35,15 @@ namespace ICSharpCode.Core.Presentation
}
}
/// <summary>
/// Create new instance of <see cref="NotifyUserGestureProfileChangedEventArgs" />
/// </summary>
/// <param name="oldProfile">Current <see cref="UserGestureProfile" /> before modification</param>
/// <param name="newProfile">Current <see cref="UserGestureProfile" /> after modification</param>
public NotifyUserGestureProfileChangedEventArgs(UserGestureProfile oldProfile, UserGestureProfile newProfile)
{
_oldProfile = oldProfile;
_newProfile = newProfile;
}
}
public delegate void NotifyUserGestureProfileChangedEventHandler(object sender, NotifyUserGestureProfileChangedEventArgs args);
}

6
src/Main/ICSharpCode.Core.Presentation/CommandsService/InputBindingInfo.cs

@ -16,10 +16,10 @@ namespace ICSharpCode.Core.Presentation @@ -16,10 +16,10 @@ namespace ICSharpCode.Core.Presentation
/// </summary>
public class InputBindingInfo : BindingInfoBase
{
InputBindingCollection oldBindingCollection = new InputBindingCollection();
private InputBindingCollection oldBindingCollection = new InputBindingCollection();
private List<UIElement> oldInstances;
List<Type> oldTypes;
InputBindingCategoryCollection _categories;
private List<Type> oldTypes;
private InputBindingCategoryCollection _categories;
private ObservableInputGestureCollection _defaultGestures;

2
src/Main/ICSharpCode.Core.Presentation/CommandsService/Profile/UserGestureManager.cs

@ -5,7 +5,7 @@ using System.Windows.Input; @@ -5,7 +5,7 @@ using System.Windows.Input;
using System.IO;
using SDCommandManager=ICSharpCode.Core.Presentation.CommandManager;
namespace ICSharpCode.Core.Presentation
namespace ICSharpCode.Core.Presentation
{
/// <summary>
/// Manages user defined gestures

12
src/Main/ICSharpCode.Core.Presentation/Test/BindingGroupTests.cs

@ -43,8 +43,8 @@ namespace ICSharpCode.Core.Presentation.Tests @@ -43,8 +43,8 @@ namespace ICSharpCode.Core.Presentation.Tests
SDCommandManager.BindingsChanged += delegate(object sender, NotifyBindingsChangedEventArgs args) {
if(args.Action == NotifyBindingsChangedAction.GroupAttachmendsModified
&& args.AttachedInstances.Contains(uiElement)
&& args.Groups.Contains(bindingGroup)) {
&& args.GroupHandledInstances.Contains(uiElement)
&& args.ModifiedGroups.Contains(bindingGroup)) {
result = true;
}
};
@ -70,8 +70,8 @@ namespace ICSharpCode.Core.Presentation.Tests @@ -70,8 +70,8 @@ namespace ICSharpCode.Core.Presentation.Tests
SDCommandManager.BindingsChanged += delegate(object sender, NotifyBindingsChangedEventArgs args) {
if(args.Action == NotifyBindingsChangedAction.GroupAttachmendsModified
&& args.AttachedInstances.Contains(uiElement)
&& args.Groups.Contains(bindingGroup)) {
&& args.GroupHandledInstances.Contains(uiElement)
&& args.ModifiedGroups.Contains(bindingGroup)) {
result = true;
}
};
@ -100,8 +100,8 @@ namespace ICSharpCode.Core.Presentation.Tests @@ -100,8 +100,8 @@ namespace ICSharpCode.Core.Presentation.Tests
SDCommandManager.BindingsChanged += delegate(object sender, NotifyBindingsChangedEventArgs args) {
if(args.Action == NotifyBindingsChangedAction.GroupAttachmendsModified
&& args.AttachedInstances.Contains(uiElement)
&& args.Groups.Contains(bindingGroup)) {
&& args.GroupHandledInstances.Contains(uiElement)
&& args.ModifiedGroups.Contains(bindingGroup)) {
result = true;
}
};

4
src/Main/ICSharpCode.Core.Presentation/Test/CommandManagerTests.cs

@ -204,11 +204,11 @@ namespace ICSharpCode.Core.Presentation.Tests @@ -204,11 +204,11 @@ namespace ICSharpCode.Core.Presentation.Tests
};
CommandManager.BindingsChanged += delegate(object sender, NotifyBindingsChangedEventArgs args) {
if(args.Action == NotifyBindingsChangedAction.GroupAttachmendsModified && args.Groups.Contains(addedGroup)) {
if(args.Action == NotifyBindingsChangedAction.GroupAttachmendsModified && args.ModifiedGroups.Contains(addedGroup)) {
testResults.Add("GroupAdded");
}
if(args.Action == NotifyBindingsChangedAction.GroupAttachmendsModified && args.Groups.Contains(removedGroup)) {
if(args.Action == NotifyBindingsChangedAction.GroupAttachmendsModified && args.ModifiedGroups.Contains(removedGroup)) {
testResults.Add("GroupRemoved");
}
};

Loading…
Cancel
Save