• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqtwindows誰得cocoapythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

Notifying a message in Action center.


Commit MetaInfo

Revisione78b9b67ff561b8c9ac2697813317f2e5bfd119f (tree)
Zeit2015-09-16 15:21:48
AutorJeffyTS <JeffyTS@outl...>
CommiterJeffyTS

Log Message

Fixed bug.

Ändern Zusammenfassung

Diff

--- a/NotifyMessage/MainForm.Designer.cs
+++ b/NotifyMessage/MainForm.Designer.cs
@@ -46,7 +46,6 @@
4646 this.ClientSize = new System.Drawing.Size(284, 261);
4747 this.Name = "MainForm";
4848 this.Text = "NotifyMessage";
49- this.Load += new System.EventHandler(this.MainForm_Load);
5049 this.ResumeLayout(false);
5150
5251 }
--- a/NotifyMessage/MainForm.cs
+++ b/NotifyMessage/MainForm.cs
@@ -7,6 +7,8 @@ using System.Linq;
77 using System.Text;
88 using System.Threading.Tasks;
99 using System.Windows.Forms;
10+using System.Reflection; // Add
11+
1012
1113 namespace NotifyMessage
1214 {
@@ -22,21 +24,29 @@ namespace NotifyMessage
2224 "\r\n" +
2325 " Option:\r\n" +
2426 " /INFO(default) | /WARN | /ERR";
27+ private const string MSG_ABOUT = "Thanks to Microsoft Corporation.\r\n" +
28+ "\r\n" +
29+ "This program has been developed on\r\n" +
30+ " Visual Studio Community 2015\r\n" +
31+ " Windows10 Professional 64bit.\r\n" +
32+ "\r\n" +
33+ MSG_USAGE;
2534
2635 public MainForm()
2736 {
2837 // Messageはここで出さないと終了処理がうまくいかない(プロセスが残る)
29- if (Program.NotifyMessage == "")
38+ if (Program.Message == "")
3039 {
31- MessageBox.Show(MSG_USAGE, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
32- Program.NotifyMessage = ""; // 消してしまう(flag代わり)
40+ //MessageBox.Show(MSG_USAGE, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
41+ AboutDialog();
42+ Program.Message = ""; // 消してしまう(flag代わり)
3343 }
34- else if (Program.NotifyMessage != "") // vmxFilePathが指定されていないときは初期化せず終了
44+ else if (Program.Message != "") // vmxFilePathが指定されていないときは初期化せず終了
3545 {
3646 InitializeComponent();
3747
38- this.notifyIcon_MainForm.Text = PROGRAM_NAME;// Program.NotifyMessage;
39- this.notifyIcon_MainForm.BalloonTipText = Program.NotifyMessage;
48+ this.notifyIcon_MainForm.Text = PROGRAM_NAME; // Program.NotifyMessage;
49+ this.notifyIcon_MainForm.BalloonTipText = Program.Message;
4050 this.notifyIcon_MainForm.Icon = Properties.Resources.NotifyMessageTray;
4151
4252 switch (Program.msglevel)
@@ -54,20 +64,53 @@ namespace NotifyMessage
5464 this.notifyIcon_MainForm.BalloonTipIcon = ToolTipIcon.None;
5565 break;
5666 }
57- this.notifyIcon_MainForm.ShowBalloonTip(500);
5867
59- //System.Threading.Thread.Sleep(10000);
68+ this.notifyIcon_MainForm.ShowBalloonTip(5000); // Balloon tip 表示
69+
70+ System.Threading.Thread.Sleep(5000);
6071
6172 // Exit
6273 this.notifyIcon_MainForm.Visible = false; // タスクトレイからアイコンを取り除く
6374 Application.Exit(); // アプリケーション終了
64-
6575 }
6676 }
6777
68- private void MainForm_Load(object sender, EventArgs e)
78+ private void AboutDialog()
6979 {
80+ string message;
81+
82+ //AssemblyTitleの取得
83+ AssemblyTitleAttribute asmTitle = (AssemblyTitleAttribute)Attribute.GetCustomAttribute(
84+ Assembly.GetExecutingAssembly(), typeof(AssemblyTitleAttribute));
85+ //AssemblyDescriptionの取得
86+ AssemblyDescriptionAttribute asmDesc = (AssemblyDescriptionAttribute)Attribute.GetCustomAttribute(
87+ Assembly.GetExecutingAssembly(), typeof(AssemblyDescriptionAttribute));
88+ //AssemblyCompanyの取得
89+ AssemblyCompanyAttribute asmCompany = (AssemblyCompanyAttribute)Attribute.GetCustomAttribute(
90+ Assembly.GetExecutingAssembly(), typeof(AssemblyCompanyAttribute));
91+ //AssemblyProductの取得
92+ AssemblyProductAttribute asmPrdct = (AssemblyProductAttribute)Attribute.GetCustomAttribute(
93+ Assembly.GetExecutingAssembly(), typeof(AssemblyProductAttribute));
94+ //AssemblyCopyrightの取得
95+ AssemblyCopyrightAttribute asmCpyrght = (AssemblyCopyrightAttribute)Attribute.GetCustomAttribute(
96+ Assembly.GetExecutingAssembly(), typeof(AssemblyCopyrightAttribute));
97+ //AssemblyTrademarkの取得
98+ AssemblyTrademarkAttribute asmTM = (AssemblyTrademarkAttribute)Attribute.GetCustomAttribute(
99+ Assembly.GetExecutingAssembly(), typeof(AssemblyTrademarkAttribute));
100+ //バージョンの取得
101+ Assembly asm = Assembly.GetExecutingAssembly();
102+ Version ver = asm.GetName().Version;
70103
104+ message = asmTitle.Title + "\r\n" +
105+ "\r\n" +
106+ asmDesc.Description + "\r\n" +
107+ "\r\n" +
108+ MSG_ABOUT + "\r\n" +
109+ "\r\n" +
110+ asmCompany.Company + "\r\n" +
111+ asmPrdct.Product + " Rev. " + ver + "\r\n" +
112+ asmCpyrght.Copyright + "\r\n";
113+ MessageBox.Show(message, PROGRAM_NAME, MessageBoxButtons.OK, MessageBoxIcon.Information);
71114 }
72115 }
73116 }
--- a/NotifyMessage/Program.cs
+++ b/NotifyMessage/Program.cs
@@ -4,12 +4,13 @@ using System.Linq;
44 using System.Threading.Tasks;
55 using System.Windows.Forms;
66
7+
78 namespace NotifyMessage
89 {
910 static class Program
1011 {
1112 // グローバル変数
12- public static string NotifyMessage = "";
13+ public static string Message = "";
1314 public enum MSGLEVEL : int // MessageLevel
1415 {
1516 INFO = 1,
@@ -35,16 +36,15 @@ namespace NotifyMessage
3536 if (0 <= cmds[i].IndexOf("/ERR", StringComparison.OrdinalIgnoreCase)) msglevel = MSGLEVEL.ERR;
3637 else if (0 <= cmds[i].IndexOf("/WARN", StringComparison.OrdinalIgnoreCase)) msglevel = MSGLEVEL.WARN;
3738 else if (0 <= cmds[i].IndexOf("/INFO", StringComparison.OrdinalIgnoreCase)) msglevel = MSGLEVEL.INFO;
38- else NotifyMessage = cmds[i];
39+ else Message = cmds[i];
3940 }
4041
4142 new MainForm();
4243
43- if (NotifyMessage != "")
44+ if (Message != "")
4445 {
4546 //Application.Run();
4647 }
47-
4848 }
4949 }
5050 }
--- a/NotifyMessage/Properties/AssemblyInfo.cs
+++ b/NotifyMessage/Properties/AssemblyInfo.cs
@@ -6,11 +6,11 @@ using System.Runtime.InteropServices;
66 // アセンブリに関連付けられている情報を変更するには、
77 // これらの属性値を変更してください。
88 [assembly: AssemblyTitle("NotifyMessage")]
9-[assembly: AssemblyDescription("")]
9+[assembly: AssemblyDescription("Notifiying a message in Action center.")]
1010 [assembly: AssemblyConfiguration("")]
1111 [assembly: AssemblyCompany("")]
1212 [assembly: AssemblyProduct("NotifyMessage")]
13-[assembly: AssemblyCopyright("Copyright © 2015")]
13+[assembly: AssemblyCopyright("Copyright © 2015 T.S. All rights reserved")]
1414 [assembly: AssemblyTrademark("")]
1515 [assembly: AssemblyCulture("")]
1616
--- a/readme.txt
+++ b/readme.txt
@@ -1,6 +1,6 @@
11 NotifyMessage
22
3- Notifiying a message in Action center.
3+ Notifying a message in Action center.
44
55 Copyright © 2015 T.S. All rights reserved.
66