프로젝트

일반

사용자정보

개정판 45f9a2ad

ID45f9a2adf8e2a7d01fef47909ea4b768e515fcad
상위 4939a201
하위 f3b8ff8f, ee95e6ee

김태성이(가) 5년 이상 전에 추가함

service Controller 수정
wpf mvvm toolkit추가

Change-Id: I377702b7e388e29af1d18647108109d835b4fefb

차이점 보기:

ConvertService/ServiceBase/Markus.Service.StationController/App.xaml.cs
14 14
    /// </summary>
15 15
    public partial class App : Application
16 16
    {
17
        private System.Windows.Forms.NotifyIcon _notifyIcon;
18
        private bool _isExit;
17
        //private System.Windows.Forms.NotifyIcon _notifyIcon;
18
        //private bool _isExit;
19 19

  
20 20
        protected override void OnStartup(StartupEventArgs e)
21 21
        {
......
33 33

  
34 34
        private void CreateContextMenu()
35 35
        {
36
            _notifyIcon.ContextMenuStrip =
37
              new System.Windows.Forms.ContextMenuStrip();
38
            _notifyIcon.ContextMenuStrip.Items.Add("MainWindow...").Click += (s, e) => ShowMainWindow();
39
            _notifyIcon.ContextMenuStrip.Items.Add("Exit").Click += (s, e) => ExitApplication();
36
            //_notifyIcon.ContextMenuStrip =
37
            //  new System.Windows.Forms.ContextMenuStrip();
38
            //_notifyIcon.ContextMenuStrip.Items.Add("MainWindow...").Click += (s, e) => ShowMainWindow();
39
            //_notifyIcon.ContextMenuStrip.Items.Add("Exit").Click += (s, e) => ExitApplication();
40 40
        }
41 41

  
42 42
        private void ExitApplication()
43 43
        {
44
            _isExit = true;
45
            MainWindow.Close();
46
            _notifyIcon.Dispose();
47
            _notifyIcon = null;
44
            //_isExit = true;
45
            //MainWindow.Close();
46
            //_notifyIcon.Dispose();
47
            //_notifyIcon = null;
48 48
        }
49 49

  
50 50
        private void ShowMainWindow()
......
63 63
            }
64 64
        }
65 65

  
66
        private void MainWindow_Closing(object sender, CancelEventArgs e)
67
        {
68
            if (!_isExit)
69
            {
70
                e.Cancel = true;
71
                MainWindow.Hide(); // A hidden window can be shown again, a closed one not
72
            }
73
        }
66
        //private void MainWindow_Closing(object sender, CancelEventArgs e)
67
        //{
68
        //    if (!_isExit)
69
        //    {
70
        //        e.Cancel = true;
71
        //        MainWindow.Hide(); // A hidden window can be shown again, a closed one not
72
        //    }
73
        //}
74 74

  
75 75
    }
76 76
}

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)