프로젝트

일반

사용자정보

통계
| 브랜치(Branch): | 개정판:

markus / ConvertService / ServiceBase / Markus.Service.StationController / App.xaml.cs @ 8ff1bf3a

이력 | 보기 | 이력해설 | 다운로드 (2.19 KB)

1
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
        //private System.Windows.Forms.NotifyIcon _notifyIcon;
18
        //private bool _isExit;
19

    
20
        protected override void OnStartup(StartupEventArgs e)
21
        {
22
            base.OnStartup(e);
23
            //MainWindow.Closing += MainWindow_Closing;
24

    
25
            //_notifyIcon = new System.Windows.Forms.NotifyIcon();
26
            //_notifyIcon.DoubleClick += (s, args) => ShowMainWindow();
27
            //_notifyIcon.Icon = Markus.Service.StationController.Properties.Resources.TRANSFER_ERROR;
28
            //_notifyIcon.Visible = true;
29

    
30
            //CreateContextMenu();
31
        }
32

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

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

    
49
        private void ShowMainWindow()
50
        {
51
            if (MainWindow.IsVisible)
52
            {
53
                if (MainWindow.WindowState == WindowState.Minimized)
54
                {
55
                    MainWindow.WindowState = WindowState.Normal;
56
                }
57
                MainWindow.Activate();
58
            }
59
            else
60
            {
61
                MainWindow.Show();
62
            }
63
        }
64

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

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