-
Notifications
You must be signed in to change notification settings - Fork 0
/
GxConsoleHandler.cs
69 lines (55 loc) · 1.94 KB
/
GxConsoleHandler.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
using Artech.Architecture.Common.Services;
using System.Collections;
namespace GUG.Packages.KBCodeReview
{
static class GxConsoleHandler
{
private static string OutputId = "General";
public static bool WriteOutput(string msg)
{
string consoleMsg = '[' + Resources.AppName + "]:" + msg;
IOutputService output = InitializeGXOutput();
output.AddLine(consoleMsg);
return true;
}
// THIS MUST BE SEPARATED FROM HERE
public static void GitConsoleWriter(ArrayList lines,string title,bool success)
{
IOutputService output = InitializeGXOutput();
GXWrtStartConsole(output, title);
foreach (string ln in lines)
{
GXWrtLineConsole(output, ln);
}
GXEndOutputSection(output, title, success);
}
public static void GitAlreadyInitiated(string result) {
IOutputService output = InitializeGXOutput();
GXWrtLineConsole(output, result);
}
//------------------------------------------------------------------------------
private static IOutputService InitializeGXOutput()
{
IOutputService output = CommonServices.Output;
output.SelectOutput(OutputId);
return output;
}
private static void GXWrtStartConsole(IOutputService output,string text)
{
output.StartSection(text);
}
public static void GXWrtLineConsole(IOutputService output, string text)
{
if (output == null)
{
output = CommonServices.Output;
}
output.AddLine(text);
}
public static void GXEndOutputSection(IOutputService output,string title,bool success)
{
output.EndSection(title, success);
output.UnselectOutput(OutputId);
}
}
}