mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Make code more readable
This commit is contained in:
parent
436ec7dd39
commit
a9192541ab
2 changed files with 11 additions and 8 deletions
|
|
@ -233,8 +233,8 @@ namespace Flow.Launcher.Plugin
|
|||
/// Open directory in an explorer configured by user via Flow's Settings. The default is Windows Explorer
|
||||
/// </summary>
|
||||
/// <param name="DirectoryPath">Directory Path to open</param>
|
||||
/// <param name="FileName">Extra FileName Info</param>
|
||||
public void OpenDirectory(string DirectoryPath, string FileName = null);
|
||||
/// <param name="FileNameOrFilePath">Extra FileName Info</param>
|
||||
public void OpenDirectory(string DirectoryPath, string FileNameOrFilePath = null);
|
||||
|
||||
/// <summary>
|
||||
/// Opens the URL with the given Uri object.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
|
|
@ -195,17 +195,20 @@ namespace Flow.Launcher
|
|||
((PluginJsonStorage<T>)_pluginJsonStorages[type]).Save();
|
||||
}
|
||||
|
||||
public void OpenDirectory(string DirectoryPath, string FileName = null)
|
||||
public void OpenDirectory(string DirectoryPath, string FileNameOrFilePath = null)
|
||||
{
|
||||
using var explorer = new Process();
|
||||
var explorerInfo = _settingsVM.Settings.CustomExplorer;
|
||||
explorer.StartInfo = new ProcessStartInfo
|
||||
{
|
||||
FileName = explorerInfo.Path,
|
||||
Arguments = FileName is null ?
|
||||
explorerInfo.DirectoryArgument.Replace("%d", DirectoryPath) :
|
||||
explorerInfo.FileArgument.Replace("%d", DirectoryPath).Replace("%f",
|
||||
Path.IsPathRooted(FileName) ? FileName : Path.Combine(DirectoryPath, FileName))
|
||||
Arguments = FileNameOrFilePath is null
|
||||
? explorerInfo.DirectoryArgument.Replace("%d", DirectoryPath)
|
||||
: explorerInfo.FileArgument
|
||||
.Replace("%d", DirectoryPath)
|
||||
.Replace("%f",
|
||||
Path.IsPathRooted(FileNameOrFilePath) ? FileNameOrFilePath : Path.Combine(DirectoryPath, FileNameOrFilePath)
|
||||
)
|
||||
};
|
||||
explorer.Start();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue