Skip to content

Commit

Permalink
+1
Browse files Browse the repository at this point in the history
  • Loading branch information
jinek committed Nov 21, 2023
1 parent b9f0374 commit 63993e4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@ private void InitializeComponent()
AvaloniaXamlLoader.Load(this);
}

// ReSharper disable UnusedParameter.Local
private async void PauseButton_OnClick(object _, RoutedEventArgs _2)
// ReSharper restore UnusedParameter.Local
{
var cts = new CancellationTokenSource();
cts.CancelAfter(5000);
// ReSharper disable PossibleNullReferenceException //todo: build task does not understand ! operator
await ((ConsoloniaLifetime)Application.Current!.ApplicationLifetime!).DisconnectFromConsoleAsync(cts.Token);
// ReSharper restore PossibleNullReferenceException
Console.ResetColor();
Console.Clear();
}
Expand Down
5 changes: 3 additions & 2 deletions src/Consolonia.PlatformSupport/WindowsConsole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public Win32Console()

#region chatGPT

// ReSharper disable InconsistentNaming
[StructLayout(LayoutKind.Sequential)]
private struct INPUT_RECORD
{
Expand Down Expand Up @@ -104,7 +105,7 @@ private static extern bool WriteConsoleInput(
INPUT_RECORD[] lpBuffer,
uint nLength,
out uint lpNumberOfEventsWritten);

// ReSharper restore InconsistentNaming
#endregion

public override void PauseIO(Task task)
Expand All @@ -120,7 +121,7 @@ public override void PauseIO(Task task)
bSetFocus = true
};

if (!WriteConsoleInput(_windowsConsole.InputHandle, inputRecords, 1, out uint eventsWritten))
if (!WriteConsoleInput(_windowsConsole.InputHandle, inputRecords, 1, out uint _))
{
// Handle error
int error = Marshal.GetLastWin32Error();
Expand Down
1 change: 1 addition & 0 deletions src/Consolonia.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<s:String x:Key="/Default/CodeInspection/PencilsConfiguration/FiltersState/=SpellingFilter/@EntryIndexedValue">Default</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/NAMESPACE_BODY/@EntryValue">BlockScoped</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GDP/@EntryIndexedValue">GDP</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IO/@EntryIndexedValue">IO</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=UI/@EntryIndexedValue">UI</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=XY/@EntryIndexedValue">XY</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=GDP/@EntryIndexedValue">GDP</s:String>
Expand Down

0 comments on commit 63993e4

Please sign in to comment.