PIbd-31_Malafeev.L.S._COP_25/Cop_25/Forms/FormMain.cs

96 lines
3.5 KiB
C#

using Controls;
using Controls.Exceptions;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Controls.Models;
using MigraDoc.DocumentObjectModel;
namespace Forms
{
public partial class FormMain : Form
{
public FormMain()
{
InitializeComponent();
List<Person> people = new List<Person>()
{
new Person("aboba", "not aboba", "19"),
new Person("aboba2", "not aboba2", "25"),
new Person("aboba3", "not aboba3", "20"),
};
customListBox1.setTemplate("Дорогой дневниов чтобы описать всю {FirstName} {LastName} возраста {Age}", "{", "}");
customListBox1.FillProperty(people[0], 0, "FirstName");
customListBox1.FillProperty(people[0], 0, "LastName");
customListBox1.FillProperty(people[0], 0, "Age");
customListBox1.FillProperty(people[1], 1, "FirstName");
customListBox1.FillProperty(people[1], 1, "LastName");
customListBox1.FillProperty(people[1], 1, "Age");
customListBox1.FillProperty(people[2], 2, "FirstName");
customListBox1.FillProperty(people[2], 2, "LastName");
customListBox1.FillProperty(people[2], 2, "Age");
}
private void buttonLargeText_CLick(object sender, EventArgs e)
{
string[] strings = new string[] { "aboba",
"тут я пишу супер много текста( ну или не супер много ) для сдачи",
"best aboba",
"гружу сюда супер большой тексттттт" };
largeTextComponent1.CreateDocument("C:\\Ulstu\\COP\\Cop_25\\Controls\\docs\\text.pdf",
"OMEGA LABA 2", strings);
}
private void buttonCreateTable_Click(object sender, EventArgs e)
{
List<ColumnInfo> columnInfos = new List<ColumnInfo>()
{
new ColumnInfo("FirstName","Имя",50),
new ColumnInfo("LastName","Фамилия",100),
new ColumnInfo("Age","Возраст",75),
};
List<MergeCells> mergeCells = new List<MergeCells>()
{
new MergeCells("Данные", new int[] {0,2,2})
};
List<Person> people = new List<Person>()
{
new Person("aboba", "not aboba", "19"),
new Person("aboba2", "not aboba2", "25"),
new Person("aboba3", "not aboba3", "20"),
};
tableComponent1.CreateTable("C:\\Ulstu\\COP\\Cop_25\\Controls\\docs\\table.pdf",
"TABLE LUTI", mergeCells, columnInfos, people);
}
private void buttonDiagram_Click(object sender, EventArgs e)
{
Dictionary<string, List<Double>> data = new Dictionary<string, List<Double>>();
data.Add("aboba1", new List<double> { 12, 1, 2, 5, 2 });
data.Add("aboba2", new List<double> { 3, 2, 1, 3, 6 });
data.Add("aboba3", new List<double> { 7, 3, 1, 2, 5 });
diagramComponent1.CreateLineDiagram("C:\\Ulstu\\COP\\Cop_25\\Controls\\docs\\diagram.pdf",
"ZAGOLOVOK", "LINEYNAYA", data, LegendAlign.bottom);
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
}
}