Skip to content

Commit

Permalink
Merge pull request #2 from carfup/release
Browse files Browse the repository at this point in the history
Release v1.2023.1.2
  • Loading branch information
carfup authored Jan 17, 2023
2 parents 69b0f9a + 5c37e9a commit 9a2fbed
Show file tree
Hide file tree
Showing 7 changed files with 134 additions and 127 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

If you want to rename your views in several languages in few clicks, this is the tool you are looking for !
#### How to use the plugin :
![](https://raw.githubusercontent.com/carfup/XTBPlugins.ViewRenamer/dev/XTBPlugins.ViewRenamer/Resources/screenshot.png)
![](https://raw.githubusercontent.com/carfup/XTBPlugins.ViewRenamer/master/ViewRenamer/Resources/screenshot.png)
2 changes: 1 addition & 1 deletion ViewRenamer/AppCode/DataManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public List<EntityDetailledName> LoadEntities()
});
}*/

return edn;
return edn.OrderBy(x => x.displayName).ToList();
}

public List<Entity> RetrieveViews(string[] objectTypeCode)
Expand Down
4 changes: 2 additions & 2 deletions ViewRenamer/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.2022.12.1")]
[assembly: AssemblyFileVersion("1.2022.12.1")]
[assembly: AssemblyVersion("1.2023.1.2")]
[assembly: AssemblyFileVersion("1.2023.1.2")]
Binary file modified ViewRenamer/Resources/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 23 additions & 19 deletions ViewRenamer/ViewRenamer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ private void GetViewsForSelectedEntities()
MessageBox.Show("you need to select table(s) in order to load the related views.", "No tables selected.", MessageBoxButtons.OK, MessageBoxIcon.Warning);

foreach (ListViewItem entity in lvEntities.CheckedItems)
selectedItems.Add(entity.Text);
selectedItems.Add(entity.Tag.ToString());

var entityCode = entities.Where(x => selectedItems.Contains(x.displayName)).Select(x => x.logicalName).ToArray();
var entityCode = entities.Where(x => selectedItems.Contains(x.logicalName)).Select(x => x.logicalName).ToArray();
crmViews = new List<CrmView>();


Expand Down Expand Up @@ -193,14 +193,16 @@ private void LoadEntities()
log.LogData(EventType.Exception, LogAction.LoadEntities, args.Error);
}

List<ListViewItem> cbItems = new List<ListViewItem>();
cbItems.AddRange(entities.Select(entity => new ListViewItem()
lvEntities.BeginUpdate();
foreach(var entity in entities)
{
Text = entity.displayName,
Tag = entity.logicalName
}));

lvEntities.Items.AddRange(cbItems.ToArray());
lvEntities.Items.Add(new ListViewItem()
{
Text = entity.displayName,
Tag = entity.logicalName
});
}
lvEntities.EndUpdate();

foreach (var language in languages.OrderBy(x => x))
{
Expand Down Expand Up @@ -282,26 +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 != "" && tbFilter.Text.Length < 3)
return;

lvEntities.Items.Clear();
var newList = entities.Where(x => x.displayName.ToLower().Contains(tbFilter.Text.ToLower()));

List<ListViewItem> cbItems = new List<ListViewItem>();
cbItems.AddRange(newList.Select(entity => new ListViewItem()
lvEntities.BeginUpdate();
foreach (var entity in newList)
{
Text = entity.displayName,
Tag = entity.logicalName
}));

lvEntities.Items.AddRange(cbItems.ToArray());
lvEntities.Items.Add(new ListViewItem()
{
Text = entity.displayName,
Tag = entity.logicalName
});
}
lvEntities.EndUpdate();
}

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)
Expand Down
Loading

0 comments on commit 9a2fbed

Please sign in to comment.