diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-11-07 11:34:04 +0100 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-11-07 11:34:04 +0100 |
| commit | dbb9034d864fc42f92a66b08a0734edc3dc73e8c (patch) | |
| tree | b5498e51945c1bb47f8b01a40fdc1c24087ea725 /Samples/common/src/Extensions.cs | |
| parent | 325573e4c0328189cf2353b31fc68780224bbc57 (diff) | |
doc, remplated menubar for showcase, disposable cursorParent in sliderdevel2
Diffstat (limited to 'Samples/common/src/Extensions.cs')
| -rw-r--r-- | Samples/common/src/Extensions.cs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Samples/common/src/Extensions.cs b/Samples/common/src/Extensions.cs index 7647dbc9..02433011 100644 --- a/Samples/common/src/Extensions.cs +++ b/Samples/common/src/Extensions.cs @@ -1,20 +1,25 @@ +using System.IO; using System.Reflection; using Crow; namespace Samples { public static class Extensions { - public static CommandGroup GetCommands (this System.IO.DirectoryInfo di) => + public static CommandGroup GetCommands (this DirectoryInfo di) => new CommandGroup( - new ActionCommand ("Set as root", ()=> {SampleBaseForEditor.CurrentProgramInstance.CurrentDir = di.FullName;}) + new ActionCommand ("Set as root", ()=> {SampleBaseForEditor.CurrentProgramInstance.CurrentDir = di.FullName;})/*, + new ActionCommand ("New Directory", (sender0) => { + Directory.CreateDirectory (Path.Combine (di.FullName, "new directory")); + Widget listContainer = ((sender0 as Widget).LogicalParent as Widget).DataSource as Widget; + })*/ ); - public static CommandGroup GetCommands (this System.IO.FileInfo fi) => + public static CommandGroup GetCommands (this FileInfo fi) => new CommandGroup( new ActionCommand ("Delete", (sender0) => { MessageBox.ShowModal (SampleBaseForEditor.CurrentProgramInstance, MessageBox.Type.YesNo, $"Delete {fi.Name}?").Yes += (sender, e) => { - System.IO.File.Delete(fi.FullName); + File.Delete(fi.FullName); Widget listContainer = ((sender0 as Widget).LogicalParent as Widget).DataSource as Widget; (listContainer.Parent as Group).RemoveChild(listContainer); }; |