mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
Accomodate upstream changes
This commit is contained in:
@@ -450,13 +450,13 @@ static class Demo {
|
||||
|
||||
static void ComboBoxDemo ()
|
||||
{
|
||||
IList<string> items = new List<string> ();
|
||||
List<ustring> items = new List<ustring> ();
|
||||
foreach (var dir in new [] { "/etc", @"\windows\System32" }) {
|
||||
if (Directory.Exists (dir)) {
|
||||
items = Directory.GetFiles (dir).Union (Directory.GetDirectories (dir))
|
||||
.Select (Path.GetFileName)
|
||||
.Where (x => char.IsLetterOrDigit (x [0]))
|
||||
.OrderBy (x => x).ToList ();
|
||||
.OrderBy (x => x).Select (x => ustring.Make (x)).ToList ();
|
||||
}
|
||||
}
|
||||
var list = new ComboBox () { Width = Dim.Fill(), Height = Dim.Fill() };
|
||||
|
||||
@@ -131,7 +131,7 @@ namespace Terminal.Gui {
|
||||
listview.SelectedItemChanged += (ListViewItemEventArgs e) => {
|
||||
|
||||
if(searchset.Count > 0)
|
||||
SetValue ((string)searchset [listview.SelectedItem]);
|
||||
SetValue ((ustring)searchset [listview.SelectedItem]);
|
||||
};
|
||||
|
||||
Application.Loaded += (Application.ResizedEventArgs a) => {
|
||||
@@ -224,7 +224,7 @@ namespace Terminal.Gui {
|
||||
|
||||
if (e.Key == Key.CursorDown && search.HasFocus && listview.SelectedItem == 0 && searchset.Count > 0) { // jump to list
|
||||
this.SetFocus (listview);
|
||||
SetValue ((string)searchset [listview.SelectedItem]);
|
||||
SetValue ((ustring)searchset [listview.SelectedItem]);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -284,7 +284,7 @@ namespace Terminal.Gui {
|
||||
return;
|
||||
}
|
||||
|
||||
SetValue ((string)searchset [listview.SelectedItem]);
|
||||
SetValue ((ustring)searchset [listview.SelectedItem]);
|
||||
search.CursorPosition = search.Text.Length;
|
||||
Search_Changed (search.Text);
|
||||
Reset (keepSearchText: true);
|
||||
@@ -326,7 +326,7 @@ namespace Terminal.Gui {
|
||||
if (string.IsNullOrEmpty (search.Text.ToString ()))
|
||||
ResetSearchSet ();
|
||||
else
|
||||
searchset = source.ToList().Cast<string>().Where (x => x.StartsWith (search.Text.ToString (), StringComparison.CurrentCultureIgnoreCase)).ToList();
|
||||
searchset = source.ToList().Cast<ustring>().Where (x => x.ToString().StartsWith (search.Text.ToString (), StringComparison.CurrentCultureIgnoreCase)).ToList();
|
||||
|
||||
listview.SetSource (searchset);
|
||||
listview.Height = CalculatetHeight ();
|
||||
|
||||
@@ -12,13 +12,13 @@ namespace UICatalog.Scenarios {
|
||||
|
||||
public override void Setup ()
|
||||
{
|
||||
List<string> items = new List<string> ();
|
||||
List<ustring> items = new List<ustring> ();
|
||||
foreach (var dir in new [] { "/etc", @"\windows\System32" }) {
|
||||
if (Directory.Exists (dir)) {
|
||||
items = Directory.GetFiles (dir).Union(Directory.GetDirectories(dir))
|
||||
.Select (Path.GetFileName)
|
||||
.Where (x => char.IsLetterOrDigit (x [0]))
|
||||
.OrderBy (x => x).ToList ();
|
||||
.Select (Path.GetFileName)
|
||||
.Where (x => char.IsLetterOrDigit (x [0]))
|
||||
.OrderBy (x => x).Select(x => ustring.Make(x)).ToList() ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user