2024-09-22 13:24:14 +04:00
|
|
|
|
using RodionovLibrary.NonVisualComponents.HelperModels;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
2024-09-05 19:32:10 +04:00
|
|
|
|
namespace WinForms
|
|
|
|
|
{
|
2024-09-05 23:36:10 +04:00
|
|
|
|
public partial class FormTest : Form
|
2024-09-05 19:32:10 +04:00
|
|
|
|
{
|
2024-09-05 23:36:10 +04:00
|
|
|
|
public FormTest()
|
2024-09-05 19:32:10 +04:00
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2024-09-21 11:26:26 +04:00
|
|
|
|
comboBoxControl.AddItems(new List<string> { "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 2", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 3", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 4", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 5" });
|
|
|
|
|
|
|
|
|
|
textBoxControl.Pattern = @"^[a-z0-9._%+-]+\@([a-z0-9-]+\.)+[a-z]{2,4}$";
|
|
|
|
|
textBoxControl.SetTooltipText("example@gmail.com");
|
|
|
|
|
|
|
|
|
|
listBoxControl.SetParams("<22><><EFBFBD>: {FirstName}, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: {LastName}. {Gender} ({Age}) <20><><EFBFBD>.", '{', '}');
|
|
|
|
|
listBoxControl.AddItems(new List<Person> { new() { FirstName = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", LastName = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", Age = 23, Gender = "<22><><EFBFBD>" },
|
|
|
|
|
new() { FirstName = "<22><><EFBFBD><EFBFBD><EFBFBD>", LastName = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", Age = 18, Gender = "<22><><EFBFBD>" },
|
|
|
|
|
new() { FirstName = "<22><><EFBFBD>", LastName = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", Age = 40, Gender = "<22><><EFBFBD>" } });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ButtonClear_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
comboBoxControl.Clear();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ButtonGetComboBox_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show(comboBoxControl.SelectedValue, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ButtonSetComboBox_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
comboBoxControl.SelectedValue = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 3";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ButtonGetTextBox_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show(textBoxControl.Value, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ButtonSetTextBox_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
textBoxControl.Value = "forum98761@gmail.com";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ButtonSetWrongTextBox_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
textBoxControl.Value = "smth";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ButtonGetObject_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Person? selectedPerson = listBoxControl.GetObject<Person>();
|
|
|
|
|
if (selectedPerson == null)
|
|
|
|
|
MessageBox.Show("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
MessageBox.Show($"<22><><EFBFBD>: {selectedPerson?.FirstName}, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: {selectedPerson?.LastName}, " +
|
|
|
|
|
$"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: {selectedPerson?.Age}, <20><><EFBFBD>: {selectedPerson?.Gender}");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ButtonGetIndex_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show(listBoxControl.SelectedIndex.ToString(), "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ButtonSetIndex_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
listBoxControl.SelectedIndex = 0;
|
2024-09-05 19:32:10 +04:00
|
|
|
|
}
|
2024-09-22 13:24:14 +04:00
|
|
|
|
|
|
|
|
|
private void ButtonWordText_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
wordLongTextComponent.CreateWordText(new WordLongTextInfo()
|
|
|
|
|
{
|
2024-09-22 23:29:54 +04:00
|
|
|
|
FileName = AppDomain.CurrentDomain.BaseDirectory + "test_long_text.docx",
|
2024-09-22 13:24:14 +04:00
|
|
|
|
Title = "<22><><EFBFBD><EFBFBD><EFBFBD> 1. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>",
|
|
|
|
|
Paragraphs = new string[] { "<22><><EFBFBD>-<2D><><EFBFBD> <20> <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><> <20> <20><><EFBFBD><EFBFBD><EFBFBD>-<2D><> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>, <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><> <20> <20><> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>, <20><><EFBFBD> <20><> <20><> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD>, <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.",
|
|
|
|
|
"<22><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.",
|
|
|
|
|
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><> <20><> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>), <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>), <20><><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20>, <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>, <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.",
|
|
|
|
|
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>, <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> <20> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>."}
|
|
|
|
|
});
|
|
|
|
|
MessageBox.Show("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!");
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: " + ex.Message, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void ButtonWordTable_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2024-09-22 23:29:54 +04:00
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var firstRowColumns = new List<ColumnParameters>
|
|
|
|
|
{
|
|
|
|
|
new() { Header = "<22><><EFBFBD><EFBFBD><EFBFBD>", PropertyName = "", Width = 1.2 },
|
|
|
|
|
new() { Header = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", PropertyName = "", Width = 1.2 },
|
|
|
|
|
new() { Header = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", PropertyName = "", Width = 1.6 },
|
2024-09-23 13:56:22 +04:00
|
|
|
|
new() { Header = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", PropertyName = "", Width = 1.6 },
|
|
|
|
|
new() { Header = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", PropertyName = "", Width = 1.6 },
|
2024-09-22 23:29:54 +04:00
|
|
|
|
new() { Header = "<22><><EFBFBD><EFBFBD>", PropertyName = "", Width = 1.2 },
|
|
|
|
|
new() { Header = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", PropertyName = "", Width = 1.6 },
|
|
|
|
|
new() { Header = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", PropertyName = "", Width = 2.5 },
|
2024-09-23 13:56:22 +04:00
|
|
|
|
new() { Header = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", PropertyName = "", Width = 2.5 },
|
2024-09-22 23:29:54 +04:00
|
|
|
|
new() { Header = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", PropertyName = "", Width = 2 }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var secondRowColumns = new List<ColumnParameters>
|
|
|
|
|
{
|
|
|
|
|
new() { Header = "<22><><EFBFBD><EFBFBD><EFBFBD>", PropertyName = "Id", Width = 1.2 },
|
|
|
|
|
new() { Header = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", PropertyName = "Status", Width = 1.2 },
|
|
|
|
|
new() { Header = "<22><><EFBFBD>", PropertyName = "FirstName", Width = 1.6 },
|
|
|
|
|
new() { Header = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", PropertyName = "LastName", Width = 1.6 },
|
|
|
|
|
new() { Header = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", PropertyName = "Age", Width = 1.6 },
|
|
|
|
|
new() { Header = "<22><><EFBFBD><EFBFBD>", PropertyName = "Children", Width = 1.2 },
|
|
|
|
|
new() { Header = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", PropertyName = "Car", Width = 1.6 },
|
|
|
|
|
new() { Header = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", PropertyName = "Department", Width = 2.5 },
|
|
|
|
|
new() { Header = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", PropertyName = "Position", Width = 2.5 },
|
|
|
|
|
new() { Header = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", PropertyName = "Bonus", Width = 2 }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var employees = new List<Employee>
|
|
|
|
|
{
|
|
|
|
|
new() { Id = 1, Status = "<22><><EFBFBD>", FirstName = "<22><><EFBFBD><EFBFBD>", LastName = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", Age = 34, Children = "<22><><EFBFBD>", Car = "<22><><EFBFBD><EFBFBD>", Department = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1", Position = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", Bonus = 2000.1 },
|
|
|
|
|
new() { Id = 2, Status = "<22><><EFBFBD>", FirstName = "<22><><EFBFBD><EFBFBD>", LastName = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", Age = 44, Children = "<22><><EFBFBD><EFBFBD>", Car = "<22><><EFBFBD><EFBFBD>", Department = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1", Position = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", Bonus = 2000.1 },
|
|
|
|
|
new() { Id = 3, Status = "<22><>", FirstName = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", LastName = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", Age = 55, Children = "<22><><EFBFBD>", Car = "<22><><EFBFBD>", Department = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1", Position = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", Bonus = 5000.5 },
|
|
|
|
|
new() { Id = 4, Status = "<22><><EFBFBD>", FirstName = "<22><><EFBFBD><EFBFBD><EFBFBD>", LastName = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", Age = 34, Children = "<22><><EFBFBD><EFBFBD>", Car = "<22><><EFBFBD>", Department = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", Position = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", Bonus = 2000.1 },
|
|
|
|
|
new() { Id = 5, Status = "<22><>", FirstName = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", LastName = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", Age = 44, Children = "<22><><EFBFBD>", Car = "<22><><EFBFBD>", Department = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", Position = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", Bonus = 7000.6 }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var mergedColumns = new List<(int, int)>
|
|
|
|
|
{
|
|
|
|
|
(2, 4),
|
|
|
|
|
(7, 8)
|
|
|
|
|
};
|
2024-09-22 13:24:14 +04:00
|
|
|
|
|
2024-09-22 23:29:54 +04:00
|
|
|
|
var tableInfo = new WordTableInfo<Employee>
|
|
|
|
|
{
|
|
|
|
|
FileName = AppDomain.CurrentDomain.BaseDirectory + "test_table.docx",
|
|
|
|
|
Title = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
|
|
|
|
FirstRowColumnParameters = firstRowColumns,
|
|
|
|
|
SecondRowColumnParameters = secondRowColumns,
|
|
|
|
|
Items = employees,
|
|
|
|
|
MergedColumns = mergedColumns
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
wordTableComponent.CreateTable(tableInfo);
|
|
|
|
|
|
|
|
|
|
MessageBox.Show("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!");
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: " + ex.Message, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
|
|
|
}
|
2024-09-22 13:24:14 +04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ButtonWordDiagram_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2024-09-22 23:29:54 +04:00
|
|
|
|
try
|
|
|
|
|
{
|
2024-09-22 13:24:14 +04:00
|
|
|
|
|
2024-09-22 23:29:54 +04:00
|
|
|
|
MessageBox.Show("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!");
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: " + ex.Message, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
|
|
|
}
|
2024-09-22 13:24:14 +04:00
|
|
|
|
}
|
2024-09-05 19:32:10 +04:00
|
|
|
|
}
|
|
|
|
|
}
|