diff --git a/ViewRenamer/Properties/AssemblyInfo.cs b/ViewRenamer/Properties/AssemblyInfo.cs index 5f77097..2798f2b 100644 --- a/ViewRenamer/Properties/AssemblyInfo.cs +++ b/ViewRenamer/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.2023.1.2")] -[assembly: AssemblyFileVersion("1.2023.1.2")] +[assembly: AssemblyVersion("1.2023.1.3")] +[assembly: AssemblyFileVersion("1.2023.1.3")] diff --git a/ViewRenamer/ViewRenamer.cs b/ViewRenamer/ViewRenamer.cs index 1b4c2a0..690cf9d 100644 --- a/ViewRenamer/ViewRenamer.cs +++ b/ViewRenamer/ViewRenamer.cs @@ -193,16 +193,16 @@ private void LoadEntities() log.LogData(EventType.Exception, LogAction.LoadEntities, args.Error); } - lvEntities.BeginUpdate(); - foreach(var entity in entities) + lvEntities.ItemChecked -= lvEntities_ItemChecked; + List cbItems = new List(); + cbItems.AddRange(entities.Select(entity => new ListViewItem() { - lvEntities.Items.Add(new ListViewItem() - { - Text = entity.displayName, - Tag = entity.logicalName - }); - } - lvEntities.EndUpdate(); + Text = entity.displayName, + Tag = entity.logicalName + })); + + lvEntities.Items.AddRange(cbItems.ToArray()); + lvEntities.ItemChecked += lvEntities_ItemChecked; foreach (var language in languages.OrderBy(x => x)) { @@ -284,28 +284,28 @@ private void tsbSaveViews_Click(object sender, EventArgs e) private void tbFilter_TextChanged(object sender, EventArgs e) { - if (tbFilter.Text != "" && tbFilter.Text.Length < 3) + if (tbFilter.Text == "" ) return; lvEntities.Items.Clear(); var newList = entities.Where(x => x.displayName.ToLower().Contains(tbFilter.Text.ToLower())); - lvEntities.BeginUpdate(); - foreach (var entity in newList) + lvEntities.ItemChecked -= lvEntities_ItemChecked; + List cbItems = new List(); + cbItems.AddRange(newList.Select(entity => new ListViewItem() { - lvEntities.Items.Add(new ListViewItem() - { - Text = entity.displayName, - Tag = entity.logicalName - }); - } - lvEntities.EndUpdate(); + Text = entity.displayName, + Tag = entity.logicalName + }).ToArray()); + + lvEntities.Items.AddRange(cbItems.ToArray()); + lvEntities.ItemChecked += lvEntities_ItemChecked; } private void tbFilter_Click(object sender, EventArgs e) { - /* if (tbFilter.Text.ToLower() == "search in tables ...") - tbFilter.Text = "";*/ + if (tbFilter.Text.ToLower() == "search in tables ...") + tbFilter.Text = ""; } private void SortListView(ListView listView, int columnIndex, SortOrder? sort = null) diff --git a/ViewRenamer/ViewRenamer.designer.cs b/ViewRenamer/ViewRenamer.designer.cs index 0ce23a3..6562b36 100644 --- a/ViewRenamer/ViewRenamer.designer.cs +++ b/ViewRenamer/ViewRenamer.designer.cs @@ -232,6 +232,7 @@ private void InitializeComponent() this.tbFilter.Name = "tbFilter"; this.tbFilter.Size = new System.Drawing.Size(234, 20); this.tbFilter.TabIndex = 9; + this.tbFilter.Text = "Search in tables ..."; this.tbFilter.Click += new System.EventHandler(this.tbFilter_Click); this.tbFilter.TextChanged += new System.EventHandler(this.tbFilter_TextChanged); // diff --git a/ViewRenamer/ViewRenamer.nuspec b/ViewRenamer/ViewRenamer.nuspec index c1ce6b2..d5b4030 100644 --- a/ViewRenamer/ViewRenamer.nuspec +++ b/ViewRenamer/ViewRenamer.nuspec @@ -1,7 +1,7 @@  Carfup.XTBPlugins.ViewRenamer - 1.2023.1.2 + 1.2023.1.3 View Renamer Clement Olivier Clement Olivier @@ -11,6 +11,9 @@ If you want to rename your views in several languages in few clicks, this is the tool you are looking for ! Rename your views in few clicks. +1.2023.1.3 +Loading of tables is now almost instant along with the search. + 1.2023.1.2 Fix the search in tables Fix the view loading for the correct table while 2 tables had the same display name