2023-10-06 02:36:27 +04:00
|
|
|
|
using ViewComponents.Exeption;
|
|
|
|
|
|
|
|
|
|
namespace TestView
|
|
|
|
|
{
|
|
|
|
|
public partial class Form1 : Form
|
|
|
|
|
{
|
|
|
|
|
public Form1()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void buttonAdd_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
|
2023-10-15 20:05:17 +04:00
|
|
|
|
list_with_choice.Fill_List("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
list_with_choice.Fill_List("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
list_with_choice.Fill_List("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
list_with_choice.Fill_List("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
2023-10-06 02:36:27 +04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void buttonClear_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
list_with_choice.Clean_List();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void buttonSelect_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show(list_with_choice.Element ?? "null", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void list_with_choice_SelectedItemChange(string obj)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show(obj, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void buttonDip_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
input_text.MinLen = 5;
|
|
|
|
|
input_text.MaxLen = 25;
|
|
|
|
|
|
2023-10-15 20:05:17 +04:00
|
|
|
|
MessageBox.Show($"Min: {input_text.MinLen}; Max: {input_text.MaxLen}");
|
2023-10-06 02:36:27 +04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void buttonVal_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2023-10-15 20:05:17 +04:00
|
|
|
|
input_text.Element = "Sample text";
|
2023-10-06 02:36:27 +04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void input_text_ItemChange(string obj)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show(obj, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void buttonCheck_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
2023-10-15 20:05:17 +04:00
|
|
|
|
if (input_text.Element.Equals("Range exeption"))
|
|
|
|
|
throw new TextBoundsNotSetExeption("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
if (input_text.Element.Equals("Value exeption"))
|
|
|
|
|
throw new TextOutOfBoundsExeption("<22><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
|
|
|
|
|
MessageBox.Show(input_text.Element, "<22><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
2023-10-06 02:36:27 +04:00
|
|
|
|
}
|
|
|
|
|
catch (TextBoundsNotSetExeption ex)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show(ex.Message);
|
|
|
|
|
}
|
|
|
|
|
catch (TextOutOfBoundsExeption ex)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show(ex.Message);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void buttonIerarhy_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
myTreeView.setHierarchy(new List<(string, bool)> { ("Genre", false), ("Author", false), ("Title", true) });
|
|
|
|
|
MessageBox.Show("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void buttonAddBook_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
myTreeView.addItem(new Book("<22><><EFBFBD><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>.<2E>.", "̸<><CCB8><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>"));
|
|
|
|
|
myTreeView.addItem(new Book("<22><><EFBFBD><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>.<2E>.", "<22><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>"));
|
|
|
|
|
myTreeView.addItem(new Book("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "1984"));
|
2023-10-06 02:50:26 +04:00
|
|
|
|
myTreeView.addItem(new Book("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"));
|
2023-10-06 02:36:27 +04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void buttonGetValue_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Book? book = myTreeView.getSelecetedNodeValue<Book>();
|
|
|
|
|
if (book == null) return;
|
|
|
|
|
MessageBox.Show("<22><><EFBFBD><EFBFBD>: " + book.Genre + ", <20><><EFBFBD><EFBFBD><EFBFBD>: " + book.Author + ", <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: " + book.Title);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void buttonGetIndex_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show(myTreeView.SelectedNodeIndex.ToString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void buttonSetIndex_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2023-10-15 20:05:17 +04:00
|
|
|
|
myTreeView.SelectedNodeIndex = 1;
|
2023-10-06 02:36:27 +04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Form1_Load(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|