-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
63 lines (53 loc) · 2.04 KB
/
Program.cs
File metadata and controls
63 lines (53 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
using System;
using System.Collections.Generic;
using System.IO;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using System.Windows.Forms;
using TreeLife.Models;
using TreeLife.Enum;
using TreeLife.Interface;
using TreeLife.Views2;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
using System.Reflection;
namespace TreeLife
{
internal static class Program
{
[DllImport("kernel32.dll")]
static extern bool AllocConsole(); // Permet d'ouvrir la console
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
// *************************************************************************** BACKEND PART
//Récupération des paths pour les fichiers CSV
string projectDirectory = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.FullName;
string linkFile = Path.Combine(projectDirectory, "TreeLife/treeoflife_links.csv");
string nodeFile = Path.Combine(projectDirectory, "TreeLife/treeoflife_nodes.csv");
//AllocConsole();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
// ******* Model
Model treeLifeModel = new Model(linkFile:linkFile, nodeFile:nodeFile);
// ******* Controller
Controller treeLifeController = new Controller(treeLifeModel);
// *************************************************************************** FRONTEND PART
const int appWidth = 1100;
const int appHeight = 700;
// mainFrom
Form mainForm = new Form
{
Text = "Tree of Life",
Size = new System.Drawing.Size(appWidth, appHeight)
};
// ******* View
new TreeLifeView(treeLifeController, mainForm);
Application.Run(mainForm);
}
}
}