-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFormUpdater.cs
47 lines (42 loc) · 1.52 KB
/
FormUpdater.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
using System;
using System.Windows.Forms;
namespace VulkanParser
{
/// <summary>
/// Description of FormUpdater.
/// </summary>
public static class FormUpdater
{
public static void UpdateText(string text)
{
((MainForm)Application.OpenForms[0]).Invoke(jamon, new object[]{text+"\r\n"}); //UpdateFormtext, new string[]{""});
}
public static void UpdateProgress(int cant)
{
((MainForm)Application.OpenForms[0]).Invoke(jamon2, new object[]{(int)cant}); //UpdateFormtext, new string[]{""});
}
public static void UpdateCompilerText(string text)
{
((MainForm)Application.OpenForms[0]).Invoke(jamon3, new object[]{text+"\r\n"}); //UpdateFormtext, new string[]{""});
}
private static UpdateFormtext jamon = UpdateFtext;
private static UpdateFormProgress jamon2 = UpdateFProgress;
private static UpdateFormCompilerText jamon3 = UpdateFCompilerText;
private static void UpdateFtext(string text)
{
((MainForm)Application.OpenForms[0]).richTextBox1.AppendText(text);
((MainForm)Application.OpenForms[0]).richTextBox1.ScrollToCaret();
}
private static void UpdateFProgress(int cant)
{
((MainForm)Application.OpenForms[0]).SetValue((int)cant);
}
private static void UpdateFCompilerText(string text)
{
((MainForm)Application.OpenForms[0]).textBoxExit.Text = text;
}
}
public delegate void UpdateFormtext(string text);
public delegate void UpdateFormProgress(int cant);
public delegate void UpdateFormCompilerText(string text);
}