aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/AvalonEditCommands.cs
blob: 5aaed19d8f5c0d8f0c075fa7f10d4a7c728b2374 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
4
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.Core;
using Tango.PMR.IO;

namespace Tango.Integration.Storage
{
    public abstract class StorageItem : ExtendedObject
    {
        private String _path;
        public String Path
        {
            get { return _path; }
            set { _path = value; RaisePropertyChangedAuto(); }
        }

        public String Name
        {
            get { return System.IO.Path.GetFileName(Path); }
        }
        public String Parent
        {
            get
            {
                if (Path == "/") return null;

                String root = System.IO.Path.GetPathRoot(Path);
                var parent = Directory.GetParent(Path);

                if (root == "\\")
                {
                    return parent.FullName.Replace(parent.Root.FullName, "/").Replace("\\", "/");
                }
                else if (parent != null)
                {
                    return parent.FullName;
                }
                else
                {
                    return null;
                }
            }
        }

        public DateTime LastModified { get; set; }

        public FileAttribute Attribute { get; set; }
    }
}
"c1">/// </summary> public static readonly RoutedCommand ConvertToLowercase = new RoutedCommand("ConvertToLowercase", typeof(TextEditor)); /// <summary> /// Converts the selected text to title case. /// </summary> public static readonly RoutedCommand ConvertToTitleCase = new RoutedCommand("ConvertToTitleCase", typeof(TextEditor)); /// <summary> /// Inverts the case of the selected text. /// </summary> public static readonly RoutedCommand InvertCase = new RoutedCommand("InvertCase", typeof(TextEditor)); /// <summary> /// Converts tabs to spaces in the selected text. /// </summary> public static readonly RoutedCommand ConvertTabsToSpaces = new RoutedCommand("ConvertTabsToSpaces", typeof(TextEditor)); /// <summary> /// Converts spaces to tabs in the selected text. /// </summary> public static readonly RoutedCommand ConvertSpacesToTabs = new RoutedCommand("ConvertSpacesToTabs", typeof(TextEditor)); /// <summary> /// Converts leading tabs to spaces in the selected lines (or the whole document if the selection is empty). /// </summary> public static readonly RoutedCommand ConvertLeadingTabsToSpaces = new RoutedCommand("ConvertLeadingTabsToSpaces", typeof(TextEditor)); /// <summary> /// Converts leading spaces to tabs in the selected lines (or the whole document if the selection is empty). /// </summary> public static readonly RoutedCommand ConvertLeadingSpacesToTabs = new RoutedCommand("ConvertLeadingSpacesToTabs", typeof(TextEditor)); /// <summary> /// Runs the IIndentationStrategy on the selected lines (or the whole document if the selection is empty). /// </summary> public static readonly RoutedCommand IndentSelection = new RoutedCommand( "IndentSelection", typeof(TextEditor), new InputGestureCollection { new KeyGesture(Key.I, ModifierKeys.Control) }); } }