markus / ConvertService / ConverterService / ImageFields / DZTEvents.cs @ 54a28343
이력 | 보기 | 이력해설 | 다운로드 (3.46 KB)
1 |
using System; |
---|---|
2 |
using System.Collections.Generic; |
3 |
using System.Linq; |
4 |
using System.Text; |
5 |
using System.IO; |
6 |
|
7 |
namespace ImageFields |
8 |
{ |
9 |
public class DZTEvents |
10 |
{ |
11 |
// Events |
12 |
public event EventHandler<DirectoryEventArgs> CreateDirectory; |
13 |
|
14 |
public event EventHandler<StreamEventArgs> InputCompleted; |
15 |
|
16 |
public event EventHandler<ImageInfoEventArgs> InputImageInfo; |
17 |
|
18 |
public event EventHandler<StreamEventArgs> InputNeeded; |
19 |
|
20 |
public event EventHandler<StreamEventArgs> OutputCompleted; |
21 |
|
22 |
public event EventHandler<OutputInfoEventArgs> OutputInfo; |
23 |
|
24 |
public event EventHandler<StreamEventArgs> OutputNeeded; |
25 |
|
26 |
// Methods |
27 |
internal virtual bool HasCreateDirectoryHandler() |
28 |
{ |
29 |
return (this.CreateDirectory != null); |
30 |
} |
31 |
|
32 |
internal virtual bool HasInputCompletedHandler() |
33 |
{ |
34 |
return (this.InputCompleted != null); |
35 |
} |
36 |
|
37 |
internal virtual bool HasInputImageInfoHandler() |
38 |
{ |
39 |
return (this.InputImageInfo != null); |
40 |
} |
41 |
|
42 |
internal virtual bool HasInputNeededHandler() |
43 |
{ |
44 |
return (this.InputNeeded != null); |
45 |
} |
46 |
|
47 |
internal virtual bool HasOutputCompletedHandler() |
48 |
{ |
49 |
return (this.OutputCompleted != null); |
50 |
} |
51 |
|
52 |
internal virtual bool HasOutputInfoHandler() |
53 |
{ |
54 |
return (this.OutputInfo != null); |
55 |
} |
56 |
|
57 |
internal virtual bool HasOutputNeededHandler() |
58 |
{ |
59 |
return (this.OutputNeeded != null); |
60 |
} |
61 |
|
62 |
internal void OnCreateDirectory(DirectoryEventArgs e) |
63 |
{ |
64 |
EventHandler<DirectoryEventArgs> createDirectory = this.CreateDirectory; |
65 |
if (createDirectory == null) |
66 |
{ |
67 |
Directory.CreateDirectory(e.DirectoryName); |
68 |
} |
69 |
else |
70 |
{ |
71 |
createDirectory(this, e); |
72 |
} |
73 |
} |
74 |
|
75 |
internal void OnInputCompleted(StreamEventArgs e) |
76 |
{ |
77 |
EventHandler<StreamEventArgs> inputCompleted = this.InputCompleted; |
78 |
if (inputCompleted != null) |
79 |
{ |
80 |
inputCompleted(this, e); |
81 |
} |
82 |
} |
83 |
|
84 |
internal void OnInputImageInfo(ImageInfoEventArgs e) |
85 |
{ |
86 |
EventHandler<ImageInfoEventArgs> inputImageInfo = this.InputImageInfo; |
87 |
if (inputImageInfo != null) |
88 |
{ |
89 |
inputImageInfo(this, e); |
90 |
} |
91 |
} |
92 |
|
93 |
internal void OnInputNeeded(StreamEventArgs e) |
94 |
{ |
95 |
EventHandler<StreamEventArgs> inputNeeded = this.InputNeeded; |
96 |
if (inputNeeded != null) |
97 |
{ |
98 |
inputNeeded(this, e); |
99 |
} |
100 |
} |
101 |
|
102 |
internal void OnOutputCompleted(StreamEventArgs e) |
103 |
{ |
104 |
EventHandler<StreamEventArgs> outputCompleted = this.OutputCompleted; |
105 |
if (outputCompleted != null) |
106 |
{ |
107 |
outputCompleted(this, e); |
108 |
} |
109 |
} |
110 |
|
111 |
internal void OnOutputInfo(OutputInfoEventArgs e) |
112 |
{ |
113 |
EventHandler<OutputInfoEventArgs> outputInfo = this.OutputInfo; |
114 |
if (outputInfo != null) |
115 |
{ |
116 |
outputInfo(this, e); |
117 |
} |
118 |
} |
119 |
|
120 |
internal void OnOutputNeeded(StreamEventArgs e) |
121 |
{ |
122 |
EventHandler<StreamEventArgs> outputNeeded = this.OutputNeeded; |
123 |
if (outputNeeded != null) |
124 |
{ |
125 |
outputNeeded(this, e); |
126 |
} |
127 |
} |
128 |
} |
129 |
|
130 |
|
131 |
|
132 |
} |