Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/shortcuts@4653 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts^2
17 changed files with 159 additions and 121 deletions
@ -0,0 +1,44 @@
@@ -0,0 +1,44 @@
|
||||
using System; |
||||
|
||||
namespace ICSharpCode.Core |
||||
{ |
||||
/// <summary>
|
||||
/// Describes shortcuts in menu affiliation to input binding category
|
||||
///
|
||||
/// Root-level ICSharpCode.Core.Presentation.InputBindingInfo are associated with provided categories. For ICSharpCode.Core.Presentation.InputBindingInfo
|
||||
/// in sub-menus new ICSharpCode.Core.Presentation.InputBindingCategory is created from sub-menu id and title
|
||||
/// </summary>
|
||||
public class MenuLocationDescriptor |
||||
{ |
||||
/// <summary>
|
||||
/// Gets paths to categories associated with menu
|
||||
/// </summary>
|
||||
public string CategoryPaths |
||||
{ |
||||
get; private set; |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Gets path to menu root
|
||||
/// </summary>
|
||||
public string MenuPath |
||||
{ |
||||
get; private set; |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Creates new instance of <see cref="MenuLocationDescriptor" />
|
||||
/// </summary>
|
||||
/// <param name="caller">Caller object</param>
|
||||
/// <param name="codon">Reference to codon used to create this descriptor</param>
|
||||
public MenuLocationDescriptor(object caller, Codon codon) |
||||
{ |
||||
if(!codon.Properties.Contains("menupath") || !codon.Properties.Contains("categorypaths")){ |
||||
throw new ArgumentException("Menu location should have both menu path and category paths assigned"); |
||||
} |
||||
|
||||
MenuPath = codon.Properties["menupath"]; |
||||
CategoryPaths = codon.Properties["categorypaths"]; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,43 @@
@@ -0,0 +1,43 @@
|
||||
using System; |
||||
using System.Collections; |
||||
|
||||
namespace ICSharpCode.Core |
||||
{ |
||||
/// <attribute name="menupath" use="required">
|
||||
/// Path to menu root category
|
||||
/// </attribute>
|
||||
/// <attribute name="name" use="required">
|
||||
/// Category name displayed to user
|
||||
/// </attribute>
|
||||
/// <usage>Only in /SharpDevelop/CommandManager/MenuLocations</usage>
|
||||
/// <returns>
|
||||
/// MenuLocationDoozer object
|
||||
/// </returns>
|
||||
/// <summary>
|
||||
/// Describes shortcuts in menu affiliation to input binding categories
|
||||
///
|
||||
/// Root-level ICSharpCode.Core.Presentation.InputBindingInfo are associated with provided category. For ICSharpCode.Core.Presentation.InputBindingInfo
|
||||
/// in sub-menus new ICSharpCode.Core.Presentation.InputBindingCategory is created from sub-menu id and title
|
||||
/// </summary>
|
||||
public class MenuLocationDoozer : IDoozer |
||||
{ |
||||
/// <inheritdoc />
|
||||
public bool HandleConditions { |
||||
get { |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Builds instance of <see cref="MenuLocationDescriptor" /> 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="MenuLocationDescriptor" /></returns>
|
||||
public object BuildItem(object caller, Codon codon, ArrayList subItems) |
||||
{ |
||||
return new MenuLocationDescriptor(caller, codon); |
||||
} |
||||
} |
||||
} |
@ -1,54 +0,0 @@
@@ -1,54 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Administrator |
||||
* Date: 6/28/2009 |
||||
* Time: 10:12 PM |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
using System; |
||||
using System.Collections; |
||||
|
||||
namespace ICSharpCode.Core |
||||
{ |
||||
/// <summary>
|
||||
/// Description of MenuDescriptionDoozer.
|
||||
/// </summary>
|
||||
public class MenuLocationDoozer : IDoozer |
||||
{ |
||||
public bool HandleConditions { |
||||
get { |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
public object BuildItem(object caller, Codon codon, ArrayList subItems) |
||||
{ |
||||
return new MenuLocationDescriptor(caller, codon); |
||||
} |
||||
} |
||||
|
||||
|
||||
public class MenuLocationDescriptor |
||||
{ |
||||
public string Category |
||||
{ |
||||
get; private set; |
||||
} |
||||
|
||||
public string Path |
||||
{ |
||||
get; private set; |
||||
} |
||||
|
||||
public MenuLocationDescriptor(object caller, Codon codon) |
||||
{ |
||||
if(!codon.Properties.Contains("path") || !codon.Properties.Contains("category")){ |
||||
throw new ArgumentException("Menu location should have path and category"); |
||||
} |
||||
|
||||
Path = codon.Properties["path"]; |
||||
Category = codon.Properties["category"]; |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue