Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Commit d4cee5a

Browse files
committed
remove useless variable
1 parent 3e9ed47 commit d4cee5a

File tree

4 files changed

+10
-23
lines changed

4 files changed

+10
-23
lines changed

Program.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ public static class Program
4343

4444
public static bool _IsLocalInstallation;
4545

46-
public static bool IsSearchOpen = false;
47-
4846
[STAThread]
4947
public static void Main(string[] args)
5048
{

UI/MainWindow/MainWindowCommands.cs

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -280,23 +280,18 @@ private void Command_FindReplace()
280280

281281
var selection = GetCurrentEditorElement().editor.TextArea.Selection.GetText();
282282

283-
if (Program.IsSearchOpen)
283+
foreach (Window win in Application.Current.Windows)
284284
{
285-
foreach (Window win in Application.Current.Windows)
285+
if (win is FindReplaceWindow findWin)
286286
{
287-
if (win is FindReplaceWindow findWin)
288-
{
289-
findWin.Activate();
290-
findWin.FindBox.Text = selection;
291-
findWin.FindBox.SelectAll();
292-
findWin.FindBox.Focus();
293-
return;
294-
}
287+
findWin.Activate();
288+
findWin.FindBox.Text = selection;
289+
findWin.FindBox.SelectAll();
290+
findWin.FindBox.Focus();
291+
return;
295292
}
296293
}
297-
var findWindow = new FindReplaceWindow(selection);
298-
Program.IsSearchOpen = true;
299-
findWindow.Owner = this;
294+
var findWindow = new FindReplaceWindow(selection) { Owner = this };
300295
findWindow.Show();
301296
findWindow.FindBox.Focus();
302297
}

UI/Windows/FindReplaceWindow.xaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,14 @@
88
Background="{DynamicResource WhiteBrush}"
99
ResizeMode="NoResize"
1010
ShowTitleBar="True"
11-
ShowInTaskbar="True"
11+
ShowInTaskbar="False"
1212
Height="263"
1313
Width="536"
1414
HorizontalAlignment="Center"
1515
VerticalAlignment="Center"
1616
UseNoneWindowStyle="False"
1717
TitlebarHeight="20"
18-
KeyDown="MetroWindow_KeyDown"
19-
Closed="MetroWindow_Closed">
18+
KeyDown="MetroWindow_KeyDown">
2019

2120
<controls:MetroWindow.Resources>
2221
<ResourceDictionary>

UI/Windows/FindReplaceWindow.xaml.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,6 @@ private void MetroWindow_KeyDown(object sender, KeyEventArgs e)
121121
}
122122
}
123123
}
124-
125-
private void MetroWindow_Closed(object sender, EventArgs e)
126-
{
127-
Program.IsSearchOpen = false;
128-
}
129124
#endregion
130125

131126
#region Methods

0 commit comments

Comments
 (0)