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

77 lines
2.5 KiB
C#
Raw Normal View History

2024-09-06 00:43:56 +04:00
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;
2024-10-06 18:45:39 +04:00
using Controls.Models;
using MigraDoc.DocumentObjectModel;
2024-09-06 00:43:56 +04:00
namespace Forms
{
public partial class FormMain : Form
{
public FormMain()
{
InitializeComponent();
2024-10-07 11:33:14 +04:00
2024-09-06 00:43:56 +04:00
}
2024-10-06 18:45:39 +04:00
2024-10-07 11:33:14 +04:00
private void buttonLargeText_CLick(object sender, EventArgs e)
2024-09-06 00:43:56 +04:00
{
2024-10-22 22:16:45 +04:00
string[] strings = new string[] { "aboba",
"тут я пишу супер много текста( ну или не супер много ) для сдачи",
"best aboba",
"гружу сюда супер большой тексттттт" };
largeTextComponent1.CreateDocument("C:\\Ulstu\\COP\\Cop_25\\Controls\\docs\\text.pdf",
"OMEGA LABA 2", strings);
2024-09-06 00:43:56 +04:00
}
2024-10-06 18:45:39 +04:00
2024-10-07 11:33:14 +04:00
private void buttonCreateTable_Click(object sender, EventArgs e)
2024-09-06 00:43:56 +04:00
{
2024-10-06 18:45:39 +04:00
List<ColumnInfo> columnInfos = new List<ColumnInfo>()
2024-09-06 00:43:56 +04:00
{
2024-10-06 18:45:39 +04:00
new ColumnInfo("FirstName","Имя",50),
new ColumnInfo("LastName","Фамилия",100),
2024-10-07 11:33:14 +04:00
new ColumnInfo("Age","Возраст",75),
2024-10-06 18:45:39 +04:00
};
List<MergeCells> mergeCells = new List<MergeCells>()
2024-09-06 00:43:56 +04:00
{
2024-10-22 22:16:45 +04:00
new MergeCells("Данные", new int[] {0,2,2})
2024-10-06 18:45:39 +04:00
};
2024-09-06 00:43:56 +04:00
2024-10-06 18:45:39 +04:00
List<Person> people = new List<Person>()
{
new Person("aboba", "not aboba", "19"),
new Person("aboba2", "not aboba2", "25"),
new Person("aboba3", "not aboba3", "20"),
};
2024-10-22 22:16:45 +04:00
tableComponent1.CreateTable("C:\\Ulstu\\COP\\Cop_25\\Controls\\docs\\table.pdf",
"TABLE LUTI", mergeCells, columnInfos, people);
2024-09-06 00:43:56 +04:00
}
2024-10-06 17:39:02 +04:00
2024-10-06 18:45:39 +04:00
private void buttonDiagram_Click(object sender, EventArgs e)
2024-10-06 17:39:02 +04:00
{
2024-10-06 18:45:39 +04:00
Dictionary<string, List<Double>> data = new Dictionary<string, List<Double>>();
2024-10-07 11:33:14 +04:00
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 });
2024-10-06 18:45:39 +04:00
2024-10-22 22:16:45 +04:00
diagramComponent1.CreateLineDiagram("C:\\Ulstu\\COP\\Cop_25\\Controls\\docs\\diagram.pdf",
"ZAGOLOVOK", "LINEYNAYA", data, LegendAlign.bottom);
2024-10-06 17:39:02 +04:00
}
2024-10-07 11:33:14 +04:00
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
2024-09-06 00:43:56 +04:00
}
}