mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-02 01:03:29 +01:00
Fixed nullable warnings 7
This commit is contained in:
@@ -527,8 +527,8 @@ public class Buttons : Scenario
|
||||
}
|
||||
|
||||
_value = value;
|
||||
_number.Text = _value.ToString ();
|
||||
ValueChanged?.Invoke (this, new (ref _value));
|
||||
_number.Text = _value.ToString ()!;
|
||||
ValueChanged?.Invoke (this, new (in _value));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -205,7 +205,7 @@ public class ListViewWithSelection : Scenario
|
||||
|
||||
/// <inheritdoc />
|
||||
public event NotifyCollectionChangedEventHandler CollectionChanged;
|
||||
public int Count => Scenarios != null ? Scenarios.Count : 0;
|
||||
public int Count => Scenarios?.Count ?? 0;
|
||||
public int Length { get; private set; }
|
||||
public bool SuspendCollectionChangedEvent { get => throw new System.NotImplementedException (); set => throw new System.NotImplementedException (); }
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using Terminal.Gui;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
|
||||
namespace UICatalog.Scenarios;
|
||||
|
||||
@@ -64,14 +65,17 @@ public class MenuBarScenario : Scenario
|
||||
menuBar.Key = KeyCode.F9;
|
||||
menuBar.Title = "TestMenuBar";
|
||||
|
||||
bool fnAction (string s)
|
||||
bool FnAction (string s)
|
||||
{
|
||||
_lastAction.Text = s;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Declare a variable for the function
|
||||
Func<string, bool> fnActionVariable = FnAction;
|
||||
|
||||
menuBar.EnableForDesign ((Func<string, bool>)fnAction);
|
||||
menuBar.EnableForDesign (ref fnActionVariable);
|
||||
|
||||
menuBar.MenuOpening += (s, e) =>
|
||||
{
|
||||
|
||||
@@ -104,7 +104,7 @@ internal class UICatalogApp
|
||||
// If no driver is provided, the default driver is used.
|
||||
Option<string> driverOption = new Option<string> ("--driver", "The ConsoleDriver to use.").FromAmong (
|
||||
Application.GetDriverTypes ()
|
||||
.Select (d => d.Name)
|
||||
.Select (d => d!.Name)
|
||||
.ToArray ()
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user