mirror of
https://github.com/SabreTools/MPF.git
synced 2026-05-06 20:43:47 +00:00
Remove usages of this. from UI code
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
- Use expanded version of split regex
|
||||
- Update packages for bugfixes
|
||||
- Fix minor efficiency issues
|
||||
- Remove usages of `this.` from UI code
|
||||
|
||||
### 3.2.3 (2024-11-06)
|
||||
|
||||
|
||||
@@ -107,8 +107,8 @@ namespace MPF.UI.UserControls
|
||||
|
||||
public LogLine(string text, LogLevel logLevel)
|
||||
{
|
||||
this.Text = text;
|
||||
this.LogLevel = logLevel;
|
||||
Text = text;
|
||||
LogLevel = logLevel;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -117,7 +117,7 @@ namespace MPF.UI.UserControls
|
||||
/// <returns>Brush representing the color</returns>
|
||||
public Brush GetForegroundColor()
|
||||
{
|
||||
return this.LogLevel switch
|
||||
return LogLevel switch
|
||||
{
|
||||
LogLevel.SECRET => Brushes.Blue,
|
||||
LogLevel.ERROR => Brushes.Red,
|
||||
@@ -132,7 +132,7 @@ namespace MPF.UI.UserControls
|
||||
/// <returns>Run object based on internal values</returns>
|
||||
public Run GenerateRun()
|
||||
{
|
||||
return new Run { Text = this.Text, Foreground = GetForegroundColor() };
|
||||
return new Run { Text = Text, Foreground = GetForegroundColor() };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -192,7 +192,7 @@ namespace MPF.UI.Windows
|
||||
WindowStartupLocation = WindowStartupLocation.CenterOwner,
|
||||
};
|
||||
|
||||
discInformationWindow.Closed += delegate { this.Activate(); };
|
||||
discInformationWindow.Closed += delegate { Activate(); };
|
||||
bool? result = discInformationWindow.ShowDialog();
|
||||
|
||||
// Copy back the submission info changes, if necessary
|
||||
|
||||
@@ -310,7 +310,7 @@ namespace MPF.UI.Windows
|
||||
WindowStartupLocation = WindowStartupLocation.CenterOwner,
|
||||
};
|
||||
|
||||
discInformationWindow.Closed += delegate { this.Activate(); };
|
||||
discInformationWindow.Closed += delegate { Activate(); };
|
||||
bool? result = discInformationWindow.ShowDialog();
|
||||
|
||||
// Copy back the submission info changes, if necessary
|
||||
@@ -326,7 +326,7 @@ namespace MPF.UI.Windows
|
||||
public void ShowCheckDumpWindow()
|
||||
{
|
||||
// Hide MainWindow while Check GUI is open
|
||||
this.Hide();
|
||||
Hide();
|
||||
|
||||
var checkDumpWindow = new CheckDumpWindow(this)
|
||||
{
|
||||
@@ -340,8 +340,8 @@ namespace MPF.UI.Windows
|
||||
checkDumpWindow.Closed += delegate
|
||||
{
|
||||
// Unhide Main window after Check window has been closed
|
||||
this.Show();
|
||||
this.Activate();
|
||||
Show();
|
||||
Activate();
|
||||
};
|
||||
checkDumpWindow.Show();
|
||||
}
|
||||
@@ -352,7 +352,7 @@ namespace MPF.UI.Windows
|
||||
public void ShowCreateIRDWindow()
|
||||
{
|
||||
// Hide MainWindow while Create IRD UI is open
|
||||
this.Hide();
|
||||
Hide();
|
||||
|
||||
var createIRDWindow = new CreateIRDWindow(this)
|
||||
{
|
||||
@@ -366,8 +366,8 @@ namespace MPF.UI.Windows
|
||||
createIRDWindow.Closed += delegate
|
||||
{
|
||||
// Unhide Main window after Create IRD window has been closed
|
||||
this.Show();
|
||||
this.Activate();
|
||||
Show();
|
||||
Activate();
|
||||
};
|
||||
createIRDWindow.Show();
|
||||
}
|
||||
@@ -387,7 +387,7 @@ namespace MPF.UI.Windows
|
||||
WindowStartupLocation = WindowStartupLocation.CenterOwner,
|
||||
};
|
||||
|
||||
optionsWindow.Closed += delegate { this.Activate(); };
|
||||
optionsWindow.Closed += delegate { Activate(); };
|
||||
optionsWindow.Closed += OnOptionsUpdated;
|
||||
optionsWindow.Show();
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace MPF.UI.Windows
|
||||
base.OnContentRendered(e);
|
||||
|
||||
// Set the window title
|
||||
OptionsViewModel.Title = this.Title;
|
||||
OptionsViewModel.Title = Title;
|
||||
}
|
||||
|
||||
#region UI Commands
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace MPF.UI.Windows
|
||||
{
|
||||
try
|
||||
{
|
||||
this.DialogResult = false;
|
||||
DialogResult = false;
|
||||
}
|
||||
catch { }
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace MPF.UI.Windows
|
||||
/// </summary>
|
||||
public void MinimizeButtonClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.WindowState = WindowState.Minimized;
|
||||
WindowState = WindowState.Minimized;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -35,7 +35,7 @@ namespace MPF.UI.Windows
|
||||
public void TitleMouseDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (e.ChangedButton == MouseButton.Left)
|
||||
this.DragMove();
|
||||
DragMove();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user