Widow – Diff between revs 18 and 21
?pathlinks?
Rev 18 | Rev 21 | |||
---|---|---|---|---|
Line 27... | Line 27... | |||
27 | public RuleEditForm RuleEditForm { get; set; } |
27 | public RuleEditForm RuleEditForm { get; set; } |
|
Line 28... | Line 28... | |||
28 | |
28 | |
|
Line 29... | Line 29... | |||
29 | public WindowManipulation WindowManipulation { get; set; } |
29 | public WindowManipulation WindowManipulation { get; set; } |
|
- | 30 | |
||
Line 30... | Line 31... | |||
30 | |
31 | public AboutForm AboutForm { get; set; } |
|
Line 31... | Line 32... | |||
31 | public AboutForm AboutForm { get; set; } |
32 | public LogForm LogForm { get; private set; } |
|
Line 130... | Line 131... | |||
130 | RuleEditForm = null; |
131 | RuleEditForm = null; |
|
Line 131... | Line 132... | |||
131 | |
132 | |
|
132 | switch (await WindowsSerialization.Serialize(Windows, "Windows.xml")) |
133 | switch (await WindowsSerialization.Serialize(Windows, "Windows.xml")) |
|
133 | { |
134 | { |
|
- | 135 | case SerializationSuccess serializationSuccess: |
||
- | 136 | if (LogForm != null) |
||
- | 137 | { |
||
- | 138 | LogForm.InvokeIfRequired(form => |
||
- | 139 | { |
||
- | 140 | form.logTextBox.Text += "Windows saved." + Environment.NewLine; |
||
- | 141 | }); |
||
134 | case SerializationSuccess serializationSuccess: |
142 | } |
|
135 | break; |
143 | break; |
|
- | 144 | case SerializationFailure serializationFailure: |
||
- | 145 | if (LogForm != null) |
||
- | 146 | { |
||
- | 147 | LogForm.InvokeIfRequired(form => |
||
- | 148 | { |
||
- | 149 | form.logTextBox.Text += "Failed to save windows: " + serializationFailure.Exception.Message + Environment.NewLine; |
||
- | 150 | }); |
||
136 | case SerializationFailure serializationFailure: |
151 | } |
|
137 | break; |
152 | break; |
|
138 | } |
153 | } |
|
Line 139... | Line 154... | |||
139 | } |
154 | } |
|
Line 210... | Line 225... | |||
210 | { |
225 | { |
|
211 | switch (await WindowsSerialization.Deserialize("Windows.xml")) |
226 | switch (await WindowsSerialization.Deserialize("Windows.xml")) |
|
212 | { |
227 | { |
|
213 | case SerializationSuccess serializationSuccess: |
228 | case SerializationSuccess serializationSuccess: |
|
214 | Windows = serializationSuccess.Windows; |
229 | Windows = serializationSuccess.Windows; |
|
- | 230 | if (LogForm != null) |
||
- | 231 | { |
||
- | 232 | LogForm.InvokeIfRequired(form => |
||
- | 233 | { |
||
- | 234 | form.logTextBox.Text += "Windows loaded." + Environment.NewLine; |
||
- | 235 | }); |
||
- | 236 | } |
||
215 | break; |
237 | break; |
|
216 | case SerializationFailure serializationFailure: |
238 | case SerializationFailure serializationFailure: |
|
217 | Windows = new Windows.Windows(); |
239 | Windows = new Windows.Windows(); |
|
- | 240 | if (LogForm != null) |
||
- | 241 | { |
||
- | 242 | LogForm.InvokeIfRequired(form => |
||
- | 243 | { |
||
- | 244 | form.logTextBox.Text += "Failed to load windows: " + serializationFailure.Exception.Message + Environment.NewLine; |
||
- | 245 | }); |
||
- | 246 | } |
||
218 | break; |
247 | break; |
|
219 | } |
248 | } |
|
220 | } |
249 | } |
|
Line 221... | Line 250... | |||
221 | |
250 | |
|
- | 251 | #endregion |
||
- | 252 | |
||
- | 253 | private void ShowLogToolStripMenuItem_Click(object sender, EventArgs e) |
||
- | 254 | { |
||
- | 255 | if (LogForm != null) |
||
- | 256 | { |
||
- | 257 | return; |
||
- | 258 | } |
||
- | 259 | |
||
- | 260 | LogForm = new LogForm(); |
||
- | 261 | LogForm.Closed += LogForm_Closed; |
||
- | 262 | LogForm.Show(); |
||
- | 263 | } |
||
- | 264 | |
||
- | 265 | private void LogForm_Closed(object sender, EventArgs e) |
||
- | 266 | { |
||
- | 267 | LogForm.Closed -= LogForm_Closed; |
||
- | 268 | LogForm.Dispose(); |
||
- | 269 | LogForm = null; |
||
222 | #endregion |
270 | } |
|
223 | } |
271 | } |
|
224 | } |
272 | } |