Tweak
This commit is contained in:
parent
7fafee804d
commit
452ceef285
2 changed files with 8 additions and 9 deletions
|
|
@ -5,7 +5,6 @@ using System.IO;
|
|||
using System.Windows.Forms;
|
||||
using Dinah.Core;
|
||||
using LibationFileManager;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace LibationWinForms.Dialogs
|
||||
{
|
||||
|
|
@ -60,7 +59,7 @@ namespace LibationWinForms.Dialogs
|
|||
|
||||
// populate list view
|
||||
foreach (var tag in template.GetTemplateTags())
|
||||
listView1.Items.Add(new System.Windows.Forms.ListViewItem(new[] { $"<{tag.TagName}>", tag.Description }));
|
||||
listView1.Items.Add(new ListViewItem(new[] { $"<{tag.TagName}>", tag.Description }));
|
||||
}
|
||||
|
||||
private void resetToDefaultBtn_Click(object sender, EventArgs e) => resetTextBox(template.DefaultTemplate);
|
||||
|
|
@ -201,13 +200,13 @@ namespace LibationWinForms.Dialogs
|
|||
|
||||
private void listView1_DoubleClick(object sender, EventArgs e)
|
||||
{
|
||||
var item = listView1.SelectedItems[0];
|
||||
var itemText = listView1.SelectedItems[0].Text.Replace("...", "");
|
||||
var text = templateTb.Text;
|
||||
|
||||
var selStart = Math.Min(Math.Max(0, templateTb.SelectionStart), text.Length);
|
||||
|
||||
templateTb.Text = text.Insert(selStart, item.Text);
|
||||
templateTb.SelectionStart = selStart + item.Text.Length;
|
||||
templateTb.Text = text.Insert(selStart, itemText);
|
||||
templateTb.SelectionStart = selStart + itemText.Length;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue