Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScriptBlockOutputSubscriber.cs
More file actions
Latest commit
74 lines (64 loc) · 2.18 KB
/
Copy pathScriptBlockOutputSubscriber.cs
File metadata and controls
74 lines (64 loc) · 2.18 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
64
65
66
67
68
69
70
71
72
73
74
// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable UnusedMember.Global
namespacePSLogging
{
usingSystem.Management.Automation;
publicclassScriptBlockOutputSubscriber:HostIOSubscriberBase
{
publicScriptBlockOutputSubscriber(ScriptBlockonWriteOutput,
ScriptBlockonWriteDebug,
ScriptBlockonWriteVerbose,
ScriptBlockonWriteError,
ScriptBlockonWriteWarning)
{
OnWriteOutput=onWriteOutput;
OnWriteDebug=onWriteDebug;
OnWriteVerbose=onWriteVerbose;
OnWriteError=onWriteError;
OnWriteWarning=onWriteWarning;
}
publicScriptBlockOutputSubscriber():this(null,null,null,null,null){}
publicScriptBlockOnWriteDebug{get;set;}
publicScriptBlockOnWriteOutput{get;set;}
publicScriptBlockOnWriteError{get;set;}
publicScriptBlockOnWriteVerbose{get;set;}
publicScriptBlockOnWriteWarning{get;set;}
publicoverridevoidWriteDebug(stringmessage)
{
if(OnWriteDebug!=null)
{
OnWriteDebug.Invoke(message);
}
}
publicoverridevoidWriteError(stringmessage)
{
if(OnWriteError!=null)
{
OnWriteError.Invoke(message);
}
}
publicoverridevoidWriteOutput(stringmessage)
{
if(OnWriteOutput!=null)
{
OnWriteOutput.Invoke(message);
}
}
publicoverridevoidWriteVerbose(stringmessage)
{
if(OnWriteVerbose!=null)
{
OnWriteVerbose.Invoke(message);
}
}
publicoverridevoidWriteWarning(stringmessage)
{
if(OnWriteWarning!=null)
{
OnWriteWarning.Invoke(message);
}
}
}
}
// ReSharper restore MemberCanBePrivate.Global
// ReSharper restore UnusedMember.Global