-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCUIOutput.cs
68 lines (56 loc) · 2.21 KB
/
CUIOutput.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
using System;
using System.Collections.Generic;
using System.Text;
namespace TeX2img {
class CUIOutput : IOutputController {
bool quiet = false;
public CUIOutput(bool q) { quiet = q; }
public CUIOutput() { }
public void showPathError(string exeName, string necessary) {
Console.WriteLine(String.Format(Properties.Resources.PATHERROR, exeName, necessary));
}
public void showNoToolError(string item, string tool) {
Console.WriteLine(string.Format(Properties.Resources.NOTOOLERROR, item, tool));
}
public void showExtensionError(string file) {
Console.WriteLine(String.Format(Properties.Resources.INVALID_EXTENSION, file));
}
public void appendOutput(string log) {
if(!quiet) Console.Write(log);
}
public void showGenerateError() {
Console.WriteLine(Properties.Resources.GENERATEERROR);
}
public void scrollOutputTextBoxToEnd() {
}
public void showUnauthorizedError(string filePath) {
Console.WriteLine(String.Format(Properties.Resources.AUTHORIZEDERROR, filePath));
}
public void showIOError(string filePath) {
Console.WriteLine(String.Format(Properties.Resources.IOERROR, filePath));
}
public void showError(string msg) {
Console.WriteLine(msg);
}
public bool askYesorNo(string msg) {
Console.WriteLine(msg + "(y/n)");
while(true) {
var s = Console.ReadLine().ToLower();
switch(s) {
case "y": return true;
case "n": return false;
default:
Console.WriteLine(Properties.Resources.PUSHYORN);
break;
}
}
}
public void showToolError(string tool) {
var path = System.IO.Path.Combine(Converter.ShortToolPath, tool);
Console.WriteLine(String.Format(Properties.Resources.TOOLERROR, path, Converter.ShortToolPath));
}
public void errorIgnoredWarning() {
Console.WriteLine(Properties.Resources.IGNOREDERRORWARNING);
}
}
}