• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

mAgicAnime 俺用改造版


Commit MetaInfo

Révision770d04dfeace6a0ca227e8cb31ff0a95fb19d525 (tree)
l'heure2019-11-24 18:17:03
Auteuryoshy <yoshy@user...>
Commiteryoshy

Message de Log

[FIX] ウィンドウタイトルおよびトレイアイコンのチップテキストをAssemblyInfoから一元的に取得するように修正

Change Summary

Modification

--- /dev/null
+++ b/AssemblyHelper.cs
@@ -0,0 +1,100 @@
1+//=========================================================================
2+/// <summary>
3+/// アセンブリヘルパ
4+/// </summary>
5+/// <remarks>
6+/// </remarks>
7+/// <history>2019/11/24 新規作成</history>
8+//=========================================================================
9+using System;
10+using System.Reflection;
11+
12+namespace Helpers
13+{
14+ static class AssemblyHelper
15+ {
16+ public static string AssemblyTitle
17+ {
18+ get
19+ {
20+ // このアセンブリ上のタイトル属性をすべて取得します
21+ object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
22+ // 少なくとも 1 つのタイトル属性がある場合
23+ if (attributes.Length > 0)
24+ {
25+ // 最初の項目を選択します
26+ AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0];
27+ // 空の文字列の場合、その項目を返します
28+ if (titleAttribute.Title != "")
29+ return titleAttribute.Title;
30+ }
31+ // タイトル属性がないか、またはタイトル属性が空の文字列の場合、.exe 名を返します
32+ return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
33+ }
34+ }
35+
36+ public static string AssemblyVersion
37+ {
38+ get
39+ {
40+ return Assembly.GetExecutingAssembly().GetName().Version.ToString();
41+ }
42+ }
43+
44+ public static string AssemblyDescription
45+ {
46+ get
47+ {
48+ // このアセンブリ上の説明属性をすべて取得します
49+ object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
50+ // 説明属性がない場合、空の文字列を返します
51+ if (attributes.Length == 0)
52+ return "";
53+ // 説明属性がある場合、その値を返します
54+ return ((AssemblyDescriptionAttribute)attributes[0]).Description;
55+ }
56+ }
57+
58+ public static string AssemblyProduct
59+ {
60+ get
61+ {
62+ // このアセンブリ上の製品属性をすべて取得します
63+ object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);
64+ // 製品属性がない場合、空の文字列を返します
65+ if (attributes.Length == 0)
66+ return "";
67+ // 製品属性がある場合、その値を返します
68+ return ((AssemblyProductAttribute)attributes[0]).Product;
69+ }
70+ }
71+
72+ public static string AssemblyCopyright
73+ {
74+ get
75+ {
76+ // このアセンブリ上の著作権属性をすべて取得します
77+ object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
78+ // 著作権属性がない場合、空の文字列を返します
79+ if (attributes.Length == 0)
80+ return "";
81+ // 著作権属性がある場合、その値を返します
82+ return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
83+ }
84+ }
85+
86+ public static string AssemblyCompany
87+ {
88+ get
89+ {
90+ // このアセンブリ上の会社属性をすべて取得します
91+ object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
92+ // 会社属性がない場合、空の文字列を返します
93+ if (attributes.Length == 0)
94+ return "";
95+ // 会社属性がある場合、その値を返します
96+ return ((AssemblyCompanyAttribute)attributes[0]).Company;
97+ }
98+ }
99+ }
100+}
\ No newline at end of file
--- a/Properties/AssemblyInfo.cs
+++ b/Properties/AssemblyInfo.cs
@@ -5,11 +5,11 @@ using System.Runtime.InteropServices;
55 // アセンブリに関する一般情報は以下の属性セットをとおして制御されます。
66 // アセンブリに関連付けられている情報を変更するには、
77 // これらの属性値を変更してください。
8-[assembly: AssemblyTitle("mAgicAnime Ver.7sh mod. yossiepon_20191123")]
8+[assembly: AssemblyTitle("mAgicAnime Ver.7sh mod. yossiepon_20191124")]
99 [assembly: AssemblyDescription("")]
1010 [assembly: AssemblyConfiguration("")]
1111 [assembly: AssemblyCompany("")]
12-[assembly: AssemblyProduct("mAgicAnime.NET (ななし版, mod. yossiepon_20191123)")]
12+[assembly: AssemblyProduct("mAgicAnime.NET (ななし版, mod. yossiepon_20191124)")]
1313 [assembly: AssemblyCopyright("Copyright (C) 2006-2010 mAgicAnime Project, 2012 ななし, 2015-2019 yossiepon")]
1414 [assembly: AssemblyTrademark("")]
1515 [assembly: AssemblyCulture("")]
@@ -30,4 +30,4 @@ using System.Runtime.InteropServices;
3030 // Revision
3131 //
3232 [assembly: AssemblyVersion("2.0.0.0")]
33-[assembly: AssemblyFileVersion("2.0.14.MOD20191123")]
33+[assembly: AssemblyFileVersion("2.0.14.MOD20191124")]
--- a/UserInterface/AboutBox.cs
+++ b/UserInterface/AboutBox.cs
@@ -13,6 +13,7 @@ using System.ComponentModel;
1313 using System.Drawing;
1414 using System.Windows.Forms;
1515 using System.Reflection;
16+using Helpers;
1617
1718 namespace magicAnime
1819 {
@@ -37,19 +38,28 @@ namespace magicAnime
3738 private void SetComponent()
3839 {
3940
40- // アセンブリ情報からの製品情報を表示する情報ボックスを初期化します。
41- // アプリケーションのアセンブリ情報設定を次のいずれかにて変更します:
42- // - [プロジェクト] メニューの [プロパティ] にある [アプリケーション] の [アセンブリ情報]
43- // - AssemblyInfo.cs
44- this.Text = String.Format("{0} のバージョン情報", AssemblyTitle);
45- this.labelProductName.Text = AssemblyProduct;
46-// 2009/04/14 ->
47- this.labelVersion.Text = String.Format("(アセンブリバージョン {0})", AssemblyVersion);
48-// this.labelVersion.Text = String.Format("内部バージョン {0}", AssemblyVersion);
49-// 2009/04/14 <-
50- this.labelProductVersion.Text = String.Format("バージョン {0}", Application.ProductVersion);
51-// this.labelCopyright.Text = AssemblyCopyright;
52-// this.labelCompanyName.Text = AssemblyCompany;
41+ // アセンブリ情報からの製品情報を表示する情報ボックスを初期化します。
42+ // アプリケーションのアセンブリ情報設定を次のいずれかにて変更します:
43+ // - [プロジェクト] メニューの [プロパティ] にある [アプリケーション] の [アセンブリ情報]
44+ // - AssemblyInfo.cs
45+// mod yossiepon 20191124 begin
46+
47+// this.Text = String.Format("{0} のバージョン情報", AssemblyTitle);
48+// this.labelProductName.Text = AssemblyProduct;
49+//// 2009/04/14 ->
50+// this.labelVersion.Text = String.Format("(アセンブリバージョン {0})", AssemblyVersion);
51+//// this.labelVersion.Text = String.Format("内部バージョン {0}", AssemblyVersion);
52+//// 2009/04/14 <-
53+// this.labelProductVersion.Text = String.Format("バージョン {0}", Application.ProductVersion);
54+//// this.labelCopyright.Text = AssemblyCopyright;
55+//// this.labelCompanyName.Text = AssemblyCompany;
56+
57+ this.Text = String.Format("{0} のバージョン情報", AssemblyHelper.AssemblyTitle);
58+ this.labelProductName.Text = AssemblyHelper.AssemblyProduct;
59+ this.labelVersion.Text = String.Format("(アセンブリバージョン {0})", AssemblyHelper.AssemblyVersion);
60+ this.labelProductVersion.Text = String.Format("バージョン {0}", Application.ProductVersion);
61+
62+// mod yossiepon 20191124 end
5363
5464 // <ADD> 2010/02/20 ->
5565 //------------------------------------------
@@ -103,9 +113,11 @@ namespace magicAnime
103113 timer.Start();
104114 }
105115
106- #region アセンブリ属性アクセサ
116+// del yossiepon 20191124 begin
117+#if false
118+ #region アセンブリ属性アクセサ
107119
108- public string AssemblyTitle
120+ public string AssemblyTitle
109121 {
110122 get
111123 {
@@ -188,10 +200,13 @@ namespace magicAnime
188200 return ((AssemblyCompanyAttribute)attributes[0]).Company;
189201 }
190202 }
191- #endregion
192203
193- // 自動的に消す
194- private void timer_Tick(object sender, EventArgs e)
204+ #endregion
205+#endif
206+// del yossiepon 20191124 end
207+
208+ // 自動的に消す
209+ private void timer_Tick(object sender, EventArgs e)
195210 {
196211 Close();
197212 }
--- a/UserInterface/MainForm.Designer.cs
+++ b/UserInterface/MainForm.Designer.cs
@@ -1216,7 +1216,7 @@
12161216 this.MainMenuStrip = this.menuStrip;
12171217 this.Name = "MainForm";
12181218 this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
1219- this.Text = "mAgicAnime.NET Ver.7sh mod. yossiepon_20191123";
1219+ this.Text = "mAgicAnime.NET Ver.7sh mod. yossiepon_yyyymmdd";
12201220 this.Load += new System.EventHandler(this.MainForm_Load);
12211221 this.Shown += new System.EventHandler(this.MainForm_Shown);
12221222 this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.MainForm_FormClosed);
--- a/UserInterface/MainForm.cs
+++ b/UserInterface/MainForm.cs
@@ -124,8 +124,11 @@ namespace magicAnime
124124 public MainForm()
125125 {
126126 InitializeComponent();
127+ // add yossiepon 20191124 begin
128+ Text = AssemblyHelper.AssemblyTitle;
129+ // add yossiepon 20191124 end
127130
128- mViewMode = ViewMode.SeriesMode;
131+ mViewMode = ViewMode.SeriesMode;
129132
130133 mQueuingMenuItems = new List<ToolStripItem>();
131134 mEncodingMenuItems = new List<ToolStripItem>();
@@ -3150,7 +3153,7 @@ namespace magicAnime
31503153 prog.SpecialStoryCount = prog.SpecialStoryCount - 1;
31513154 }
31523155 }
3153- }
3156+ }
31543157 // add yossiepon 20160924 end
31553158
31563159 // add yossiepon 20170121 begin
--- a/UserInterface/TrayIcon.cs
+++ b/UserInterface/TrayIcon.cs
@@ -64,7 +64,10 @@ namespace magicAnime.UserInterface
6464 mNotifyIcon.DoubleClick += notifyIcon_DoubleClick;
6565 mNotifyIcon.BalloonTipIcon = ToolTipIcon.Info;
6666 mNotifyIcon.BalloonTipTitle = "mAgicAnime";
67- mNotifyIcon.Text = "mAgicAnime Ver.7sh mod. yossiepon_20191123";
67+ // mod yossiepon 20191124 begin
68+ //mNotifyIcon.Text = "mAgicAnime Ver.7sh mod. yossiepon_yyyymmdd";
69+ mNotifyIcon.Text = AssemblyHelper.AssemblyTitle;
70+ // mod yossiepon 20191124 begin
6871 // trayIcon.Icon = ((System.Drawing.Icon)(resources.GetObject( "notifyIcon.Icon" )));
6972
7073 //---------------------------
--- a/magicAnime.csproj
+++ b/magicAnime.csproj
@@ -74,6 +74,7 @@
7474 <Reference Include="System.Xml" />
7575 </ItemGroup>
7676 <ItemGroup>
77+ <Compile Include="AssemblyHelper.cs" />
7778 <Compile Include="BatchManager.cs" />
7879 <Compile Include="PathHelper.cs" />
7980 <Compile Include="DateTimeHelper.cs" />