From: <nic...@us...> - 2013-11-20 21:21:55
|
Revision: 4684 http://sourceforge.net/p/mp-plugins/code/4684 Author: nicsergio Date: 2013-11-20 21:21:50 +0000 (Wed, 20 Nov 2013) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/Common/Tools.cs trunk/plugins/ShortCuter&SkinEditor/Source/Common/VersionInfo.Designer.cs trunk/plugins/ShortCuter&SkinEditor/Source/Common/VersionInfo.cs trunk/plugins/ShortCuter&SkinEditor/Source/Common/VersionInfo.resx trunk/plugins/ShortCuter&SkinEditor/Source/MediaPortalPlugins.sln trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Properties/Resources.Designer.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Properties/Resources.resx trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.Designer.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/SkinWithSounds.cs trunk/plugins/ShortCuter&SkinEditor/Source/XtremeMenuEditor/BHEditorForm.Designer.cs trunk/plugins/ShortCuter&SkinEditor/Source/XtremeMenuEditor/BHEditorForm.cs Modified: trunk/plugins/ShortCuter&SkinEditor/Source/Common/Tools.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/Common/Tools.cs 2013-11-20 06:58:48 UTC (rev 4683) +++ trunk/plugins/ShortCuter&SkinEditor/Source/Common/Tools.cs 2013-11-20 21:21:50 UTC (rev 4684) @@ -9,9 +9,65 @@ { internal static class Tools //Collezione utilità { + #region Classi + public static class MyAssembly //Classe per accesso alle proprietà assembly in esecuzione + { + #region Dati + public static readonly string Name; //Nome progetto + public static readonly string Title; //Titolo + public static readonly string File; //File binario + public static readonly string Version; //Versione + public static readonly string Description; //Descrizione (breve) + public static readonly string Author; //Autore + public static readonly string BuildDate; //Data & ora di compilazione + #endregion + + #region Costruttore + static MyAssembly() + { + Assembly myAssembly = Assembly.GetExecutingAssembly(); //Raccolta informazioni assembly in esecuzione + Name = myAssembly.GetName().Name.ToString(); + Title = ((AssemblyTitleAttribute)myAssembly.GetCustomAttributes(typeof(AssemblyTitleAttribute), false)[0]).Title; + File = System.IO.Path.GetFileName(myAssembly.Location); + Version = myAssembly.GetName().Version.ToString(); + Description = ((AssemblyDescriptionAttribute)myAssembly.GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false)[0]).Description; + Author = ((AssemblyCompanyAttribute)myAssembly.GetCustomAttributes(typeof(AssemblyCompanyAttribute), false)[0]).Company; + BuildDate = RetrieveLinkerTimestamp(myAssembly.Location); + } + #endregion + + #region Metodi Privati + private static string RetrieveLinkerTimestamp(string filePath) //Lettura data & ora di compilazione di un assembly + { + const int c_PeHeaderOffset = 60; + const int c_LinkerTimestampOffset = 8; + byte[] b = new byte[2048]; + System.IO.Stream s = null; + + try + { + s = new System.IO.FileStream(filePath, System.IO.FileMode.Open, System.IO.FileAccess.Read); + s.Read(b, 0, 2048); + } + finally + { + if (s != null) + s.Close(); + } + + int i = System.BitConverter.ToInt32(b, c_PeHeaderOffset); + int secondsSince1970 = System.BitConverter.ToInt32(b, i + c_LinkerTimestampOffset); + DateTime dt = new DateTime(1970, 1, 1, 0, 0, 0); + dt = dt.AddSeconds(secondsSince1970); + dt = dt.AddHours(TimeZone.CurrentTimeZone.GetUtcOffset(dt).Hours); + return dt.ToString(); + } + #endregion + } + #endregion + #region Dati - //Intestazione messaggi (nome assembly) - private static readonly string MessageHeader = Assembly.GetExecutingAssembly().GetName().Name.ToString(); + private static readonly string MessageHeader = MyAssembly.Title; //Intestazione messaggi (titolo assembly) #endregion #region Metodi Pubblici @@ -52,31 +108,6 @@ winControl.Region = new Region(gp); } #endregion - public static string RetrieveLinkerTimestamp(string filePath) //Lettura data & ora di compilazione di un assembly - { - const int c_PeHeaderOffset = 60; - const int c_LinkerTimestampOffset = 8; - byte[] b = new byte[2048]; - System.IO.Stream s = null; - - try - { - s = new System.IO.FileStream(filePath, System.IO.FileMode.Open, System.IO.FileAccess.Read); - s.Read(b, 0, 2048); - } - finally - { - if (s != null) - s.Close(); - } - - int i = System.BitConverter.ToInt32(b, c_PeHeaderOffset); - int secondsSince1970 = System.BitConverter.ToInt32(b, i + c_LinkerTimestampOffset); - DateTime dt = new DateTime(1970, 1, 1, 0, 0, 0); - dt = dt.AddSeconds(secondsSince1970); - dt = dt.AddHours(TimeZone.CurrentTimeZone.GetUtcOffset(dt).Hours); - return dt.ToString(); - } #endregion } } Modified: trunk/plugins/ShortCuter&SkinEditor/Source/Common/VersionInfo.Designer.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/Common/VersionInfo.Designer.cs 2013-11-20 06:58:48 UTC (rev 4683) +++ trunk/plugins/ShortCuter&SkinEditor/Source/Common/VersionInfo.Designer.cs 2013-11-20 21:21:50 UTC (rev 4684) @@ -293,9 +293,9 @@ this.commentLabel.BackColor = System.Drawing.Color.Transparent; this.commentLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.commentLabel.ForeColor = System.Drawing.Color.DarkViolet; - this.commentLabel.Location = new System.Drawing.Point(180, 248); + this.commentLabel.Location = new System.Drawing.Point(161, 247); this.commentLabel.Name = "commentLabel"; - this.commentLabel.Size = new System.Drawing.Size(288, 15); + this.commentLabel.Size = new System.Drawing.Size(320, 15); this.commentLabel.TabIndex = 7; this.commentLabel.Text = "comment"; this.commentLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; Modified: trunk/plugins/ShortCuter&SkinEditor/Source/Common/VersionInfo.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/Common/VersionInfo.cs 2013-11-20 06:58:48 UTC (rev 4683) +++ trunk/plugins/ShortCuter&SkinEditor/Source/Common/VersionInfo.cs 2013-11-20 21:21:50 UTC (rev 4684) @@ -1,14 +1,8 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; +using System.Diagnostics; using System.Drawing; -using System.Linq; -using System.Text; +using System.Drawing.Drawing2D; using System.Windows.Forms; -using System.Drawing.Drawing2D; -using System.Reflection; -using System.Diagnostics; namespace My.Common @@ -37,13 +31,12 @@ myVersionInfo.logoPictureBox.Image = logo; //--> logo applicazione Tools.RoundEdges(myVersionInfo, 75, 50); //--> arrotondamento spigoli form - Assembly myAssembly = Assembly.GetExecutingAssembly(); //Raccolta informazioni assembly in esecuzione - myVersionInfo.versionLabel.Text = myAssembly.GetName().Version.ToString(); - myVersionInfo.fileLabel.Text = System.IO.Path.GetFileName(myAssembly.Location); - myVersionInfo.titleLabel.Text = ((AssemblyTitleAttribute)myAssembly.GetCustomAttributes(typeof(AssemblyTitleAttribute), false)[0]).Title; - myVersionInfo.descriptionLabel.Text = ((AssemblyDescriptionAttribute)myAssembly.GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false)[0]).Description; - myVersionInfo.authorLabel.Text = ((AssemblyCompanyAttribute)myAssembly.GetCustomAttributes(typeof(AssemblyCompanyAttribute), false)[0]).Company; - myVersionInfo.buildDateLabel.Text = Tools.RetrieveLinkerTimestamp(myAssembly.Location); + myVersionInfo.versionLabel.Text = Tools.MyAssembly.Version; + myVersionInfo.fileLabel.Text = Tools.MyAssembly.File; + myVersionInfo.titleLabel.Text = Tools.MyAssembly.Title; + myVersionInfo.descriptionLabel.Text = Tools.MyAssembly.Description; + myVersionInfo.authorLabel.Text = Tools.MyAssembly.Author; + myVersionInfo.buildDateLabel.Text = Tools.MyAssembly.BuildDate; if (comment.Length > 0) //Eventuale visualizzazione commento { Modified: trunk/plugins/ShortCuter&SkinEditor/Source/Common/VersionInfo.resx =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/Common/VersionInfo.resx 2013-11-20 06:58:48 UTC (rev 4683) +++ trunk/plugins/ShortCuter&SkinEditor/Source/Common/VersionInfo.resx 2013-11-20 21:21:50 UTC (rev 4684) @@ -117,9 +117,6 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <metadata name="okPictureBox.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <data name="okPictureBox.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> @@ -170,60 +167,6 @@ AAAAAElFTkSuQmCC </value> </data> - <metadata name="logoPictureBox.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="headerLabel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="infoGroupBox.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="buildDateLabel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="authorLabel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="descriptionLabel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="titleLabel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="fileLabel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="versionLabel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="versionHeaderLabel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="buildDateHeaderLabel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="authorHeaderLabel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="descriptionHeaderLabel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="titleHeaderLabel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="fileHeaderLabel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="forumLinkLabel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="wikiLinkLabel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="internetPictureBox.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> <data name="internetPictureBox.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 @@ -279,10 +222,4 @@ CDnUhkr9VgAAAABJRU5ErkJggg== </value> </data> - <metadata name="commentLabel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> </root> \ No newline at end of file Modified: trunk/plugins/ShortCuter&SkinEditor/Source/MediaPortalPlugins.sln =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/MediaPortalPlugins.sln 2013-11-20 06:58:48 UTC (rev 4683) +++ trunk/plugins/ShortCuter&SkinEditor/Source/MediaPortalPlugins.sln 2013-11-20 21:21:50 UTC (rev 4684) @@ -29,7 +29,6 @@ {350D17A6-0F6B-43C4-898F-33CC68EBCD75}.Debug|x86.Build.0 = Debug|x86 {350D17A6-0F6B-43C4-898F-33CC68EBCD75}.Release|Any CPU.ActiveCfg = Release|x86 {350D17A6-0F6B-43C4-898F-33CC68EBCD75}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {350D17A6-0F6B-43C4-898F-33CC68EBCD75}.Release|Mixed Platforms.Build.0 = Release|x86 {350D17A6-0F6B-43C4-898F-33CC68EBCD75}.Release|x86.ActiveCfg = Release|x86 {350D17A6-0F6B-43C4-898F-33CC68EBCD75}.Release|x86.Build.0 = Release|x86 {4D76B200-01C9-48C6-BA04-DAF0845D56B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU @@ -48,6 +47,7 @@ {20CEBE32-A39E-4A61-B2BD-90BF16E2AEE8}.Release|Any CPU.ActiveCfg = Release|Any CPU {20CEBE32-A39E-4A61-B2BD-90BF16E2AEE8}.Release|Any CPU.Build.0 = Release|Any CPU {20CEBE32-A39E-4A61-B2BD-90BF16E2AEE8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {20CEBE32-A39E-4A61-B2BD-90BF16E2AEE8}.Release|Mixed Platforms.Build.0 = Release|Any CPU {20CEBE32-A39E-4A61-B2BD-90BF16E2AEE8}.Release|x86.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Properties/Resources.Designer.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Properties/Resources.Designer.cs 2013-11-20 06:58:48 UTC (rev 4683) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Properties/Resources.Designer.cs 2013-11-20 21:21:50 UTC (rev 4684) @@ -119,5 +119,15 @@ return ((System.Drawing.Bitmap)(obj)); } } + + /// <summary> + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// </summary> + internal static System.Drawing.Bitmap ShortCuter { + get { + object obj = ResourceManager.GetObject("ShortCuter", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Properties/Resources.resx =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Properties/Resources.resx 2013-11-20 06:58:48 UTC (rev 4683) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Properties/Resources.resx 2013-11-20 21:21:50 UTC (rev 4684) @@ -136,4 +136,8 @@ <data name="RowUp" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\..\common\resources\images\rowup.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data> + <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> + <data name="ShortCuter" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\resources\images\shortcuterenable.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> </root> \ No newline at end of file Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs 2013-11-20 06:58:48 UTC (rev 4683) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs 2013-11-20 21:21:50 UTC (rev 4684) @@ -1,17 +1,14 @@ using System; -using System.Reflection; using System.Windows.Forms; -using System.Collections.Generic; using MediaPortal.Configuration; using MediaPortal.GUI.Library; using MediaPortal.Util; -using System.Threading; -using Action = MediaPortal.GUI.Library.Action; -using System.Runtime.InteropServices; +//using Action = MediaPortal.GUI.Library.Action; +using My.Common; namespace ProcessPlugins.ShortCuter { - public class ShortCuter : IPlugin //Classe gestore shortcuts + internal class ShortCuter : IPlugin //Classe gestore shortcuts { #region Dati private ShortCuts myShortCuts; //Istanza classe ShortCuts (dati relativi ai shortcuts configurati) @@ -21,17 +18,16 @@ #region Costruttore static ShortCuter() //Costruttore classe ShortCuter { - //Header per log corrispondente a titolo assembly - LogPrefix = ((AssemblyTitleAttribute)Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false)[0]).Title + " - "; + LogPrefix = Tools.MyAssembly.Title + " - "; //Header per log su file (titolo assembly) } #endregion #region Implementazione IPlugin public void Start() //Avvio del plugin { - MpLog(false, "Plugin started", null); + MpLog(false, "Plugin started"); - string settingsFile = Config.GetFile(Config.Dir.Config, Assembly.GetExecutingAssembly().GetName().Name.ToString() + ".xml"); + string settingsFile = Config.GetFile(Config.Dir.Config, Tools.MyAssembly.Name + ".xml"); myShortCuts = new ShortCuts(settingsFile, false); //--> lettura configurazione relativa agli shortcuts if (myShortCuts.Initialized) //Se classe di gestione shortcut inizializzata { @@ -42,15 +38,15 @@ } catch { - MpLog(true, "Error creating raw input hook", null); + MpLog(true, "Error creating raw input hook"); } } else - MpLog(true, "Error loading configuration", null); + MpLog(true, "Error loading configuration"); } public void Stop() //Terminazione del plugin { - MpLog(false, "Plugin stopped", null); + MpLog(false, "Plugin stopped"); } #endregion @@ -59,7 +55,7 @@ { try { - MpLog(false, "Go to screen accepted, " + sc.ToString(), null); + MpLog(false, "Go to screen accepted, " + sc.ToString()); GUIGraphicsContext.ResetLastActivity(); if (sc.SoundEffect.Length > 0) @@ -68,7 +64,7 @@ if (sc.LoadParameter.Length > 0) //Richiamo schermata con parametri di caricamento { string sm = GUIPropertyManager.GetProperty("#MovingPictures.SelectedMovie.title"); - MpLog(false, "SSSM:" + sm, null); + MpLog(false, "SSSM:" + sm); GUIWindowManager.ActivateWindow(sc.WindowID, sc.LoadParameter, true); } @@ -87,6 +83,10 @@ #endregion #region Metodi Pubblici + public static void MpLog(bool errorLog, string description) //Registrazione evento su log di MediaPortal (senza passare l'eccezione) + { + MpLog(errorLog, description, null); + } public static void MpLog(bool errorLog, string description, Exception e) //Registrazione evento su log di MediaPortal { description = LogPrefix + description; @@ -114,7 +114,7 @@ return; } } - MpLog(false, "Key not mapped: Key=" + (e.Control ? "<CTRL>" : "") + (e.Alt ? "<ALT>" : "") + (e.Shift ? "<SHIFT>" : "") + "<" + e.KeyCode.ToString() + ">", null); + MpLog(false, "Key not mapped: Key=" + (e.Control ? "<CTRL>" : "") + (e.Alt ? "<ALT>" : "") + (e.Shift ? "<SHIFT>" : "") + "<" + e.KeyCode.ToString() + ">"); } } #endregion Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2013-11-20 06:58:48 UTC (rev 4683) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2013-11-20 21:21:50 UTC (rev 4684) @@ -6,7 +6,7 @@ <ProductVersion>8.0.30703</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{20CEBE32-A39E-4A61-B2BD-90BF16E2AEE8}</ProjectGuid> - <OutputType>Library</OutputType> + <OutputType>WinExe</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>ProcessPlugins.ShortCuter</RootNamespace> <AssemblyName>ShortCuter</AssemblyName> @@ -47,8 +47,7 @@ <WarningLevel>4</WarningLevel> </PropertyGroup> <PropertyGroup> - <StartupObject> - </StartupObject> + <StartupObject>ProcessPlugins.ShortCuter.Program</StartupObject> </PropertyGroup> <PropertyGroup> <ApplicationIcon>Resources\Images\ShortCuter.ico</ApplicationIcon> @@ -83,6 +82,14 @@ <Compile Include="..\Common\Tools.cs"> <Link>Tools.cs</Link> </Compile> + <Compile Include="..\Common\VersionInfo.cs"> + <Link>VersionInfo.cs</Link> + <SubType>Form</SubType> + </Compile> + <Compile Include="..\Common\VersionInfo.designer.cs"> + <Link>VersionInfo.designer.cs</Link> + <DependentUpon>VersionInfo.cs</DependentUpon> + </Compile> <Compile Include="KeyboardHookWorker.cs" /> <Compile Include="KeyboardHook.cs" /> <Compile Include="Program.cs" /> @@ -109,6 +116,10 @@ <Compile Include="SkinWithSounds.cs" /> </ItemGroup> <ItemGroup> + <EmbeddedResource Include="..\Common\VersionInfo.resx"> + <Link>VersionInfo.resx</Link> + <DependentUpon>VersionInfo.cs</DependentUpon> + </EmbeddedResource> <EmbeddedResource Include="Properties\Resources.resx"> <Generator>ResXFileCodeGenerator</Generator> <LastGenOutput>Resources.Designer.cs</LastGenOutput> Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.Designer.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.Designer.cs 2013-11-20 06:58:48 UTC (rev 4683) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.Designer.cs 2013-11-20 21:21:50 UTC (rev 4684) @@ -28,7 +28,6 @@ /// </summary> private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ShortCuterForm)); this.shortCutsDataGridView = new System.Windows.Forms.DataGridView(); @@ -44,7 +43,7 @@ this.windowIdLabel = new System.Windows.Forms.Label(); this.skinFileGroupBox = new System.Windows.Forms.GroupBox(); this.skinFileLabel = new System.Windows.Forms.Label(); - this.toolTip = new System.Windows.Forms.ToolTip(this.components); + this.toolTip = new System.Windows.Forms.ToolTip(); this.updateButton = new System.Windows.Forms.Button(); this.resetButton = new System.Windows.Forms.Button(); this.rowDownButton = new System.Windows.Forms.Button(); @@ -284,7 +283,7 @@ // infoPictureBox // this.infoPictureBox.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.Info; - this.infoPictureBox.Location = new System.Drawing.Point(760, 0); + this.infoPictureBox.Location = new System.Drawing.Point(759, 1); this.infoPictureBox.Name = "infoPictureBox"; this.infoPictureBox.Size = new System.Drawing.Size(24, 24); this.infoPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.cs 2013-11-20 06:58:48 UTC (rev 4683) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.cs 2013-11-20 21:21:50 UTC (rev 4684) @@ -1,7 +1,6 @@ using System; using System.ComponentModel; using System.Drawing; -using System.Reflection; using System.Windows.Forms; using MediaPortal.Configuration; using MediaPortal.GUI.Library; @@ -215,16 +214,6 @@ rowDownButton.Enabled = false; } } - private void ShowInfo() //Visualizzazione informazioni versione - { - Assembly myAssembly = Assembly.GetExecutingAssembly(); - string description = ((AssemblyDescriptionAttribute)myAssembly.GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false)[0]).Description; - string title = ((AssemblyTitleAttribute)myAssembly.GetCustomAttributes(typeof(AssemblyTitleAttribute), false)[0]).Title; - - Tools.InfoMessage(title + " V" + myAssembly.GetName().Version.ToString() + "\n\n" + - ">>> " + description + " <<<" + "\n\n\n\n" + - "...a big thank to MoPath & Chemelli for this plugin!"); - } #endregion #region Consumazione Eventi @@ -238,7 +227,7 @@ } if (mySkin.Initialized) { - string settingsFile = Config.GetFile(Config.Dir.Config, Assembly.GetExecutingAssembly().GetName().Name.ToString() + ".xml"); + string settingsFile = Config.GetFile(Config.Dir.Config, Tools.MyAssembly.Name + ".xml"); //Lettura impostazioni e gestione shorcuts myShortCuts = new ShortCuts(settingsFile, true); if (myShortCuts.Initialized) @@ -461,22 +450,24 @@ } private void infoPictureBox_Click(object sender, EventArgs e) { - ShowInfo(); + VersionInfo.ShowInfo(ProcessPlugins.ShortCuter.Properties.Resources.ShortCuter, "...a big thank to MoPath for old version of this plugin!", + "http://forum.team-mediaportal.com/threads/shortcuter-plugin-v2.121721/", + "http://wiki.team-mediaportal.com/1_MEDIAPORTAL_1/17_Extensions/3_Plugins/ShortCut'er"); } #endregion #region Implementazione ISetupForm public string PluginName() { - return ((AssemblyTitleAttribute)Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false)[0]).Title; + return Tools.MyAssembly.Title; } public string Description() { - return ((AssemblyDescriptionAttribute)Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false)[0]).Description; + return Tools.MyAssembly.Description; } public string Author() { - return ((AssemblyCompanyAttribute)Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false)[0]).Company; + return Tools.MyAssembly.Author; } public void ShowPlugin() { Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2013-11-20 06:58:48 UTC (rev 4683) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2013-11-20 21:21:50 UTC (rev 4684) @@ -124,11 +124,11 @@ if (!_initialized) { if (!ConfigContext) - ShortCuter.MpLog(false, "Deprecated config will be loaded..", null); + ShortCuter.MpLog(false, "Deprecated config will be loaded.."); _initialized = LoadDeprecatedConfig(); //--> eventuale caricamento configurazione obsoleta (versione vecchia) if (!_initialized) { - Message(false, "Settings file not found or wrong: default config will be loaded..", null); + Message(false, "Settings file not found or wrong: default config will be loaded.."); _initialized = LoadConfig(true); //Se caricamento configurazione fallita --> caricamento configurazione predefinita } } @@ -166,8 +166,12 @@ return (_items.Count > 0); } } - private void Message(bool errorMsg, string description, Exception e) //Emissione messaggio (o log su file) + private void Message(bool errorMsg, string description) //Emissione messaggio o log su file (senza passare l'eccezione) { + Message(errorMsg, description); + } + private void Message(bool errorMsg, string description, Exception e) //Emissione messaggio o log su file + { if (ConfigContext) //Se utilizzo nella fase di configurazione if (errorMsg) if (e != null) @@ -249,7 +253,7 @@ else { if (defaultSettings) //Se nessun shortcut trovato nella configurazione predefinita: emissione messaggio - Message(false, "No shortcuts found loading DefaultConfig.xml.", null); + Message(false, "No shortcuts found loading DefaultConfig.xml."); return false; } } @@ -311,7 +315,7 @@ if (xmlSettings != null) xmlSettings.Close(); //--> eventuale chiusura oggetto XmlWriter } - Message(false, "Procedure completed successfully.", null); + Message(false, "Procedure completed successfully."); return true; //--> procedura terminata correttamente } #endregion Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/SkinWithSounds.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/SkinWithSounds.cs 2013-11-20 06:58:48 UTC (rev 4683) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/SkinWithSounds.cs 2013-11-20 21:21:50 UTC (rev 4684) @@ -1,8 +1,5 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.IO; -using System.Reflection; -using System.Xml; using My.Common; namespace ProcessPlugins.ShortCuter Modified: trunk/plugins/ShortCuter&SkinEditor/Source/XtremeMenuEditor/BHEditorForm.Designer.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/XtremeMenuEditor/BHEditorForm.Designer.cs 2013-11-20 06:58:48 UTC (rev 4683) +++ trunk/plugins/ShortCuter&SkinEditor/Source/XtremeMenuEditor/BHEditorForm.Designer.cs 2013-11-20 21:21:50 UTC (rev 4684) @@ -996,7 +996,7 @@ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.SystemColors.Control; - this.ClientSize = new System.Drawing.Size(1019, 608); + this.ClientSize = new System.Drawing.Size(1019, 602); this.Controls.Add(this.menuPanel); this.Controls.Add(this.propertiesPanel); this.Controls.Add(this.infoPictureBox); Modified: trunk/plugins/ShortCuter&SkinEditor/Source/XtremeMenuEditor/BHEditorForm.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/XtremeMenuEditor/BHEditorForm.cs 2013-11-20 06:58:48 UTC (rev 4683) +++ trunk/plugins/ShortCuter&SkinEditor/Source/XtremeMenuEditor/BHEditorForm.cs 2013-11-20 21:21:50 UTC (rev 4684) @@ -3,7 +3,6 @@ using System.Drawing; using System.IO; using System.Linq; -using System.Reflection; using System.Windows.Forms; using MediaPortal.Configuration; using MediaPortal.GUI.Library; @@ -508,7 +507,7 @@ myMediaPortal = new MediaPortal(SkinName); if (myMediaPortal.Initialized) { - string settingsFile = MediaPortal.ConfigPath + Assembly.GetExecutingAssembly().GetName().Name.ToString() + ".xml"; + string settingsFile = MediaPortal.ConfigPath + Tools.MyAssembly.Name + ".xml"; //Lettura impostazioni e gestione menu myMenu = new MenuItems(settingsFile, MenuItemsMinNum, MenuItemsMaxNum, SubMenuItemsMaxNum); if (myMenu.Initialized) @@ -890,15 +889,15 @@ #region Implementazione ISetupForm public string PluginName() { - return ((AssemblyTitleAttribute)Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false)[0]).Title; + return Tools.MyAssembly.Title; } public string Description() { - return ((AssemblyDescriptionAttribute)Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false)[0]).Description; + return Tools.MyAssembly.Description; } public string Author() { - return ((AssemblyCompanyAttribute)Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false)[0]).Company; + return Tools.MyAssembly.Author; } public void ShowPlugin() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |