diff --git a/src/Termission.EtoForms/Forms/AboutForm.cs b/src/Termission.EtoForms/Forms/AboutForm.cs index 69561bd..3b2de18 100644 --- a/src/Termission.EtoForms/Forms/AboutForm.cs +++ b/src/Termission.EtoForms/Forms/AboutForm.cs @@ -2,6 +2,7 @@ using System.Reflection; using Eto.Drawing; using Eto.Forms; +using Juniansoft.Termission.Core; using Juniansoft.Termission.EtoForms.Resources; namespace Juniansoft.Termission.EtoForms.Forms @@ -10,7 +11,7 @@ public class AboutForm : Dialog { public AboutForm() { - var title = MainApplication.AssemblyProduct; + var title = App.AssemblyProduct; /* dialog attributes */ @@ -33,15 +34,15 @@ public AboutForm() TextAlignment = TextAlignment.Center }; - var version = MainApplication.AssemblyVersion; + var version = App.AssemblyVersion; var labelVersion = new Label { Text = string.Format("Version {0}", version), TextAlignment = TextAlignment.Center }; - var copyright = MainApplication.AssemblyCopyright; - var company = MainApplication.AssemblyCompany; + var copyright = App.AssemblyCopyright; + var company = App.AssemblyCompany; var labelCopyright = new Label { Text = $"{copyright} by {company}", diff --git a/src/Termission.EtoForms/Forms/MainForm.cs b/src/Termission.EtoForms/Forms/MainForm.cs index 6219769..a35d6f7 100644 --- a/src/Termission.EtoForms/Forms/MainForm.cs +++ b/src/Termission.EtoForms/Forms/MainForm.cs @@ -7,6 +7,7 @@ using Juniansoft.Termission.Core.ViewModels; using Juniansoft.Termission.EtoForms.Views; using Juniansoft.MvvmReady; +using Juniansoft.Termission.Core; namespace Juniansoft.Termission.EtoForms.Forms { @@ -30,7 +31,7 @@ public MainForm() _mainView = ServiceLocator.Current.Get(); _mainVm = ServiceLocator.Current.Get(); - Title = MainApplication.AssemblyProduct; + Title = App.AssemblyProduct; ClientSize = new Eto.Drawing.Size(720, 480); Style = EtoStyles.FormMain; Icon = DesktopAppResources.DevAppIcon; diff --git a/src/Termission.EtoForms/MainApplication.cs b/src/Termission.EtoForms/MainApplication.cs index 1d201c5..c189460 100644 --- a/src/Termission.EtoForms/MainApplication.cs +++ b/src/Termission.EtoForms/MainApplication.cs @@ -105,86 +105,5 @@ public void RegisterServices() ServiceLocator.Current.Register(); ServiceLocator.Current.Register(); } - - #region Assembly Attribute Accessors - - public static string AssemblyTitle - { - get - { - object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false); - if (attributes.Length > 0) - { - AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0]; - if (titleAttribute.Title != "") - { - return titleAttribute.Title; - } - } - return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase); - } - } - - public static string AssemblyVersion - { - get - { - return Assembly.GetExecutingAssembly().GetName().Version.ToString(); - } - } - - public static string AssemblyDescription - { - get - { - object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false); - if (attributes.Length == 0) - { - return ""; - } - return ((AssemblyDescriptionAttribute)attributes[0]).Description; - } - } - - public static string AssemblyProduct - { - get - { - object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false); - if (attributes.Length == 0) - { - return ""; - } - return ((AssemblyProductAttribute)attributes[0]).Product; - } - } - - public static string AssemblyCopyright - { - get - { - object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); - if (attributes.Length == 0) - { - return ""; - } - return ((AssemblyCopyrightAttribute)attributes[0]).Copyright; - } - } - - public static string AssemblyCompany - { - get - { - object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false); - if (attributes.Length == 0) - { - return ""; - } - return ((AssemblyCompanyAttribute)attributes[0]).Company; - } - } - - #endregion } } diff --git a/src/Termission.EtoForms/MenuCommands/AboutCommand.cs b/src/Termission.EtoForms/MenuCommands/AboutCommand.cs index 0fe1599..725c799 100644 --- a/src/Termission.EtoForms/MenuCommands/AboutCommand.cs +++ b/src/Termission.EtoForms/MenuCommands/AboutCommand.cs @@ -4,14 +4,15 @@ using System.Text; using System.Threading.Tasks; using Eto.Forms; - +using Juniansoft.Termission.Core; + namespace Juniansoft.Termission.EtoForms.MenuCommands { public class AboutCommand: Command { public AboutCommand() { - this.MenuText = $"About {MainApplication.AssemblyProduct}"; + this.MenuText = $"About {App.AssemblyProduct}"; this.ToolBarText = "About"; this.ToolTip = "About"; }