Skip to content

Commit 650875f

Browse files
committed
Code cleanup
1 parent 4590418 commit 650875f

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

Plugins/Flow.Launcher.Plugin.ProcessKiller/Main.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Collections.Generic;
1+
using System.Collections.Generic;
22
using System.Linq;
33
using Flow.Launcher.Infrastructure;
44

@@ -79,14 +79,14 @@ private List<Result> CreateResultsFromQuery(Query query)
7979
results.Add(new Result()
8080
{
8181
IcoPath = path,
82-
Title = p.ProcessName + " - " + p.Id + (pr.Port!=0? $" - [{pr.Port}]":""),
82+
Title = $"{p.ProcessName} - {p.Id}" + (pr.Port != 0 ? $" - [{pr.Port}]" : ""),
8383
SubTitle = path,
8484
TitleHighlightData = StringMatcher.FuzzySearch(termToSearch, p.ProcessName).MatchData,
8585
Score = pr.Score,
8686
ContextData = p.ProcessName,
8787
AutoCompleteText = $"{_context.CurrentPluginMetadata.ActionKeyword}{Plugin.Query.TermSeparator}{p.ProcessName}",
8888
Action = (c) =>
89-
{
89+
{
9090
processHelper.TryKill(p);
9191
// Re-query to refresh process list
9292
_context.API.ChangeQuery(query.RawQuery, true);

Plugins/Flow.Launcher.Plugin.ProcessKiller/PortHelper.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
using Flow.Launcher.Infrastructure;
2-
using Flow.Launcher.Infrastructure.Logger;
1+
using Flow.Launcher.Infrastructure.Logger;
32
using System;
4-
using System.Collections.Generic;
53
using System.Diagnostics;
6-
using System.Linq;
74
using System.Management;
85

96
namespace Flow.Launcher.Plugin.ProcessKiller
@@ -18,9 +15,7 @@ internal class PortDetail
1815
public string Path { get; set; }
1916
public override string ToString()
2017
{
21-
return string.Format(@" Process Name: {0} ,Process ID: {1} ,
22-
Port: {2} ,\nPath : {3}", ProcessName,
23-
ProcessID, Port, Path);
18+
return $@" Process Name: {ProcessName}, Process ID: {ProcessID}, Port: {Port}, Path : {Path}";
2419
}
2520

2621
}
@@ -128,7 +123,7 @@ private static Tuple<string, string> GetProcessNameAndCommandLineArgs(int proces
128123
// interested in first result.
129124
foreach (ManagementObject item in results)
130125
{
131-
result = Tuple.Create<string, string>(Convert.ToString(item["Name"]),
126+
result = Tuple.Create(Convert.ToString(item["Name"]),
132127
Convert.ToString(item["ExecutablePath"]));
133128
break;
134129

0 commit comments

Comments
 (0)