Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.AvalonEdit/5.0.1/AvalonEdit-5.0.1/AvalonEditCommands.cs @ 12626

Last change on this file since 12626 was 11700, checked in by jkarder, 10 years ago

#2077: created branch and added first version

File size: 4.7 KB
Line 
1// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
2//
3// Permission is hereby granted, free of charge, to any person obtaining a copy of this
4// software and associated documentation files (the "Software"), to deal in the Software
5// without restriction, including without limitation the rights to use, copy, modify, merge,
6// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
7// to whom the Software is furnished to do so, subject to the following conditions:
8//
9// The above copyright notice and this permission notice shall be included in all copies or
10// substantial portions of the Software.
11//
12// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
13// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
15// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
16// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
17// DEALINGS IN THE SOFTWARE.
18
19using System;
20using System.Windows.Input;
21
22namespace ICSharpCode.AvalonEdit
23{
24  /// <summary>
25  /// Custom commands for AvalonEdit.
26  /// </summary>
27  public static class AvalonEditCommands
28  {
29    /// <summary>
30    /// Deletes the current line.
31    /// The default shortcut is Ctrl+D.
32    /// </summary>
33    public static readonly RoutedCommand DeleteLine = new RoutedCommand(
34      "DeleteLine", typeof(TextEditor),
35      new InputGestureCollection {
36        new KeyGesture(Key.D, ModifierKeys.Control)
37      });
38   
39    /// <summary>
40    /// Removes leading whitespace from the selected lines (or the whole document if the selection is empty).
41    /// </summary>
42    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Whitespace",
43                                                     Justification = "WPF uses 'Whitespace'")]
44    public static readonly RoutedCommand RemoveLeadingWhitespace = new RoutedCommand("RemoveLeadingWhitespace", typeof(TextEditor));
45       
46    /// <summary>
47    /// Removes trailing whitespace from the selected lines (or the whole document if the selection is empty).
48    /// </summary>
49    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Whitespace",
50                                                     Justification = "WPF uses 'Whitespace'")]
51    public static readonly RoutedCommand RemoveTrailingWhitespace = new RoutedCommand("RemoveTrailingWhitespace", typeof(TextEditor));
52   
53    /// <summary>
54    /// Converts the selected text to upper case.
55    /// </summary>
56    public static readonly RoutedCommand ConvertToUppercase = new RoutedCommand("ConvertToUppercase", typeof(TextEditor));
57   
58    /// <summary>
59    /// Converts the selected text to lower case.
60    /// </summary>
61    public static readonly RoutedCommand ConvertToLowercase = new RoutedCommand("ConvertToLowercase", typeof(TextEditor));
62   
63    /// <summary>
64    /// Converts the selected text to title case.
65    /// </summary>
66    public static readonly RoutedCommand ConvertToTitleCase = new RoutedCommand("ConvertToTitleCase", typeof(TextEditor));
67   
68    /// <summary>
69    /// Inverts the case of the selected text.
70    /// </summary>
71    public static readonly RoutedCommand InvertCase = new RoutedCommand("InvertCase", typeof(TextEditor));
72   
73    /// <summary>
74    /// Converts tabs to spaces in the selected text.
75    /// </summary>
76    public static readonly RoutedCommand ConvertTabsToSpaces = new RoutedCommand("ConvertTabsToSpaces", typeof(TextEditor));
77   
78    /// <summary>
79    /// Converts spaces to tabs in the selected text.
80    /// </summary>
81    public static readonly RoutedCommand ConvertSpacesToTabs = new RoutedCommand("ConvertSpacesToTabs", typeof(TextEditor));
82   
83    /// <summary>
84    /// Converts leading tabs to spaces in the selected lines (or the whole document if the selection is empty).
85    /// </summary>
86    public static readonly RoutedCommand ConvertLeadingTabsToSpaces = new RoutedCommand("ConvertLeadingTabsToSpaces", typeof(TextEditor));
87   
88    /// <summary>
89    /// Converts leading spaces to tabs in the selected lines (or the whole document if the selection is empty).
90    /// </summary>
91    public static readonly RoutedCommand ConvertLeadingSpacesToTabs = new RoutedCommand("ConvertLeadingSpacesToTabs", typeof(TextEditor));
92   
93    /// <summary>
94    /// Runs the IIndentationStrategy on the selected lines (or the whole document if the selection is empty).
95    /// </summary>
96    public static readonly RoutedCommand IndentSelection = new RoutedCommand(
97      "IndentSelection", typeof(TextEditor),
98      new InputGestureCollection {
99        new KeyGesture(Key.I, ModifierKeys.Control)
100      });
101  }
102}
Note: See TracBrowser for help on using the repository browser.