Example #1
0
 void OpenInNotepad()
 {
     NotepadPlusPlus.Get().MatchSome(npp =>
     {
         npp.Open(Path);
     });
 }
Example #2
0
 internal static void Open(TextLocation location)
 {
     NotepadPlusPlus.Get().Match(
         _ => _.Open(location),
         () => Process.Start("notepad.exe", location.FileName.Quote())
         );
 }
Example #3
0
 internal static void Open(LPath textFile)
 {
     NotepadPlusPlus.Get().Match(
         _ => _.Open(textFile),
         () => Process.Start("notepad.exe", textFile)
         );
 }
Example #4
0
 IResult ToResult(string file)
 {
     return(new SimpleAction(file, new[] { file.RelativeTo(this.directory) }.Join(" "), () =>
     {
         NotepadPlusPlus.Get().Open(file);
     }).ToResult());
 }
Example #5
0
 IResult ToResult(string file, string text, IEnumerable <Match> m)
 {
     return(new SimpleAction(file, new[] { file.RelativeTo(this.directory) }.Concat(TextContext(text, m)).Join(" "), () =>
     {
         NotepadPlusPlus.Get().Open(file);
     }).ToResult());
 }
Example #6
0
 public void Execute()
 {
     NotepadPlusPlus.Get().ValueOr(() => null).Open(TextLocation);
 }