Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/shortcuts@4651 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts^2
22 changed files with 462 additions and 675 deletions
@ -1,99 +0,0 @@ |
|||||||
using System; |
|
||||||
|
|
||||||
namespace ICSharpCode.Core |
|
||||||
{ |
|
||||||
/// <summary>
|
|
||||||
/// Stores information about command binding loaded from add-in tree
|
|
||||||
/// </summary>
|
|
||||||
public class CommandBindingDescriptor |
|
||||||
{ |
|
||||||
/// <summary>
|
|
||||||
/// Codon used to create this descriptor
|
|
||||||
/// </summary>
|
|
||||||
public Codon Codon { |
|
||||||
get; private set; |
|
||||||
} |
|
||||||
|
|
||||||
public string Name { |
|
||||||
get; private set; |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Full name of the command class which will be executed when this
|
|
||||||
/// binding is triggered
|
|
||||||
/// </summary>
|
|
||||||
public string Class { |
|
||||||
get; private set; |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Full name of routed UI command which will trigger this binding
|
|
||||||
///
|
|
||||||
/// If command with provided name is not yet registered it's created automatically
|
|
||||||
/// </summary>
|
|
||||||
public string Command { |
|
||||||
get; private set; |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Override routed command text (string visible to user) if specified
|
|
||||||
/// </summary>
|
|
||||||
public string CommandText { |
|
||||||
get; private set; |
|
||||||
} |
|
||||||
|
|
||||||
public string OwnerInstanceName { |
|
||||||
get; private set; |
|
||||||
} |
|
||||||
|
|
||||||
public string OwnerTypeName { |
|
||||||
get; private set; |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gestures.
|
|
||||||
///
|
|
||||||
/// Optional, if provided input bindings in the same context will be created
|
|
||||||
/// </summary>
|
|
||||||
public string Gestures { |
|
||||||
get; private set; |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// If input binding is created in the same context (this is done by setting <see cref="Gestures" /> property)
|
|
||||||
/// assign this input binding to provided category
|
|
||||||
/// </summary>
|
|
||||||
public string Categories { |
|
||||||
get; private set; |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Lazy loading
|
|
||||||
///
|
|
||||||
/// If true add-in referenced assemblies are loaded when command is invoked.
|
|
||||||
/// Otherwise command can't be invoked until addin is loaded
|
|
||||||
/// </summary>
|
|
||||||
public bool Lazy { |
|
||||||
get { |
|
||||||
return Codon.Properties["lazy"] == "1" || Codon.Properties["lazy"] == "true"; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Constructor
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="codon">Reference to codon used to create this descriptor</param>
|
|
||||||
public CommandBindingDescriptor(Codon codon) |
|
||||||
{ |
|
||||||
Codon = codon; |
|
||||||
Class = Codon.Properties["class"]; |
|
||||||
Command = Codon.Properties["command"]; |
|
||||||
CommandText = Codon.Properties["commandtext"]; |
|
||||||
OwnerInstanceName = Codon.Properties["owner-instance"]; |
|
||||||
OwnerTypeName = Codon.Properties["owner-type"]; |
|
||||||
Gestures = Codon.Properties["gestures"]; |
|
||||||
Categories = Codon.Properties["categories"]; |
|
||||||
Name = Codon.Properties["name"]; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
@ -1,52 +0,0 @@ |
|||||||
using System; |
|
||||||
|
|
||||||
namespace ICSharpCode.Core |
|
||||||
{ |
|
||||||
/// <attribute name="command" use="required">
|
|
||||||
/// Name of routed UI command which triggers this binding.
|
|
||||||
///
|
|
||||||
/// Routed UI command details are specified in path '/SharpDevelop/Workbench/RoutedUICommands'
|
|
||||||
/// </attribute>
|
|
||||||
/// <attribute name="class" use="required">
|
|
||||||
/// Class implementing System.Window.Input.ICommand or
|
|
||||||
/// ICSharpCode.Core class. CanExecute and Executed methods
|
|
||||||
/// are used to handle raised event
|
|
||||||
/// </attribute>
|
|
||||||
/// <attribute name="context" use="optional">
|
|
||||||
/// Specified binding owner
|
|
||||||
///
|
|
||||||
/// If context is not specified binding is applied to default context
|
|
||||||
/// </attribute>
|
|
||||||
/// <attribute name="lazy" use="optional" enum="1;0;true;false">
|
|
||||||
/// Use lazy loading. If addin containing binded command is
|
|
||||||
/// not loaded yet, load asseblies referenced in add-in and then
|
|
||||||
/// invoke command
|
|
||||||
/// </attribute>
|
|
||||||
/// <attribute name="gestures" use="optional">
|
|
||||||
/// Create input bindings in the same context which will trigger specified routed UI command
|
|
||||||
/// </attribute>
|
|
||||||
/// <usage>Only in /SharpDevelop/Workbench/CommandBindings</usage>
|
|
||||||
/// <returns>
|
|
||||||
/// CommandBindingDescriptor object
|
|
||||||
/// </returns>
|
|
||||||
/// <summary>
|
|
||||||
/// Creates descriptor containing information about command binding
|
|
||||||
/// </summary>
|
|
||||||
public class CommandBindingDoozer : IDoozer |
|
||||||
{ |
|
||||||
/// <see cref="IDoozer.HandleConditions" />
|
|
||||||
public bool HandleConditions { |
|
||||||
get { |
|
||||||
return false; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
/// <see cref="IDoozer.BuildItem(object, Codon, System.Collections.ArrayList)">
|
|
||||||
/// Builds CommandBindingDescriptor
|
|
||||||
/// </see>
|
|
||||||
public object BuildItem(object caller, Codon codon, System.Collections.ArrayList subItems) |
|
||||||
{ |
|
||||||
return new CommandBindingDescriptor(codon); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
@ -0,0 +1,117 @@ |
|||||||
|
using System; |
||||||
|
|
||||||
|
namespace ICSharpCode.Core |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Describes <see cref="ICSharpCode.Core.Presentation.CommandBindingInfo" />
|
||||||
|
/// </summary>
|
||||||
|
public class CommandBindingInfoDescriptor |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Gets codon used to create this descriptor
|
||||||
|
/// </summary>
|
||||||
|
public Codon Codon |
||||||
|
{ |
||||||
|
get; private set; |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets full name of the command class containing user instructions
|
||||||
|
///
|
||||||
|
/// The class must implement <see cref="System.Windows.Input.ICommand" /> or <see cref="ICSharpCode.Core.ICommand" />
|
||||||
|
/// classes
|
||||||
|
/// </summary>
|
||||||
|
public string Class |
||||||
|
{ |
||||||
|
get; private set; |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets name of <see cref="System.Window.Input.RoutedUICommand" /> associated with descriptor
|
||||||
|
/// The name should be associated to a command in code using <see cref="ICSharpCode.Core.Presentation.CommandManager" />
|
||||||
|
/// </summary>
|
||||||
|
public string Command |
||||||
|
{ |
||||||
|
get; private set; |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets overriden routed command text (string visible to user)
|
||||||
|
///
|
||||||
|
/// If not provided <see cref="System.Window.Input.RoutedUICommand.Text" /> property value is used
|
||||||
|
/// </summary>
|
||||||
|
public string CommandText |
||||||
|
{ |
||||||
|
get; private set; |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets name of binding owner type name.
|
||||||
|
///
|
||||||
|
/// A name can be assigned to type in code using <see cref="ICSharpCode.Core.Presentation.CommandManager" />.
|
||||||
|
/// If this property is set then <see cref="OwnerTypeName" /> property can be ignored
|
||||||
|
/// If neither owner type nor owner instance is specified default owner type is applied
|
||||||
|
/// </summary>
|
||||||
|
public string OwnerInstanceName |
||||||
|
{ |
||||||
|
get; private set; |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Name of binding owner instance name.
|
||||||
|
///
|
||||||
|
/// A name can be assigned to instance in code using <see cref="ICSharpCode.Core.Presentation.CommandManager" />.
|
||||||
|
/// If this property is set then <see cref="OwnerInstanceName" /> property can be ignored
|
||||||
|
/// If neither owner type nor owner instance is specified default owner type is applied
|
||||||
|
/// </summary>
|
||||||
|
public string OwnerTypeName { |
||||||
|
get; private set; |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets gestures associated with created <see cref="ICSharpCode.Core.Presentation.InputBindingInfo" />
|
||||||
|
///
|
||||||
|
/// Optional, if provided input binding info with the same owner will be created
|
||||||
|
/// </summary>
|
||||||
|
public string Gestures { |
||||||
|
get; private set; |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets list of paths to input binding categories associated with created <see cref="ICSharpCode.Core.Presentation.InputBindingInfo" /> (separated by comma)
|
||||||
|
///
|
||||||
|
/// Can only be used together with <see cref="Gestures" /> property
|
||||||
|
/// </summary>
|
||||||
|
public string Categories { |
||||||
|
get; private set; |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Lazy loading
|
||||||
|
///
|
||||||
|
/// If true add-in referenced assemblies are loaded when command is invoked.
|
||||||
|
/// Otherwise command can't be invoked until addin is loaded
|
||||||
|
/// </summary>
|
||||||
|
public bool Lazy { |
||||||
|
get { |
||||||
|
return Codon.Properties["lazy"] == "1" || Codon.Properties["lazy"] == "true"; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates new instance of <see cref="CommandBindingInfoDescriptor" />
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="codon">Reference to codon used to create this descriptor</param>
|
||||||
|
public CommandBindingInfoDescriptor(Codon codon) |
||||||
|
{ |
||||||
|
Codon = codon; |
||||||
|
Class = Codon.Properties["class"]; |
||||||
|
Command = Codon.Properties["command"]; |
||||||
|
CommandText = Codon.Properties["commandtext"]; |
||||||
|
OwnerInstanceName = Codon.Properties["ownerinstance"]; |
||||||
|
OwnerTypeName = Codon.Properties["ownertype"]; |
||||||
|
Gestures = Codon.Properties["gestures"]; |
||||||
|
Categories = Codon.Properties["categories"]; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,76 @@ |
|||||||
|
using System; |
||||||
|
|
||||||
|
namespace ICSharpCode.Core |
||||||
|
{ |
||||||
|
/// <attribute name="command" use="required">
|
||||||
|
/// Name of System.Window.Input.RoutedUICommand associated with built CommandBindingInfoDescriptor
|
||||||
|
/// The name should be first registered in code using ICSharpCode.Core.Presentation.CommandManager
|
||||||
|
/// or in addin file using RoutedUICommand node
|
||||||
|
/// </attribute>
|
||||||
|
/// <attribute name="class" use="required">
|
||||||
|
/// Command class performing some action
|
||||||
|
/// The class should implement System.Window.Input.ICommand or ICSharpCode.Core.ICommand class.
|
||||||
|
/// </attribute>
|
||||||
|
/// <attribute name="ownertype" use="optional">
|
||||||
|
/// Name of binding owner type.
|
||||||
|
///
|
||||||
|
/// A name can be assigned to type in code using ICSharpCode.Core.Presentation.CommandManager.
|
||||||
|
/// If this attribute is used "ownerinstance" attribute cannot be used
|
||||||
|
/// If neither owner type nor owner instance is specified default owner type is applied
|
||||||
|
/// </attribute>
|
||||||
|
/// <attribute name="ownertype" use="optional">
|
||||||
|
/// Name of binding owner instance.
|
||||||
|
///
|
||||||
|
/// A name can be assigned to instance in code using ICSharpCode.Core.Presentation.CommandManager.
|
||||||
|
/// If this attribute is used "ownertype" attribute cannot be used
|
||||||
|
/// If neither owner type nor owner instance is specified default owner type is applied
|
||||||
|
/// </attribute>
|
||||||
|
/// <attribute name="lazy" use="optional" enum="1;0;true;false">
|
||||||
|
/// Use lazy loading.
|
||||||
|
/// </attribute>
|
||||||
|
/// <attribute name="gestures" use="optional">
|
||||||
|
/// Create input bindings assigned to the same owner type or owner instance and associated
|
||||||
|
/// with the same System.Window.Input.RoutedUICommand
|
||||||
|
/// </attribute>
|
||||||
|
/// <attribute name="commandtext" use="optional">
|
||||||
|
/// Text displayed to user when managing input bindings (shortcuts)
|
||||||
|
///
|
||||||
|
/// If this attribute is not used System.Window.Input.RoutedUICommand.Text property is used
|
||||||
|
/// This attribute can only be used together with "gestures" attribute
|
||||||
|
/// </attribute>
|
||||||
|
/// <attribute name="categories" use="optional">
|
||||||
|
/// List of paths to input binding categories associated with created input binding info (separated by comma)
|
||||||
|
///
|
||||||
|
/// Input binding categories can be created in code using ICSharpCode.Core.Presentation.CommandManager or by using InputBindingCategory node in addin file
|
||||||
|
/// Input binding categories are used to group shortcuts into separate sections when displaying to user.
|
||||||
|
/// This attribute can only be used together with "gestures" attribute
|
||||||
|
/// </attribute>
|
||||||
|
/// <usage>Only in /SharpDevelop/Workbench/CommandBindings</usage>
|
||||||
|
/// <returns>
|
||||||
|
/// CommandBindingInfoDescriptor object
|
||||||
|
/// </returns>
|
||||||
|
/// <summary>
|
||||||
|
/// Creates descriptor containing data describing ICSharpCode.Core.Presentation.CommandBindingInfo
|
||||||
|
/// </summary>
|
||||||
|
public class CommandBindingInfoDoozer : IDoozer |
||||||
|
{ |
||||||
|
/// <inheritdoc />
|
||||||
|
public bool HandleConditions { |
||||||
|
get { |
||||||
|
return false; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Builds instance of <see cref="CommandBindingInfoDescriptor" /> from codon
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="caller">Caller object</param>
|
||||||
|
/// <param name="codon">Codon</param>
|
||||||
|
/// <param name="subItems">Codon sub-items</param>
|
||||||
|
/// <returns>Instance of <see cref="CommandBindingInfoDescriptor" /></returns>
|
||||||
|
public object BuildItem(object caller, Codon codon, System.Collections.ArrayList subItems) |
||||||
|
{ |
||||||
|
return new CommandBindingInfoDescriptor(codon); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -1,26 +0,0 @@ |
|||||||
using System; |
|
||||||
|
|
||||||
namespace ICSharpCode.Core |
|
||||||
{ |
|
||||||
public class GesturesPlaceHolderDescriptor |
|
||||||
{ |
|
||||||
public string Name { |
|
||||||
get; private set; |
|
||||||
} |
|
||||||
|
|
||||||
public string Text { |
|
||||||
get; private set; |
|
||||||
} |
|
||||||
|
|
||||||
public string Gestures { |
|
||||||
get; private set; |
|
||||||
} |
|
||||||
|
|
||||||
public GesturesPlaceHolderDescriptor(Codon codon) |
|
||||||
{ |
|
||||||
Name = codon.Properties["name"]; |
|
||||||
Text = codon.Properties["text"]; |
|
||||||
Gestures = codon.Properties["gestures"]; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
@ -1,43 +0,0 @@ |
|||||||
using System; |
|
||||||
|
|
||||||
namespace ICSharpCode.Core |
|
||||||
{ |
|
||||||
/// <attribute name="name" use="required">
|
|
||||||
/// Place holder name. This name should be unique application wide
|
|
||||||
/// </attribute>
|
|
||||||
/// <attribute name="text" use="required">
|
|
||||||
/// Text displayed to use
|
|
||||||
/// </attribute>
|
|
||||||
/// <attribute name="lazy" use="optional" enum="1;0;true;false">
|
|
||||||
/// Use lazy loading. If addin containing binded command is
|
|
||||||
/// not loaded yet, load asseblies referenced in add-in and then
|
|
||||||
/// invoke command
|
|
||||||
/// </attribute>
|
|
||||||
/// <attribute name="gestures" use="optional">
|
|
||||||
/// Keys which will invoke command
|
|
||||||
/// </attribute>
|
|
||||||
/// <usage>Only in /SharpDevelop/Workbench/CommandBindings</usage>
|
|
||||||
/// <returns>
|
|
||||||
/// GesturesPlaceHolder object
|
|
||||||
/// </returns>
|
|
||||||
/// <summary>
|
|
||||||
/// Creates descriptor containing information about command binding
|
|
||||||
/// </summary>
|
|
||||||
public class GesturesPlaceHolderDoozer : IDoozer |
|
||||||
{ |
|
||||||
/// <see cref="IDoozer.HandleConditions" />
|
|
||||||
public bool HandleConditions { |
|
||||||
get { |
|
||||||
return false; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
/// <see cref="IDoozer.BuildItem(object, Codon, System.Collections.ArrayList)">
|
|
||||||
/// Builds GesturesPlaceHolderDoozer
|
|
||||||
/// </see>
|
|
||||||
public object BuildItem(object caller, Codon codon, System.Collections.ArrayList subItems) |
|
||||||
{ |
|
||||||
return new GesturesPlaceHolderDescriptor(codon); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
@ -0,0 +1,47 @@ |
|||||||
|
using System; |
||||||
|
using System.Linq; |
||||||
|
using System.Collections.Generic; |
||||||
|
|
||||||
|
namespace ICSharpCode.Core |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Describes <see cref="ICSharpCode.Core.Presentation.CommandBindingInfo" />
|
||||||
|
/// </summary>
|
||||||
|
public class InputBindingCategoryDescriptor |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Gets category Id used to create category path
|
||||||
|
/// </summary>
|
||||||
|
public string Id |
||||||
|
{ |
||||||
|
get; private set; |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets category name displayed to user
|
||||||
|
/// </summary>
|
||||||
|
public string Text |
||||||
|
{ |
||||||
|
get; private set; |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets children category descriptors
|
||||||
|
/// </summary>
|
||||||
|
public List<InputBindingCategoryDescriptor> Children |
||||||
|
{ |
||||||
|
get; private set; |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates instance of <see cref="InputBindingCategoryDescriptor" />
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="codon">Reference to codon used to create this descriptor</param>
|
||||||
|
/// <param name="subItems">List of sub-category descriptors</param>
|
||||||
|
public InputBindingCategoryDescriptor(Codon codon, System.Collections.ArrayList subItems) { |
||||||
|
Id = codon.Properties["id"]; |
||||||
|
Text = codon.Properties["text"]; |
||||||
|
Children = subItems != null ? subItems.Cast<InputBindingCategoryDescriptor>().ToList() : new List<InputBindingCategoryDescriptor>(); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -1,48 +1,43 @@ |
|||||||
/* |
|
||||||
* Created by SharpDevelop. |
|
||||||
* User: Administrator |
|
||||||
* Date: 7/3/2009 |
|
||||||
* Time: 4:50 PM |
|
||||||
* |
|
||||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
|
||||||
*/ |
|
||||||
using System; |
using System; |
||||||
using System.Collections.Generic; |
using System.Collections.Generic; |
||||||
using System.Linq; |
using System.Linq; |
||||||
|
|
||||||
namespace ICSharpCode.Core |
namespace ICSharpCode.Core |
||||||
{ |
{ |
||||||
|
/// <attribute name="id" use="required">
|
||||||
|
/// Category Id used in category path
|
||||||
|
/// </attribute>
|
||||||
|
/// <attribute name="name" use="required">
|
||||||
|
/// Category name displayed to user
|
||||||
|
/// </attribute>
|
||||||
|
/// <usage>Only in /SharpDevelop/CommandManager/InputBindingCategories</usage>
|
||||||
|
/// <returns>
|
||||||
|
/// InputBindingCategory object
|
||||||
|
/// </returns>
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Description of InputBindingInfoCategory.
|
/// Creates descriptor containing data describing ICSharpCode.Core.Presentation.InputBindingCategory
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class InputBindingCategoryDoozer : IDoozer |
public class InputBindingCategoryDoozer : IDoozer |
||||||
{ |
{ |
||||||
/// <see cref="IDoozer.HandleConditions" />
|
/// <inheritdoc />
|
||||||
public bool HandleConditions { |
public bool HandleConditions { |
||||||
get { |
get { |
||||||
return true; |
return true; |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
/// <see cref="IDoozer.BuildItem(object, Codon, System.Collections.ArrayList)">
|
/// <summary>
|
||||||
/// Builds InputBindingDescriptor
|
/// Builds instance of <see cref="InputBindingCategoryDescriptor" /> from codon
|
||||||
/// </see>
|
/// </summary>
|
||||||
|
/// <param name="caller">Caller object</param>
|
||||||
|
/// <param name="codon">Codon</param>
|
||||||
|
/// <param name="subItems">Codon sub-items</param>
|
||||||
|
/// <returns>Instance of <see cref="InputBindingCategoryDescriptor" /></returns>
|
||||||
public object BuildItem(object caller, Codon codon, System.Collections.ArrayList subItems) |
public object BuildItem(object caller, Codon codon, System.Collections.ArrayList subItems) |
||||||
{ |
{ |
||||||
return new InputBindingCategoryDescriptor(codon, subItems); |
return new InputBindingCategoryDescriptor(codon, subItems); |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
public class InputBindingCategoryDescriptor |
|
||||||
{ |
|
||||||
public string Id; |
|
||||||
public string Text; |
|
||||||
public List<InputBindingCategoryDescriptor> Children; |
|
||||||
|
|
||||||
public InputBindingCategoryDescriptor(Codon codon, System.Collections.ArrayList subItems) { |
|
||||||
Id = codon.Properties["id"]; |
|
||||||
Text = codon.Properties["text"]; |
|
||||||
Children = subItems != null ? subItems.Cast<InputBindingCategoryDescriptor>().ToList() : new List<InputBindingCategoryDescriptor>(); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
} |
||||||
|
@ -1,73 +0,0 @@ |
|||||||
using System; |
|
||||||
|
|
||||||
namespace ICSharpCode.Core |
|
||||||
{ |
|
||||||
/// <summary>
|
|
||||||
/// Stores information about input binding loaded from add-in tree
|
|
||||||
/// </summary>
|
|
||||||
public class InputBindingDescriptor |
|
||||||
{ |
|
||||||
/// <summary>
|
|
||||||
/// Codon used to create this descriptor
|
|
||||||
/// </summary>
|
|
||||||
public Codon Codon { |
|
||||||
get; private set; |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Full name of routed UI command which will be invoked when this binding is triggered
|
|
||||||
/// </summary>
|
|
||||||
public string Command { |
|
||||||
get; private set; |
|
||||||
} |
|
||||||
|
|
||||||
public string Name { |
|
||||||
get; private set; |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Override routed command text (string visible to user) if specified
|
|
||||||
/// </summary>
|
|
||||||
public string CommandText { |
|
||||||
get; private set; |
|
||||||
} |
|
||||||
|
|
||||||
public string OwnerInstanceName { |
|
||||||
get; private set; |
|
||||||
} |
|
||||||
|
|
||||||
public string OwnerTypeName { |
|
||||||
get; private set; |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Description of gesture which will trigger this binding
|
|
||||||
/// </summary>
|
|
||||||
public string Gestures { |
|
||||||
get; private set; |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Category to which this binding belongs
|
|
||||||
/// </summary>
|
|
||||||
public string Categories { |
|
||||||
get; private set; |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Constructor
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="codon">Reference to codon used to create this descriptor</param>
|
|
||||||
public InputBindingDescriptor(Codon codon) |
|
||||||
{ |
|
||||||
Codon = codon; |
|
||||||
Command = codon.Properties["command"]; |
|
||||||
CommandText = codon.Properties["commandtext"]; |
|
||||||
OwnerInstanceName = codon.Properties["owner-instance"]; |
|
||||||
OwnerTypeName = codon.Properties["owner-type"]; |
|
||||||
Gestures = codon.Properties["gestures"]; |
|
||||||
Categories = codon.Properties["categories"]; |
|
||||||
Name = codon.Properties["name"]; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
@ -1,35 +0,0 @@ |
|||||||
using System; |
|
||||||
|
|
||||||
namespace ICSharpCode.Core |
|
||||||
{ |
|
||||||
/// <attribute name="command" use="required">
|
|
||||||
/// Name of routed UI command which is triggered by this binding
|
|
||||||
/// </attribute>
|
|
||||||
/// <attribute name="gesture" use="required">
|
|
||||||
/// Gesture which triggers this binding
|
|
||||||
/// </attribute>
|
|
||||||
/// <usage>Only in /SharpDevelop/Workbench/InputBindings</usage>
|
|
||||||
/// <returns>
|
|
||||||
/// InputBindingDescriptor object
|
|
||||||
/// </returns>
|
|
||||||
/// <summary>
|
|
||||||
/// Creates descriptor containing information about input binding
|
|
||||||
/// </summary>
|
|
||||||
public class InputBindingDoozer : IDoozer |
|
||||||
{ |
|
||||||
/// <see cref="IDoozer.HandleConditions" />
|
|
||||||
public bool HandleConditions { |
|
||||||
get { |
|
||||||
return true; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
/// <see cref="IDoozer.BuildItem(object, Codon, System.Collections.ArrayList)">
|
|
||||||
/// Builds InputBindingDescriptor
|
|
||||||
/// </see>
|
|
||||||
public object BuildItem(object caller, Codon codon, System.Collections.ArrayList subItems) |
|
||||||
{ |
|
||||||
return new InputBindingDescriptor(codon); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
@ -0,0 +1,87 @@ |
|||||||
|
using System; |
||||||
|
|
||||||
|
namespace ICSharpCode.Core |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Describes <see cref="ICSharpCode.Core.Presentation.InputBindingInfo" />
|
||||||
|
/// </summary>
|
||||||
|
public class InputBindingInfoDescriptor |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Codon used to create this descriptor
|
||||||
|
/// </summary>
|
||||||
|
public Codon Codon { |
||||||
|
get; private set; |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets name of <see cref="System.Window.Input.RoutedUICommand" /> associated with descriptor
|
||||||
|
/// The name should be associated to a command in code using <see cref="ICSharpCode.Core.Presentation.CommandManager" />
|
||||||
|
/// </summary>
|
||||||
|
public string Command { |
||||||
|
get; private set; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets overriden routed command text (string visible to user)
|
||||||
|
///
|
||||||
|
/// If not provided <see cref="System.Window.Input.RoutedUICommand.Text" /> property value is used
|
||||||
|
/// </summary>
|
||||||
|
public string CommandText { |
||||||
|
get; private set; |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets name of binding owner type name.
|
||||||
|
///
|
||||||
|
/// A name can be assigned to type in code using <see cref="ICSharpCode.Core.Presentation.CommandManager" />.
|
||||||
|
/// If this property is set then <see cref="OwnerTypeName" /> property can be ignored
|
||||||
|
/// If neither owner type nor owner instance is specified default owner type is applied
|
||||||
|
/// </summary>
|
||||||
|
public string OwnerInstanceName { |
||||||
|
get; private set; |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Name of binding owner instance name.
|
||||||
|
///
|
||||||
|
/// A name can be assigned to instance in code using <see cref="ICSharpCode.Core.Presentation.CommandManager" />.
|
||||||
|
/// If this property is set then <see cref="OwnerInstanceName" /> property can be ignored
|
||||||
|
/// If neither owner type nor owner instance is specified default owner type is applied
|
||||||
|
/// </summary>
|
||||||
|
public string OwnerTypeName { |
||||||
|
get; private set; |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets gestures associated with created <see cref="ICSharpCode.Core.Presentation.InputBindingInfo" />
|
||||||
|
/// </summary>
|
||||||
|
public string Gestures { |
||||||
|
get; private set; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// List of paths to input binding categories associated with created <see cref="ICSharpCode.Core.Presentation.InputBindingInfo" /> (separated by comma)
|
||||||
|
/// </summary>
|
||||||
|
public string Categories { |
||||||
|
get; private set; |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates new instance of <see cref="InputBindingInfoDescriptor" />
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="codon">Reference to codon used to create this descriptor</param>
|
||||||
|
public InputBindingInfoDescriptor(Codon codon) |
||||||
|
{ |
||||||
|
Codon = codon; |
||||||
|
Command = codon.Properties["command"]; |
||||||
|
CommandText = codon.Properties["commandtext"]; |
||||||
|
OwnerInstanceName = codon.Properties["ownerinstance"]; |
||||||
|
OwnerTypeName = codon.Properties["ownertype"]; |
||||||
|
Gestures = codon.Properties["gestures"]; |
||||||
|
Categories = codon.Properties["categories"]; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,64 @@ |
|||||||
|
using System; |
||||||
|
|
||||||
|
namespace ICSharpCode.Core |
||||||
|
{ |
||||||
|
/// <attribute name="command" use="required">
|
||||||
|
/// Name of System.Window.Input.RoutedUICommand associated with built InputBindingInfoDescriptor
|
||||||
|
/// The name should be first registered in code using ICSharpCode.Core.Presentation.CommandManager
|
||||||
|
/// or in addin file using RoutedUICommand node
|
||||||
|
/// </attribute>
|
||||||
|
/// <attribute name="ownertype" use="optional">
|
||||||
|
/// Name of binding owner type.
|
||||||
|
///
|
||||||
|
/// A name can be assigned to type in code using ICSharpCode.Core.Presentation.CommandManager.
|
||||||
|
/// If this attribute is used "ownerinstance" attribute cannot be used
|
||||||
|
/// If neither owner type nor owner instance is specified default owner type is applied
|
||||||
|
/// </attribute>
|
||||||
|
/// <attribute name="ownertype" use="optional">
|
||||||
|
/// Name of binding owner instance.
|
||||||
|
///
|
||||||
|
/// A name can be assigned to instance in code using ICSharpCode.Core.Presentation.CommandManager.
|
||||||
|
/// If this attribute is used "ownertype" attribute cannot be used
|
||||||
|
/// If neither owner type nor owner instance is specified default owner type is applied
|
||||||
|
/// </attribute>
|
||||||
|
/// <attribute name="gestures" use="optional">
|
||||||
|
/// Gestures associated with created System.Windows.Input.InputBinding instances
|
||||||
|
/// </attribute>
|
||||||
|
/// <attribute name="commandtext" use="optional">
|
||||||
|
/// Text displayed to user when managing input bindings (shortcuts)
|
||||||
|
///
|
||||||
|
/// If this attribute is not used System.Window.Input.RoutedUICommand.Text property is used
|
||||||
|
/// This attribute can only be used together with "gestures" attribute
|
||||||
|
/// </attribute>
|
||||||
|
/// <attribute name="categories" use="optional">
|
||||||
|
/// List of input binding category paths (separated using comma) associated with
|
||||||
|
/// created input binding infos
|
||||||
|
///
|
||||||
|
/// Input binding categories can be created in code using ICSharpCode.Core.Presentation.CommandManager or by using InputBindingCategory node in addin file
|
||||||
|
/// Input binding categories are used to group shortcuts into separate sections when displaying to user.
|
||||||
|
/// </attribute>
|
||||||
|
/// <usage>Only in /SharpDevelop/Workbench/InputBindings</usage>
|
||||||
|
/// <returns>
|
||||||
|
/// CommandBindingInfoDescriptor object
|
||||||
|
/// </returns>
|
||||||
|
/// <summary>
|
||||||
|
/// Creates descriptor containing data describing ICSharpCode.Core.Presentation.InputBindingInfo
|
||||||
|
/// </summary>
|
||||||
|
public class InputBindingInfoDoozer : IDoozer |
||||||
|
{ |
||||||
|
/// <see cref="IDoozer.HandleConditions" />
|
||||||
|
public bool HandleConditions { |
||||||
|
get { |
||||||
|
return true; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/// <see cref="IDoozer.BuildItem(object, Codon, System.Collections.ArrayList)">
|
||||||
|
/// Builds InputBindingInfoDescriptor
|
||||||
|
/// </see>
|
||||||
|
public object BuildItem(object caller, Codon codon, System.Collections.ArrayList subItems) |
||||||
|
{ |
||||||
|
return new InputBindingInfoDescriptor(codon); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -1,174 +0,0 @@ |
|||||||
using System; |
|
||||||
using System.Collections.Generic; |
|
||||||
using ICSharpCode.Core; |
|
||||||
|
|
||||||
namespace ICSharpCode.Core |
|
||||||
{ |
|
||||||
public delegate void GesturesPlaceHolderUpdate(); |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Stores gestures place holders
|
|
||||||
///
|
|
||||||
/// Through this class one can register a handler which which would be
|
|
||||||
/// called when gestures associated with place holder name are updated
|
|
||||||
/// </summary>
|
|
||||||
public static class BaseGesturesPlaceHolderRegistry |
|
||||||
{ |
|
||||||
private static Dictionary<string, GesturesPlaceHolderInfo> gesturePlaceHolders = new Dictionary<string, GesturesPlaceHolderInfo>(); |
|
||||||
|
|
||||||
private static Dictionary<string, string> commandTexts = new Dictionary<string, string>(); |
|
||||||
private static Dictionary<string, List<string>> registeredKeys = new Dictionary<string, List<string>>(); |
|
||||||
private static Dictionary<string, List<WeakReference>> commandKeysUpdateHandlers = new Dictionary<string, List<WeakReference>>(); |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Register a place holder
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="placeHolderName">Place holder name. Unique application wide</param>
|
|
||||||
/// <param name="placeHolderText">Place holder text visible to user</param>
|
|
||||||
public static void RegisterPlaceHolder(string placeHolderName, string placeHolderText) { |
|
||||||
gesturePlaceHolders.Add(placeHolderName, new GesturesPlaceHolderInfo(placeHolderName, placeHolderText)); |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get gestures assigned to place holder
|
|
||||||
///
|
|
||||||
/// Use KeysCollectionConverter or InputGestureCollectionConverter
|
|
||||||
/// to convert returned value representation to required format
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="placeHolderName">Place holder name</param>
|
|
||||||
/// <returns>Array of gestures</returns>
|
|
||||||
public static string[] GetGestures(string placeHolderName) { |
|
||||||
if(!gesturePlaceHolders.ContainsKey(placeHolderName) || gesturePlaceHolders[placeHolderName].Gestures.Count == 0) { |
|
||||||
return new string[] { }; |
|
||||||
} |
|
||||||
|
|
||||||
return gesturePlaceHolders[placeHolderName].Gestures.ToArray(); |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add gestures to place holder
|
|
||||||
///
|
|
||||||
/// Use KeysCollectionConverter or InputGestureCollectionConverter
|
|
||||||
/// to convert gestures to string representation
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="placeHolderName">Place holder name</param>
|
|
||||||
/// <param name="gestures">Added gestures</param>
|
|
||||||
public static void AddGestures(string placeHolderName, IEnumerable<string> gestures) { |
|
||||||
if(!gesturePlaceHolders.ContainsKey(placeHolderName)) { |
|
||||||
throw new ApplicationException("No gestures place holder with name '" + placeHolderName + "' is registered"); |
|
||||||
} |
|
||||||
|
|
||||||
foreach(string gesture in gestures) { |
|
||||||
if(!gesturePlaceHolders[placeHolderName].Gestures.Contains(gesture)) { |
|
||||||
gesturePlaceHolders[placeHolderName].Gestures.Add(gesture); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Remove gestures from place holder
|
|
||||||
///
|
|
||||||
/// Use KeysCollectionConverter or InputGestureCollectionConverter
|
|
||||||
/// to convert gestures to string representation
|
|
||||||
///
|
|
||||||
/// Null argumens are igonred and all gestures which specify
|
|
||||||
/// provided parameters are removed
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="placeHolderName"></param>
|
|
||||||
/// <param name="gestures"></param>
|
|
||||||
public static void RemoveGestures(string placeHolderName, IEnumerable<string> gestures) { |
|
||||||
if(gesturePlaceHolders.ContainsKey(placeHolderName)) { |
|
||||||
if(gestures == null) { |
|
||||||
gesturePlaceHolders[placeHolderName].Gestures.Clear(); |
|
||||||
} else { |
|
||||||
for(int i = gesturePlaceHolders[placeHolderName].Gestures.Count - 1; i >= 0; i--) { |
|
||||||
foreach(string gesture in gestures) { |
|
||||||
if(gesturePlaceHolders[placeHolderName].Gestures[i] == gesture) { |
|
||||||
gesturePlaceHolders[placeHolderName].Gestures.RemoveAt(i); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Register update handler which will trigger when gestures in
|
|
||||||
/// place holder are updated
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="placeHolderName">Place holder name</param>
|
|
||||||
/// <param name="handler">Handler which handles place holder gestures update</param>
|
|
||||||
public static void RegisterUpdateHandler(string placeHolderName, GesturesPlaceHolderUpdate handler) { |
|
||||||
if(!commandKeysUpdateHandlers.ContainsKey(placeHolderName)) { |
|
||||||
commandKeysUpdateHandlers.Add(placeHolderName, new List<WeakReference>()); |
|
||||||
} |
|
||||||
|
|
||||||
commandKeysUpdateHandlers[placeHolderName].Add(new WeakReference(handler)); |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Invoke delegates which handle gestures update in place holder
|
|
||||||
///
|
|
||||||
/// If place holder is not provided all registered handlers are invoked
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="placeHolderName"></param>
|
|
||||||
public static void InvokeUpdateHandlers(string placeHolderName) { |
|
||||||
if(placeHolderName == null) { |
|
||||||
foreach(var handlers in commandKeysUpdateHandlers) { |
|
||||||
foreach(var handler in handlers.Value) { |
|
||||||
if(handler != null && handler.Target != null) { |
|
||||||
((GesturesPlaceHolderUpdate)handler.Target).Invoke(); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} else { |
|
||||||
if(commandKeysUpdateHandlers.ContainsKey(placeHolderName)) { |
|
||||||
foreach(var handler in commandKeysUpdateHandlers[placeHolderName]) { |
|
||||||
if(handler != null && handler.Target != null) { |
|
||||||
((GesturesPlaceHolderUpdate)handler.Target).Invoke(); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Intername representation of place holders
|
|
||||||
/// </summary>
|
|
||||||
class GesturesPlaceHolderInfo |
|
||||||
{ |
|
||||||
/// <summary>
|
|
||||||
/// Place hollder name
|
|
||||||
/// </summary>
|
|
||||||
public string Name { |
|
||||||
get; private set; |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Place holder text visible to user
|
|
||||||
/// </summary>
|
|
||||||
public string Text { |
|
||||||
get; private set; |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Collection of gestures assigned to this place holder
|
|
||||||
/// </summary>
|
|
||||||
public List<string> Gestures { |
|
||||||
get; private set; |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Constructor
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="name">Place holder name</param>
|
|
||||||
/// <param name="text">Place holder text visible to user</param>
|
|
||||||
public GesturesPlaceHolderInfo(string name, string text) { |
|
||||||
Name = name; |
|
||||||
Text = text; |
|
||||||
Gestures = new List<string>(); |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
@ -1,82 +0,0 @@ |
|||||||
using System; |
|
||||||
using System.Windows.Forms; |
|
||||||
using System.Collections.Generic; |
|
||||||
using ICSharpCode.Core; |
|
||||||
|
|
||||||
namespace ICSharpCode.Core.WinForms |
|
||||||
{ |
|
||||||
/// <summary>
|
|
||||||
/// Stores gestures place holders
|
|
||||||
///
|
|
||||||
/// Through this class one can register a handler which which would be
|
|
||||||
/// called when gestures associated with place holder name are updated
|
|
||||||
/// </summary>
|
|
||||||
public static class GesturePlaceHolderRegistry |
|
||||||
{ |
|
||||||
/// <summary>
|
|
||||||
/// Register a place holder
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="placeHolderName">Place holder name. Unique application wide</param>
|
|
||||||
/// <param name="placeHolderText">Place holder text visible to user</param>
|
|
||||||
public static void RegisterPlaceHolder(string placeHolderName, string placeHolderText) { |
|
||||||
BaseGesturesPlaceHolderRegistry.RegisterPlaceHolder(placeHolderName, placeHolderText); |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get gestures assigned to place holder
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="placeHolderName">Place holder name</param>
|
|
||||||
/// <returns>Array of keys</returns>
|
|
||||||
public static Keys[] GetGestures(string placeHolderName) { |
|
||||||
var serializesGesturesColection = BaseGesturesPlaceHolderRegistry.GetGestures(placeHolderName); |
|
||||||
var gestures = (Keys[])new KeysCollectionConverter().ConvertFrom(serializesGesturesColection); |
|
||||||
|
|
||||||
return gestures; |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add gestures to place holder
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="placeHolderName">Place holder name</param>
|
|
||||||
/// <param name="gestures">Added gestures</param>
|
|
||||||
public static void AddGestures(string placeHolderName, IEnumerable<Keys> gestures) { |
|
||||||
var serializedGestures = (string[])new KeysCollectionConverter().ConvertTo(gestures, typeof(string[])); |
|
||||||
|
|
||||||
BaseGesturesPlaceHolderRegistry.AddGestures(placeHolderName, serializedGestures); |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Remove gestures from place holder
|
|
||||||
///
|
|
||||||
/// Null argumens are igonred and all gestures which specify
|
|
||||||
/// provided parameters are removed
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="placeHolderName">Place holder name</param>
|
|
||||||
/// <param name="gestures">Gestures</param>
|
|
||||||
public static void RemoveGestures(string placeHolderName, IEnumerable<Keys> gestures) { |
|
||||||
var serializedGestures = (string[])new KeysCollectionConverter().ConvertTo(gestures, typeof(string[])); |
|
||||||
|
|
||||||
BaseGesturesPlaceHolderRegistry.RemoveGestures(placeHolderName, serializedGestures); |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Register update handler which will trigger when gestures in
|
|
||||||
/// place holder are updated
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="placeHolderName">Place holder name</param>
|
|
||||||
/// <param name="handler">Handler which handles place holder gestures update</param>
|
|
||||||
public static void RegisterUpdateHandler(string placeHolderName, GesturesPlaceHolderUpdate handler) { |
|
||||||
BaseGesturesPlaceHolderRegistry.RegisterUpdateHandler(placeHolderName, handler); |
|
||||||
} |
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Invoke delegates which handle gestures update in place holder
|
|
||||||
///
|
|
||||||
/// If place holder is not provided all registered handlers are invoked
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="placeHolderName"></param>
|
|
||||||
public static void InvokeUpdateHandlers(string placeHolderName) { |
|
||||||
BaseGesturesPlaceHolderRegistry.InvokeUpdateHandlers(placeHolderName); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
Loading…
Reference in new issue