markus / ConvertService / ServiceBase / Markus.Service.StationController / App.xaml.cs @ 72862ad1
이력 | 보기 | 이력해설 | 다운로드 (2.41 KB)
1 | 53c9637d | taeseongkim | using System; |
---|---|---|---|
2 | using System.Collections.Generic; |
||
3 | using System.ComponentModel; |
||
4 | using System.Configuration; |
||
5 | using System.Data; |
||
6 | using System.Linq; |
||
7 | using System.Threading.Tasks; |
||
8 | using System.Windows; |
||
9 | |||
10 | namespace Markus.Service.StationController |
||
11 | { |
||
12 | /// <summary> |
||
13 | /// App.xaml에 대한 상호 작용 논리 |
||
14 | /// </summary> |
||
15 | public partial class App : Application |
||
16 | { |
||
17 | a34f58f6 | taeseongkim | |
18 | public static bool IsDesignMode |
||
19 | { |
||
20 | get |
||
21 | { |
||
22 | return DesignerProperties.GetIsInDesignMode(new DependencyObject()); |
||
23 | } |
||
24 | private set { } |
||
25 | } |
||
26 | |||
27 | 45f9a2ad | taeseongkim | //private System.Windows.Forms.NotifyIcon _notifyIcon; |
28 | //private bool _isExit; |
||
29 | 53c9637d | taeseongkim | |
30 | protected override void OnStartup(StartupEventArgs e) |
||
31 | { |
||
32 | base.OnStartup(e); |
||
33 | a537d79a | taeseongkim | //MainWindow.Closing += MainWindow_Closing; |
34 | 53c9637d | taeseongkim | |
35 | a537d79a | taeseongkim | //_notifyIcon = new System.Windows.Forms.NotifyIcon(); |
36 | //_notifyIcon.DoubleClick += (s, args) => ShowMainWindow(); |
||
37 | //_notifyIcon.Icon = Markus.Service.StationController.Properties.Resources.TRANSFER_ERROR; |
||
38 | //_notifyIcon.Visible = true; |
||
39 | 53c9637d | taeseongkim | |
40 | a537d79a | taeseongkim | //CreateContextMenu(); |
41 | 53c9637d | taeseongkim | } |
42 | |||
43 | private void CreateContextMenu() |
||
44 | { |
||
45 | 45f9a2ad | taeseongkim | //_notifyIcon.ContextMenuStrip = |
46 | // new System.Windows.Forms.ContextMenuStrip(); |
||
47 | //_notifyIcon.ContextMenuStrip.Items.Add("MainWindow...").Click += (s, e) => ShowMainWindow(); |
||
48 | //_notifyIcon.ContextMenuStrip.Items.Add("Exit").Click += (s, e) => ExitApplication(); |
||
49 | 53c9637d | taeseongkim | } |
50 | |||
51 | private void ExitApplication() |
||
52 | { |
||
53 | 45f9a2ad | taeseongkim | //_isExit = true; |
54 | //MainWindow.Close(); |
||
55 | //_notifyIcon.Dispose(); |
||
56 | //_notifyIcon = null; |
||
57 | 53c9637d | taeseongkim | } |
58 | |||
59 | private void ShowMainWindow() |
||
60 | { |
||
61 | if (MainWindow.IsVisible) |
||
62 | { |
||
63 | if (MainWindow.WindowState == WindowState.Minimized) |
||
64 | { |
||
65 | MainWindow.WindowState = WindowState.Normal; |
||
66 | } |
||
67 | MainWindow.Activate(); |
||
68 | } |
||
69 | else |
||
70 | { |
||
71 | MainWindow.Show(); |
||
72 | } |
||
73 | } |
||
74 | |||
75 | 45f9a2ad | taeseongkim | //private void MainWindow_Closing(object sender, CancelEventArgs e) |
76 | //{ |
||
77 | // if (!_isExit) |
||
78 | // { |
||
79 | // e.Cancel = true; |
||
80 | // MainWindow.Hide(); // A hidden window can be shown again, a closed one not |
||
81 | // } |
||
82 | //} |
||
83 | 53c9637d | taeseongkim | |
84 | } |
||
85 | } |