-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSO.cs
90 lines (77 loc) · 2.76 KB
/
SO.cs
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
using System;
using System.Diagnostics;
using System.Security.Cryptography;
using Terminal.Gui;
class SO
{
public static void Dialog()
{
Application.Init();
var ColorSO = new ColorScheme()
{
Normal = Application.Driver.MakeAttribute(Color.White, Color.BrightBlue),
HotNormal = Application.Driver.MakeAttribute(Color.White, Color.Blue),
Focus = Application.Driver.MakeAttribute(Color.Blue, Color.White),
HotFocus = Application.Driver.MakeAttribute(Color.White, Color.Blue),
};
var SO_DIAG = new Dialog()
{
X = 0,
Y = 1, // Leave space for the title
Width = 65,
Height = 22,
ColorScheme = ColorSO
}; // Crea un nuovo dialogo
var frame = new FrameView("Sistema Operativo")
{
X = 0,
Y = 0,
Width = Dim.Fill(),
Height = Dim.Fill(),
CanFocus = true
};
var ASCIIART = new Label(
" ______ ______ \r\n /\\ ___\\ /\\ __ \\ \r\n \\ \\___ \\ \\ \\ \\/\\ \\ \r\n \\/\\_____\\ \\ \\_____\\ \r\n \\/_____/ \\/_____/ ")
{
X = 1,
Y = 1,
Width = Dim.Fill() - 1,
Height = Dim.Fill() - 2,
};
var SFC = new Button("SFC (Analizza integrità file di sistema)")
{
X = 5,
Y = 8,
};
SFC.Clicked += GOTOSFC;
void GOTOSFC(object sender, EventArgs e)
{
var SFC = new ProcessStartInfo
{
FileName = "powershell",
Arguments = "Start-Process -Verb RunAs powershell -ArgumentList 'sfc /scannow; Pause'",
UseShellExecute = true
};
Process.Start(SFC);
}
var DISM = new Button("DISM (Manutenzione immagini di sistema)")
{
X = 5,
Y = 10,
};
DISM.Clicked += GOTODISM;
void GOTODISM(object sender, EventArgs e)
{
var DISM = new ProcessStartInfo
{
FileName = "powershell",
Arguments = "Start-Process -Verb RunAs powershell -ArgumentList 'dism online cleanup-image restorehealth Loglevel2; Pause'",
UseShellExecute = true
};
Process.Start(DISM);
}
frame.Add(ASCIIART, SFC, DISM); // Aggiungi il pulsante al frame
SO_DIAG.Add(frame); // Aggiungi il frame al dialogo
Application.Run(SO_DIAG);
}
}