You can subscribe to this list here.
2007 |
Jan
(36) |
Feb
(79) |
Mar
(123) |
Apr
(95) |
May
(119) |
Jun
(172) |
Jul
(124) |
Aug
(100) |
Sep
(83) |
Oct
(52) |
Nov
(97) |
Dec
(87) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(131) |
Feb
(80) |
Mar
(163) |
Apr
(178) |
May
(73) |
Jun
(54) |
Jul
(106) |
Aug
(118) |
Sep
(50) |
Oct
(125) |
Nov
(100) |
Dec
(99) |
2009 |
Jan
(104) |
Feb
(99) |
Mar
(68) |
Apr
(81) |
May
(52) |
Jun
(87) |
Jul
(67) |
Aug
(33) |
Sep
(27) |
Oct
(37) |
Nov
(60) |
Dec
(116) |
2010 |
Jan
(82) |
Feb
(79) |
Mar
(38) |
Apr
(50) |
May
(45) |
Jun
(53) |
Jul
(23) |
Aug
(86) |
Sep
(22) |
Oct
(96) |
Nov
(97) |
Dec
(73) |
2011 |
Jan
(24) |
Feb
(45) |
Mar
(28) |
Apr
(31) |
May
(42) |
Jun
(25) |
Jul
|
Aug
(12) |
Sep
(28) |
Oct
(13) |
Nov
(43) |
Dec
(13) |
2012 |
Jan
(62) |
Feb
(28) |
Mar
(6) |
Apr
(16) |
May
(7) |
Jun
|
Jul
(16) |
Aug
(2) |
Sep
(1) |
Oct
(4) |
Nov
(1) |
Dec
(3) |
2013 |
Jan
(5) |
Feb
|
Mar
(34) |
Apr
(9) |
May
(6) |
Jun
(10) |
Jul
(32) |
Aug
(8) |
Sep
(11) |
Oct
(35) |
Nov
(24) |
Dec
(22) |
2014 |
Jan
(44) |
Feb
(9) |
Mar
(9) |
Apr
(15) |
May
(25) |
Jun
(34) |
Jul
(16) |
Aug
(11) |
Sep
(7) |
Oct
(6) |
Nov
(1) |
Dec
(12) |
2015 |
Jan
(33) |
Feb
(19) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(5) |
From: <nic...@us...> - 2014-05-25 13:31:48
|
Revision: 4815 http://sourceforge.net/p/mp-plugins/code/4815 Author: nicsergio Date: 2014-05-25 13:31:45 +0000 (Sun, 25 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/KeyboardHook.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.Designer.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterKeyConfig.Designer.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterKeyConfig.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinNavigatorConfig.Designer.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinNavigatorConfig.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinWithSounds.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/LockKeys.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/LogHandler.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/RawInputHook.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/ShortCuter.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Program.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Properties/Resources.Designer.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Properties/Settings.Designer.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultConfig.xml trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj.user trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Added Paths: ----------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/NavigatorDialog.cs Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/KeyboardHook.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/KeyboardHook.cs 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/KeyboardHook.cs 2014-05-25 13:31:45 UTC (rev 4815) @@ -3,7 +3,7 @@ using System.Runtime.InteropServices; using System.Windows.Forms; -namespace ProcessPlugins.ShortCuter.Configuration +namespace ShortCuter.Configuration { internal class KeyboardHook //Classe per gestione hook di sistema { Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.Designer.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.Designer.cs 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.Designer.cs 2014-05-25 13:31:45 UTC (rev 4815) @@ -1,4 +1,4 @@ -namespace ProcessPlugins.ShortCuter.Configuration +namespace ShortCuter.Configuration { partial class ShortCuterConfig { @@ -212,7 +212,7 @@ // this.rowDownButton.AutoSize = true; this.rowDownButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.rowDownButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowDown; + this.rowDownButton.Image = global::ShortCuter.Properties.Resources.RowDown; this.rowDownButton.Location = new System.Drawing.Point(226, 264); this.rowDownButton.Name = "rowDownButton"; this.rowDownButton.Size = new System.Drawing.Size(38, 38); @@ -224,7 +224,7 @@ // this.rowUpButton.AutoSize = true; this.rowUpButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.rowUpButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowUp; + this.rowUpButton.Image = global::ShortCuter.Properties.Resources.RowUp; this.rowUpButton.Location = new System.Drawing.Point(186, 264); this.rowUpButton.Name = "rowUpButton"; this.rowUpButton.Size = new System.Drawing.Size(38, 38); @@ -234,7 +234,7 @@ // // infoPictureBox // - this.infoPictureBox.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.Info; + this.infoPictureBox.Image = global::ShortCuter.Properties.Resources.Info; this.infoPictureBox.Location = new System.Drawing.Point(990, 5); this.infoPictureBox.Name = "infoPictureBox"; this.infoPictureBox.Size = new System.Drawing.Size(24, 24); @@ -247,7 +247,7 @@ // this.rowRemoveButton.AutoSize = true; this.rowRemoveButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.rowRemoveButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowRemove; + this.rowRemoveButton.Image = global::ShortCuter.Properties.Resources.RowRemove; this.rowRemoveButton.Location = new System.Drawing.Point(46, 264); this.rowRemoveButton.Name = "rowRemoveButton"; this.rowRemoveButton.Size = new System.Drawing.Size(38, 38); @@ -259,7 +259,7 @@ // this.rowAddButton.AutoSize = true; this.rowAddButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; - this.rowAddButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowAdd; + this.rowAddButton.Image = global::ShortCuter.Properties.Resources.RowAdd; this.rowAddButton.Location = new System.Drawing.Point(6, 264); this.rowAddButton.Name = "rowAddButton"; this.rowAddButton.Size = new System.Drawing.Size(38, 38); @@ -270,7 +270,7 @@ // propLeftPictureBox // this.propLeftPictureBox.Enabled = false; - this.propLeftPictureBox.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.ArrowDown; + this.propLeftPictureBox.Image = global::ShortCuter.Properties.Resources.ArrowDown; this.propLeftPictureBox.Location = new System.Drawing.Point(360, 257); this.propLeftPictureBox.Name = "propLeftPictureBox"; this.propLeftPictureBox.Size = new System.Drawing.Size(131, 56); @@ -345,7 +345,7 @@ // this.rowCopyButton.AutoSize = true; this.rowCopyButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.rowCopyButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowCopy; + this.rowCopyButton.Image = global::ShortCuter.Properties.Resources.RowCopy; this.rowCopyButton.Location = new System.Drawing.Point(96, 264); this.rowCopyButton.Name = "rowCopyButton"; this.rowCopyButton.Size = new System.Drawing.Size(38, 38); @@ -357,7 +357,7 @@ // this.skinNavAddButton.AutoSize = true; this.skinNavAddButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; - this.skinNavAddButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.SkinNavAdd; + this.skinNavAddButton.Image = global::ShortCuter.Properties.Resources.SkinNavAdd; this.skinNavAddButton.Location = new System.Drawing.Point(136, 264); this.skinNavAddButton.Name = "skinNavAddButton"; this.skinNavAddButton.Size = new System.Drawing.Size(38, 38); @@ -367,7 +367,7 @@ // // skinNavConfigButton // - this.skinNavConfigButton.BackgroundImage = global::ProcessPlugins.ShortCuter.Properties.Resources.SkinNav; + this.skinNavConfigButton.BackgroundImage = global::ShortCuter.Properties.Resources.SkinNav; this.skinNavConfigButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.skinNavConfigButton.Location = new System.Drawing.Point(726, 220); this.skinNavConfigButton.Name = "skinNavConfigButton"; Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.cs 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.cs 2014-05-25 13:31:45 UTC (rev 4815) @@ -7,9 +7,9 @@ using MediaPortal.Profile; using My.Common; -namespace ProcessPlugins.ShortCuter.Configuration +namespace ShortCuter.Configuration { - [PluginIcons("ProcessPlugins.ShortCuter.Resources.Images.ShortCuterEnable.png", "ProcessPlugins.ShortCuter.Resources.Images.ShortCuterDisable.png")] + [PluginIcons("ShortCuter.Resources.Images.ShortCuterEnable.png", "ShortCuter.Resources.Images.ShortCuterDisable.png")] public partial class ShortCuterConfig : Form, ISetupForm //Form per la configurazione del plugin, con implementazione interfaccia ISetupForm (per lancio da configurazione MediaPortal) { #region Dati @@ -263,6 +263,8 @@ //Se inizializzazione classi non completata if (!mySkin.Initialized || !myShortCuts.Initialized) { + if (myShortCuts != null) + myShortCuts.Log -= myShortCuts_Log; //--> annullamento sottoscrizione evento di log shortuts this.Close(); this.Dispose(); } @@ -275,7 +277,12 @@ { //Se presenti modifiche non salvate: richiesta conferma per chiusura applicazione if (unsavedChanges && !Tools.QuestionMessage("Unsaved changes will be lost...\nDo you want to proceed?")) + { e.Cancel = true; //--> annullamento chiusura form + return; + } + if (myShortCuts != null) + myShortCuts.Log -= myShortCuts_Log; //--> annullamento sottoscrizione evento di log shortuts } #endregion #region Evento di Log Shortcuts @@ -465,7 +472,7 @@ } private void infoPictureBox_Click(object sender, EventArgs e) { - VersionInfo.ShowInfo(ProcessPlugins.ShortCuter.Properties.Resources.ShortCuter, "...a big thank to MoPath for old version of this plugin!", + VersionInfo.ShowInfo(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"); } Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterKeyConfig.Designer.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterKeyConfig.Designer.cs 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterKeyConfig.Designer.cs 2014-05-25 13:31:45 UTC (rev 4815) @@ -1,4 +1,4 @@ -namespace ProcessPlugins.ShortCuter.Configuration +namespace ShortCuter.Configuration { partial class ShortCuterKeyConfig { @@ -57,7 +57,7 @@ // // okPictureBox // - this.okPictureBox.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.Ok; + this.okPictureBox.Image = global::ShortCuter.Properties.Resources.Ok; this.okPictureBox.Location = new System.Drawing.Point(193, 15); this.okPictureBox.Name = "okPictureBox"; this.okPictureBox.Size = new System.Drawing.Size(32, 32); Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterKeyConfig.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterKeyConfig.cs 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterKeyConfig.cs 2014-05-25 13:31:45 UTC (rev 4815) @@ -2,9 +2,9 @@ using System.Drawing; using System.Windows.Forms; -namespace ProcessPlugins.ShortCuter.Configuration +namespace ShortCuter.Configuration { - public partial class ShortCuterKeyConfig : Form //Form per assegnazione key allo shortcut corrente + internal partial class ShortCuterKeyConfig : Form //Form per assegnazione key allo shortcut corrente { #region Dati private ShortCut mySc; //Istanza classe ShortCut per gestione shorcut corrente @@ -21,18 +21,22 @@ keyLabel.Text = mySc.Key; //--> visualizzazione tasto correntemente assegnato keyboardHook = new KeyboardHook(); //--> creazione oggetto per gestione hook di tastiera - keyboardHook.KeyDown += new KeyEventHandler(keyboardHook_KeyDown); //--> sottoscrizione evento di KeyDown } #endregion #region Consumazione Eventi private void ShortCuterKeyConfig_Load(object sender, EventArgs e) { + keyboardHook.KeyDown += new KeyEventHandler(keyboardHook_KeyDown); //--> sottoscrizione evento di KeyDown keyboardHook.hook(); //--> attivazione hook di tastiera } private void ShortCuterKeyConfig_FormClosing(object sender, FormClosingEventArgs e) { - keyboardHook.unhook(); //--> disattivazione hook di tastiera + if (keyboardHook != null) + { + keyboardHook.unhook(); //--> disattivazione hook di tastiera + keyboardHook.KeyDown -= keyboardHook_KeyDown; //--> annullamento sottoscrizione evento di KeyDown + } } private void okPictureBox_Click(object sender, EventArgs e) { Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinNavigatorConfig.Designer.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinNavigatorConfig.Designer.cs 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinNavigatorConfig.Designer.cs 2014-05-25 13:31:45 UTC (rev 4815) @@ -1,4 +1,4 @@ -namespace ProcessPlugins.ShortCuter.Configuration +namespace ShortCuter.Configuration { partial class SkinNavigatorConfig { Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinNavigatorConfig.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinNavigatorConfig.cs 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinNavigatorConfig.cs 2014-05-25 13:31:45 UTC (rev 4815) @@ -7,9 +7,9 @@ using System.Text; using System.Windows.Forms; -namespace ProcessPlugins.ShortCuter.Configuration +namespace ShortCuter.Configuration { - public partial class SkinNavigatorConfig : Form + internal partial class SkinNavigatorConfig : Form { public SkinNavigatorConfig() { Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinWithSounds.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinWithSounds.cs 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinWithSounds.cs 2014-05-25 13:31:45 UTC (rev 4815) @@ -2,7 +2,7 @@ using System.IO; using My.Common; -namespace ProcessPlugins.ShortCuter.Configuration +namespace ShortCuter.Configuration { internal class Skin : MediaPortalSkin //Classe per gestione skin di MediaPortal { Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/LockKeys.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/LockKeys.cs 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/LockKeys.cs 2014-05-25 13:31:45 UTC (rev 4815) @@ -2,7 +2,7 @@ using System.Runtime.InteropServices; using System.Windows.Forms; -namespace ProcessPlugins.ShortCuter +namespace ShortCuter { internal static class LockKeys //Classe per modifica stato blocco maiuscole/numeri { Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/LogHandler.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/LogHandler.cs 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/LogHandler.cs 2014-05-25 13:31:45 UTC (rev 4815) @@ -1,6 +1,6 @@ using System; -namespace ProcessPlugins.ShortCuter +namespace ShortCuter { internal delegate void LogEventHandler(object sender, LogEventArgs e); //Delegato per evento di log internal class LogEventArgs : EventArgs //Argomenti per evento di log Added: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/NavigatorDialog.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/NavigatorDialog.cs (rev 0) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/NavigatorDialog.cs 2014-05-25 13:31:45 UTC (rev 4815) @@ -0,0 +1,31 @@ +using MediaPortal.Dialogs; +using MediaPortal.GUI.Library; +using My.Common; + +namespace ShortCuter.Plugin +{ + public class NavigatorDialog : GUIDialogMenu //Classe per personalizzazione finestra di dialogo + { + #region Dati + public static const int DialogWindowID = 2821976; //Id finestra di dialogo personalizzata + public static const string DialogSkinFile = "ShortCuter.Navigator.DialogMenu.xml"; //File della skin per personalizzazione finestra di dialogo + #endregion + + #region Metodi Pubblici + public override bool Init() //Override metodo Init + { + return (Load(GUIGraphicsContext.Skin + @"\" + DialogSkinFile)); + //Load(GUIGraphicsContext.Theme + @"\" + DialogSkinFile) || + // Load(GUIGraphicsContext.Skin + @"\" + DialogSkinFile)); //--> inizializzazione solo se presente il file della skin per personalizzare la finestra di dialogo + } + public override string GetModuleName() //Override metodo GetModuleName + { + return Tools.MyAssembly.Title; //--> ritorno del titolo dell'assembly + } + #endregion + + #region Proprietà + public override int GetID { get { return DialogWindowID; } } + #endregion + } +} Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/RawInputHook.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/RawInputHook.cs 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/RawInputHook.cs 2014-05-25 13:31:45 UTC (rev 4815) @@ -3,9 +3,9 @@ using System.Runtime.InteropServices; using System.Windows.Forms; -namespace ProcessPlugins.ShortCuter.Plugin +namespace ShortCuter.Plugin { - public class RawInputHook : IMessageFilter //Classe per gestione hook mediante raw input + internal class RawInputHook : IMessageFilter //Classe per gestione hook mediante raw input { #region Dati private const int WM_INPUT = 0x00ff; //Id messaggio per RawInput Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/ShortCuter.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/ShortCuter.cs 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/ShortCuter.cs 2014-05-25 13:31:45 UTC (rev 4815) @@ -5,12 +5,13 @@ //using Action = MediaPortal.GUI.Library.Action; using My.Common; -namespace ProcessPlugins.ShortCuter.Plugin +namespace ShortCuter.Plugin { - public class ShortCuter : IPlugin //Classe gestore shortcuts + public class ShortCuter : GUIInternalWindow //: IPlugin //Classe gestore shortcuts { #region Dati private ShortCuts myShortCuts; //Istanza classe ShortCuts (dati relativi ai shortcuts configurati) + private RawInputHook rawInput; //Istanza classe RawInputHook (gestione hook mediante metodo raw input) private static readonly string LogPrefix; //Prefisso per log eventi #endregion @@ -21,8 +22,8 @@ } #endregion - #region Implementazione IPlugin - public void Start() //Avvio del plugin + #region Override GUIInternalWindow + public override bool Init() //Avvio del plugin { MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "Plugin started")); @@ -39,7 +40,7 @@ { try { - RawInputHook rawInput = new RawInputHook(GUIGraphicsContext.form.Handle); //--> creazione hook mediante RawInput + rawInput = new RawInputHook(GUIGraphicsContext.form.Handle); //--> creazione hook mediante RawInput rawInput.KeyDown += new KeyEventHandler(rawInput_KeyDown); //--> sottoscrizione evento KeyDown } catch (Exception e) @@ -59,11 +60,23 @@ } else MpLog(new LogEventArgs(LogEventArgs.LogLevels.Error, "Error loading configuration")); + return false; //--> nessun file principale per visualizzazione plugin } - public void Stop() //Terminazione del plugin + public override void DeInit() //Terminazione del plugin { MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "Plugin stopped")); + if (myShortCuts != null) + myShortCuts.Log -= myShortCuts_Log; //--> annullamento sottoscrizione evento di log shortuts + if (rawInput != null) + rawInput.KeyDown -= rawInput_KeyDown; //--> annullamento sottoscrizione evento shortuts + GUIWindowManager.OnActivateWindow -= GUIWindowManager_OnActivateWindow; //--> annullamento sottoscrizione evento di attivazione finestra di MediaPortal + base.DeInit(); //--> metodo classe base } + public override string GetModuleName() //Valorizzazione proprietà #currentmodule al caricamento + { + return Tools.MyAssembly.Title; + } + public override int GetID { get { return 2821976; } } //--> id finestra #endregion #region Metodi Privati @@ -87,7 +100,7 @@ } } #endregion - + #region Consumazione Eventi private void rawInput_KeyDown(object sender, KeyEventArgs e) //Evento di pressione tasto { Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Program.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Program.cs 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Program.cs 2014-05-25 13:31:45 UTC (rev 4815) @@ -1,7 +1,7 @@ using System; using System.Windows.Forms; -namespace ProcessPlugins.ShortCuter +namespace ShortCuter { static class Program { Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Properties/Resources.Designer.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Properties/Resources.Designer.cs 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Properties/Resources.Designer.cs 2014-05-25 13:31:45 UTC (rev 4815) @@ -8,7 +8,7 @@ // </auto-generated> //------------------------------------------------------------------------------ -namespace ProcessPlugins.ShortCuter.Properties { +namespace ShortCuter.Properties { using System; @@ -39,7 +39,7 @@ internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ProcessPlugins.ShortCuter.Properties.Resources", typeof(Resources).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ShortCuter.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Properties/Settings.Designer.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Properties/Settings.Designer.cs 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Properties/Settings.Designer.cs 2014-05-25 13:31:45 UTC (rev 4815) @@ -1,14 +1,14 @@ //------------------------------------------------------------------------------ // <auto-generated> // Il codice è stato generato da uno strumento. -// Versione runtime:4.0.30319.296 +// Versione runtime:4.0.30319.17929 // // Le modifiche apportate a questo file possono provocare un comportamento non corretto e andranno perse se // il codice viene rigenerato. // </auto-generated> //------------------------------------------------------------------------------ -namespace ProcessPlugins.ShortCuter.Properties { +namespace ShortCuter.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultConfig.xml =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultConfig.xml 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultConfig.xml 2014-05-25 13:31:45 UTC (rev 4815) @@ -189,7 +189,7 @@ <Separator>--------------------------------</Separator> <ShowNumbers>1</ShowNumbers> <RemoveDuplicates>1</RemoveDuplicates> - <UseCustomDialog>0</UseCustomDialog> + <UseCustomDialog>1</UseCustomDialog> </General> <Items> <Item> @@ -223,7 +223,7 @@ <Destinations> <Destination> <Caption>Music</Caption> - <WindowID>502</WindowID> + <WindowID>501</WindowID> <LoadParameter /> <Force>0</Force> <Icon /> Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2014-05-25 13:31:45 UTC (rev 4815) @@ -8,7 +8,7 @@ <ProjectGuid>{20CEBE32-A39E-4A61-B2BD-90BF16E2AEE8}</ProjectGuid> <OutputType>WinExe</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>ProcessPlugins.ShortCuter</RootNamespace> + <RootNamespace>ShortCuter</RootNamespace> <AssemblyName>ShortCuter</AssemblyName> <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> @@ -32,9 +32,12 @@ <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> + <DefineConstants> + </DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <DebugSymbols>true</DebugSymbols> + <PlatformTarget>AnyCPU</PlatformTarget> </PropertyGroup> <PropertyGroup> <StartupObject> @@ -43,6 +46,9 @@ <PropertyGroup> <ApplicationIcon>Resources\Images\ShortCuter.ico</ApplicationIcon> </PropertyGroup> + <PropertyGroup> + <SignAssembly>false</SignAssembly> + </PropertyGroup> <ItemGroup> <Reference Include="Common.Utils, Version=1.5.0.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> @@ -96,6 +102,7 @@ <Compile Include="Configuration\KeyboardHook.cs" /> <Compile Include="LockKeys.cs" /> <Compile Include="LogHandler.cs" /> + <Compile Include="Plugin\NavigatorDialog.cs" /> <Compile Include="Program.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\Resources.Designer.cs"> Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj.user =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj.user 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj.user 2014-05-25 13:31:45 UTC (rev 4815) @@ -10,4 +10,9 @@ <FallbackCulture>it-IT</FallbackCulture> <VerifyUploadedFiles>false</VerifyUploadedFiles> </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'"> + <StartAction>Project</StartAction> + <StartProgram>C:\Program Files (x86)\Team MediaPortal\MediaPortal\MediaPortal.exe</StartProgram> + <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging> + </PropertyGroup> </Project> \ No newline at end of file Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-23 13:47:11 UTC (rev 4814) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-25 13:31:45 UTC (rev 4815) @@ -13,8 +13,9 @@ using MediaPortal.Profile; using MediaPortal.Util; using My.Common; +using ShortCuter.Plugin; -namespace ProcessPlugins.ShortCuter +namespace ShortCuter { internal class WindowLink //Classe collegamento ad una finestra di MediaPortal { @@ -437,28 +438,6 @@ public BindingList<Destination> Destinations { get { return this._destinations; } } #endregion } - public class NavigatorDialog : GUIDialogMenu //Sotto-classe per eventuale personalizzazione finestra di dialogo - { - #region Dati - public const int DialogWindowID = 2821976; //Id finestra di dialogo personalizzata - public const string DialogSkinFile = "ShortCuter.SkinNavigator.DialogMenu.xml"; //File della skin per personalizzazione finestra di dialogo - #endregion - - #region Metodi Pubblici - public override bool Init() //Override metodo Init - { - return Load(GUIGraphicsContext.Skin + @"\" + DialogSkinFile); //--> inizializzazione solo se presente il file della skin per personalizzare la finestra di dialogo - } - public override string GetModuleName() //Override metodo GetModuleName - { - return Tools.MyAssembly.Title; //--> ritorno del titolo dell'assembly - } - #endregion - - #region Proprietà - public override int GetID { get { return DialogWindowID; } } - #endregion - } #endregion #region Dati @@ -477,14 +456,15 @@ #region Metodi Privati private Item.Destination ShowMenuDialog(List<Item.Destination> destinations) //Visualizzazione menu di navigazione { - GUIDialogMenu dlgMenu; + NavigatorDialog dlgMenu = (NavigatorDialog)GUIWindowManager.GetWindow(333); - if (_general.UseCustomDialog && File.Exists(GUIGraphicsContext.Skin + @"\" + NavigatorDialog.DialogSkinFile)) + //if (_general.UseCustomDialog && (File.Exists(GUIGraphicsContext.Skin + @"\" + "ShortCuter.Navigator.DialogMenu.xml") || + // File.Exists(GUIGraphicsContext.Theme + @"\" + "ShortCuter.Navigator.DialogMenu.xml"))) //Utilizzo della finestra di dialogo personalizzata - dlgMenu = (NavigatorDialog)GUIWindowManager.GetWindow(NavigatorDialog.DialogWindowID); - else + //dlgMenu = (NavigatorDialog)GUIWindowManager.GetWindow(2821976); + //else //Utilizzo della finestra di dialogo predefinita - dlgMenu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); + //dlgMenu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); dlgMenu.Reset(); dlgMenu.SetHeading(_general.MenuHeader); //--> intestazione menu @@ -515,7 +495,7 @@ try { XmlDocument xmlFile = new XmlDocument(); - using (Stream defaultConfig = Assembly.GetExecutingAssembly().GetManifestResourceStream("ProcessPlugins.ShortCuter.Resources.XmlFiles.DefaultConfig.xml")) + using (Stream defaultConfig = Assembly.GetExecutingAssembly().GetManifestResourceStream("ShortCuter.Resources.XmlFiles.DefaultConfig.xml")) { xmlFile.Load(defaultConfig); //Configurazione predefinita --> lettura file xml incapsulato } @@ -845,7 +825,7 @@ { XmlDocument xmlFile = new XmlDocument(); if (defaultSettings) - using (Stream defaultConfig = Assembly.GetExecutingAssembly().GetManifestResourceStream("ProcessPlugins.ShortCuter.Resources.XmlFiles.DefaultConfig.xml")) + using (Stream defaultConfig = Assembly.GetExecutingAssembly().GetManifestResourceStream("ShortCuter.Resources.XmlFiles.DefaultConfig.xml")) { xmlFile.Load(defaultConfig); //Configurazione predefinita --> lettura file xml incapsulato } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-05-23 13:47:16
|
Revision: 4814 http://sourceforge.net/p/mp-plugins/code/4814 Author: nicsergio Date: 2014-05-23 13:47:11 +0000 (Fri, 23 May 2014) Log Message: ----------- Removed Paths: ------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/KeyboardHook.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/RawInputHook.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.Designer.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.resx trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterKeyConfig.Designer.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterKeyConfig.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterKeyConfig.resx trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/SkinNavigatorConfig.Designer.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/SkinNavigatorConfig.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/SkinNavigatorConfig.resx trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/SkinWithSounds.cs Deleted: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/KeyboardHook.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/KeyboardHook.cs 2014-05-23 13:36:12 UTC (rev 4813) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/KeyboardHook.cs 2014-05-23 13:47:11 UTC (rev 4814) @@ -1,123 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Runtime.InteropServices; -using System.Windows.Forms; - -namespace ProcessPlugins.ShortCuter -{ - internal class KeyboardHook //Classe per gestione hook di sistema - { - #region Delegati/Strutture - /// Delegato da richiamare all'intercettazione del messaggio - /// Parametri: - /// code : codice hook - /// wParam: ID evento intercettato - /// lParam: informazioni sull'evento intercettato - public delegate int HookProc(int code, int wParam, ref HookStruct lParam); - - public struct HookStruct //Struttura hook - { - public int vkCode; - public int scanCode; - public int flags; - public int time; - public int dwExtraInfo; - } - #endregion - - #region Dati - #region Costanti - private const int WH_KEYBOARD_LL = 13; //Id evento per hook di tastiera di basso livello - private const int WM_KEYDOWN = 0x100; //Id messaggio KeyDown - private const int WM_KEYUP = 0x101; //Id messaggio KeyUp - private const int WM_SYSKEYDOWN = 0x104; //Id messaggio KeyDown (tasto di sistema) - private const int WM_SYSKEYUP = 0x105; //Id messaggio KeyUp (tasto di sistema) - #endregion - - public List<Keys> HookedKeys = new List<Keys>(); //Eventuale lista dei tasti da monitorare/intercettare - private IntPtr hHook = IntPtr.Zero; //Handle dell'hook - private IntPtr hInstance = IntPtr.Zero; //Handle dell'istanza della libreria esterna - private bool _hooked = false; //Hook attivato - #endregion - - #region Costruttore/Distruttore - public KeyboardHook() - { - hInstance = LoadLibrary("User32"); //--> caricamento libreria esterna e memorizzazione handle - } - ~KeyboardHook() - { - unhook(); //--> eventuale disinstallazione dell'hook di sistema - } - #endregion - - #region Metodi Privati - private int hookProc(int code, int wParam, ref HookStruct lParam) //Metodo richiamato per l'hook di tastiera - { - if (code >= 0) //Se codice hook valorizzato - { - Keys key = (Keys)lParam.vkCode; - if (HookedKeys == null || HookedKeys.Count == 0 || HookedKeys.Contains(key)) //Se il tasto appartiene alla lista dei tasti da intercettare (o lista non utilizzata) - { - KeyEventArgs kea = new KeyEventArgs(key); - if ((wParam == WM_KEYDOWN || wParam == WM_SYSKEYDOWN) && (KeyDown != null)) - { - KeyDown(this, kea); //--> richiamo dell'evento KeyDown - } - else if ((wParam == WM_KEYUP || wParam == WM_SYSKEYUP) && (KeyUp != null)) - { - KeyUp(this, kea); //--> richiamo dell'evento KeyUp - } - if (kea.Handled) //Se l'evento \xE8 stato gestito - return 1; //--> il tasto non viene passato al sistema - } - } - return CallNextHookEx(hHook, code, wParam, ref lParam); - } - #endregion - - #region Metodi Pubblici - public void hook() //Installazione dell'hook di sistema - { - unhook(); //--> eventuale disinstallazione hook - hHook = SetWindowsHookEx(WH_KEYBOARD_LL, hookProc, hInstance, 0); //--> installazione hook - _hooked = true; //--> memorizzazione hook attivo - } - public void unhook() //Disinstallazione dell'hook di sistema - { - if (_hooked) //Se hook attivo - { - UnhookWindowsHookEx(hHook); //--> disinstallazione hook - _hooked = false; //--> memorizzazione hook disattivo - } - } - #endregion - - #region Eventi - public event KeyEventHandler KeyDown; //Evento di pressione di uno dei tasti da monitorare - public event KeyEventHandler KeyUp; //Evento di rilascio di uno dei tasti da monitorare - #endregion - - #region Propriet\xE0 - public bool Hooked { get { return this._hooked; } } - #endregion - - #region Importazione DLL - //Installazione dell'hook, esecuzione dell'evento desiderato [uno dei parametri hInstance o threadId deve essere valorizzato] - [DllImport("user32.dll")] - static extern IntPtr SetWindowsHookEx(int idHook, HookProc callback, IntPtr hInstance, uint threadId); - - //Disinstallazione dell'hook (ritorna true se esecuzione con successo) - [DllImport("user32.dll")] - static extern bool UnhookWindowsHookEx(IntPtr hInstance); - - //Chiamata a hook successivo - [DllImport("user32.dll")] - static extern int CallNextHookEx(IntPtr idHook, int nCode, int wParam, ref HookStruct lParam); - - //Caricamento di una libreria (ritorna l'handle associato) - [DllImport("kernel32.dll")] - static extern IntPtr LoadLibrary(string lpFileName); - #endregion - } -} Deleted: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/RawInputHook.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/RawInputHook.cs 2014-05-23 13:36:12 UTC (rev 4813) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/RawInputHook.cs 2014-05-23 13:47:11 UTC (rev 4814) @@ -1,178 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Runtime.InteropServices; -using System.Windows.Forms; - -namespace ProcessPlugins.ShortCuter -{ - public class RawInputHook : IMessageFilter //Classe per gestione hook mediante raw input - { - #region Dati - private const int WM_INPUT = 0x00ff; //Id messaggio per RawInput - private List<RAWINPUTDEVICE> devices = new List<RAWINPUTDEVICE>(); //Lista dispositivi di input controllati - private bool _backgroundInput; //Consenti ricezione eventi anche con finestra in background - #endregion - - #region Costruttore - public RawInputHook(IntPtr windowHandle) - { - _backgroundInput = false; //--> default: monitoraggio solo con finestra in primo piano - AddKeyboardDevice(windowHandle); //--> monitoraggio input da tastiera - RegisterDevices(); //--> registrazione dispositivi - Application.AddMessageFilter(this); //--> aggiunta del filtro messaggi - } - #endregion - - #region Implementazione IMessageFilter - public bool PreFilterMessage(ref Message m) //Ricezione del messaggio di Windows - { - if (m.Msg == WM_INPUT) //Se messaggio per eventi RawInput - { - if (m.WParam == (IntPtr)0 || _backgroundInput) //Verifica se applicazione in primo piano o abilitazione anche in background - { - if (KeyDown != null) //Se evento sottoscritto - { - ProcessRawInput(m.LParam); //--> processazione evento - return true; //--> stop del messaggio - } - } - } - return false; //--> altrimenti messaggio gestito dal sistema - } - #endregion - - #region Metodi Privati - private void AddKeyboardDevice(IntPtr windowHandle) //Aggiunta della tastiera come dispositivo da monitorare - { - const ushort UsagePage = 1; //Device per il controllo generico del desktop - const ushort Usage = 6; //Tipologia di device (tastiera) - const Int32 Flags = 0x100; //[RIDEV_INPUTSINK] Abilita a ricevere gli eventi anche se l'applicazione non è in primo piano (windowHandle deve essere specificato) - - devices.Add(new RAWINPUTDEVICE(UsagePage, Usage, Flags, windowHandle)); //--> agiunta nella lista dei dispositivi da monitorare - } - private bool RegisterDevices() //Registrazione dei dispositivi specificati - { - if (devices.Count == 0) return false; - - RAWINPUTDEVICE[] d = devices.ToArray(); - return RegisterRawInputDevices(d, devices.Count, Marshal.SizeOf(typeof(RAWINPUTDEVICE))); - } - private void ProcessRawInput(IntPtr hRawInput) //Processazione RawInput - { - RAWINPUT pData = new RAWINPUT(); - int pcbSize = Marshal.SizeOf(typeof(RAWINPUT)); - - int result = GetRawInputData(hRawInput, RawInputCommand.Input, out pData, ref pcbSize, Marshal.SizeOf(typeof(RAWINPUTHEADER))); - - if (result != -1) - { - if (pData.Header.Type == RawInputType.Keyboard) //Se input da tastiera - { - if ((pData.Keyboard.Flags & 0x0001) == 0) //Primo bit di Flags = 0 --> evento KeyDown (a 1 --> KeyUp) - { - try - { - Keys key = (Keys)pData.Keyboard.VirtualKey; //KeyCode del tasto premuto - - //GetAsyncKeyState sembra più sicuro di Control.ModifierKeys - if ((GetAsyncKeyState(Keys.ControlKey) & 0x8000) != 0) - key = key | Keys.Control; //--> aggiunta eventuale modificatore CTRL - if ((GetAsyncKeyState(Keys.Menu) & 0x8000) != 0) - key = key | Keys.Alt; //--> aggiunta eventuale modificatore ALT - if ((GetAsyncKeyState(Keys.ShiftKey) & 0x8000) != 0) - key = key | Keys.Shift; //--> aggiunta eventuale modificatore SHIFT - KeyEventArgs kea = new KeyEventArgs(key); //--> generazione argomenti per evento KeyEvent - - KeyDown(this, kea); //--> richiamo dell'evento KeyDown - } - catch { } - } - } - } - } - #endregion - - #region Eventi - public event KeyEventHandler KeyDown; //Evento di pressione tasto - #endregion - - #region Proprietà - public bool BackgroundInput { get { return this._backgroundInput; } set { this._backgroundInput = value; } } - #endregion - - #region Importazione DLL - //Registrazione dispositivi da monitorare - [DllImport("user32.dll")] - static extern bool RegisterRawInputDevices([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] RAWINPUTDEVICE[] pRawInputDevices, int uiNumDevices, int cbSize); - - //Ottenimento dati relativi all'evento di RawInput - [DllImport("user32.dll")] - static extern int GetRawInputData(IntPtr hRawInput, RawInputCommand uiCommand, out RAWINPUT pData, ref int pcbSize, int cbSizeHeader); - - //Controllo dello stato di un tasto - [DllImport("user32.dll", CharSet = CharSet.Auto)] - private static extern short GetAsyncKeyState(Keys key); - #endregion - } - - #region Strutture/Enumerativi - [StructLayout(LayoutKind.Sequential)] - struct RAWINPUTDEVICE //Struttura dispositivo per RawInput - { - public ushort UsagePage; //Tipologia di device - public ushort Usage; //Sotto-tipologia di device (tastiera/mouse/..) - public Int32 Flags; //Modalità di monitoraggio - public IntPtr WindowHandle; //Handle della finestra (necessario con Flags = RIDEV_INPUTSINK) - - public RAWINPUTDEVICE(ushort usagePage, ushort usage, Int32 flags, IntPtr windowHandle) - { - UsagePage = usagePage; - Usage = usage; - Flags = flags; - WindowHandle = windowHandle; - } - } - - [StructLayout(LayoutKind.Explicit)] - public struct RAWINPUT //Struttura dati per RawInput - { - [FieldOffset(0)] - public RAWINPUTHEADER Header; - [FieldOffset(16)] - public RAWKEYBOARD Keyboard; - } - - [StructLayout(LayoutKind.Sequential)] - public struct RAWINPUTHEADER //Struttura dati Header per evento RawInput - { - public RawInputType Type; - public int Size; - public IntPtr Device; - public IntPtr wParam; - } - - [StructLayout(LayoutKind.Sequential)] - public struct RAWKEYBOARD //Struttura dati Keyboard per evento RawInput - { - public ushort MakeCode; //Codice "grezzo" del tasto, prima della traduzione in funzione della tastiera (corrisponde a DirectInput) - public ushort Flags; //Flags per la tipologa di scansione (0=KeyDown, 1=KeyUp, 2=Versione sx del tasto, 4=Versione dx del tasto) - public ushort Reserved; //--- - public ushort VirtualKey; //KeyCode compatibile con il messaggio - public int Message; //Tipo di messaggio - public int ExtraInformation; //Informazioni addizionali del dispositivo che ha generato l'evento - } - - public enum RawInputType //Tipologie di dispositivo per RawInput - { - Mouse = 0, - Keyboard = 1, - HID = 2 - } - - enum RawInputCommand //Tipologie di comando per ottenimento dati su evento RawInput - { - Input = 0x10000003, - Header = 0x10000005 - } - #endregion -} Deleted: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs 2014-05-23 13:36:12 UTC (rev 4813) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs 2014-05-23 13:47:11 UTC (rev 4814) @@ -1,106 +0,0 @@ -using System; -using System.Windows.Forms; -using MediaPortal.Configuration; -using MediaPortal.GUI.Library; -//using Action = MediaPortal.GUI.Library.Action; -using My.Common; - -namespace ProcessPlugins.ShortCuter -{ - public class ShortCuter : IPlugin //Classe gestore shortcuts - { - #region Dati - private ShortCuts myShortCuts; //Istanza classe ShortCuts (dati relativi ai shortcuts configurati) - private static readonly string LogPrefix; //Prefisso per log eventi - #endregion - - #region Costruttore - static ShortCuter() //Costruttore classe ShortCuter - { - LogPrefix = Tools.MyAssembly.Title + ": "; //Header per log su file (titolo assembly) - } - #endregion - - #region Implementazione IPlugin - public void Start() //Avvio del plugin - { - MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "Plugin started")); - - string settingsFile = Config.GetFile(Config.Dir.Config, Tools.MyAssembly.Name + ".xml"); - myShortCuts = new ShortCuts(settingsFile); //Creazione classe per gestione shorcuts - myShortCuts.Log += new LogEventHandler(myShortCuts_Log); //--> sottoscrizione evento di log shortuts - - if (LockKeys.ChangeCapsLock(myShortCuts.General.ForcingCapsLock)) - MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "CapsLock " + ((myShortCuts.General.ForcingCapsLock == LockKeys.LockKeyActions.Off) ? "deactivated" : "activated"))); - if (LockKeys.ChangeNumLock(myShortCuts.General.ForcingNumLock)) - MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "NumLock " + ((myShortCuts.General.ForcingNumLock == LockKeys.LockKeyActions.Off) ? "deactivated" : "activated"))); - - if (myShortCuts.Initialize()) //Inizializzazione & lettura impostazioni shorcuts - { - try - { - RawInputHook rawInput = new RawInputHook(GUIGraphicsContext.form.Handle); //--> creazione hook mediante RawInput - rawInput.KeyDown += new KeyEventHandler(rawInput_KeyDown); //--> sottoscrizione evento KeyDown - } - catch (Exception e) - { - MpLog(new LogEventArgs(LogEventArgs.LogLevels.Error, "Error creating raw input hook", e)); - } - - try - { - //Sottoscrizione evento di attivazione finestra di MediaPortal - GUIWindowManager.OnActivateWindow += new GUIWindowManager.WindowActivationHandler(GUIWindowManager_OnActivateWindow); - } - catch (Exception e) - { - MpLog(new LogEventArgs(LogEventArgs.LogLevels.Error, "Error subscription ActivateWindow event", e)); - } - } - else - MpLog(new LogEventArgs(LogEventArgs.LogLevels.Error, "Error loading configuration")); - } - public void Stop() //Terminazione del plugin - { - MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "Plugin stopped")); - } - #endregion - - #region Metodi Privati - private void MpLog(LogEventArgs e) //Registrazione evento su log di MediaPortal - { - string message = LogPrefix + e.LogMessage; - - switch (e.LogLevel) - { - case LogEventArgs.LogLevels.Error: - if (e.LogException != null) - message += " [" + e.LogException.Message + " (" + e.LogException.StackTrace + ")]"; - Log.Error(message); //--> log errore - break; - case LogEventArgs.LogLevels.Info: - Log.Info(message); //--> log messaggio informativo - break; - case LogEventArgs.LogLevels.Debug: - Log.Debug(message); //--> log informazione per debug - break; - } - } - #endregion - - #region Consumazione Eventi - private void rawInput_KeyDown(object sender, KeyEventArgs e) //Evento di pressione tasto - { - myShortCuts.KeysReceiving(e); //--> pubblicazione a gestore shortcuts - } - private void GUIWindowManager_OnActivateWindow(int windowID) //Evento di attivazione finestra di MediaPortal - { - myShortCuts.WindowChanged(windowID); //--> pubblicazione a gestore shortcuts - } - private void myShortCuts_Log(object sender, LogEventArgs e) //Evento di log gestore shortcuts - { - MpLog(e); //--> log - } - #endregion - } -} Deleted: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.Designer.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.Designer.cs 2014-05-23 13:36:12 UTC (rev 4813) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.Designer.cs 2014-05-23 13:47:11 UTC (rev 4814) @@ -1,468 +0,0 @@ -namespace ProcessPlugins.ShortCuter -{ - partial class ShortCuterConfig - { - /// <summary> - /// Required designer variable. - /// </summary> - private System.ComponentModel.IContainer components = null; - - /// <summary> - /// Clean up any resources being used. - /// </summary> - /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// <summary> - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// </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(ShortCuterConfig)); - this.shortCutsDataGridView = new System.Windows.Forms.DataGridView(); - this.linkPropertiesGroupBox = new System.Windows.Forms.GroupBox(); - this.loadParameterGroupBox = new System.Windows.Forms.GroupBox(); - this.loadParameterTextBox = new System.Windows.Forms.TextBox(); - this.windowIdGroupBox = new System.Windows.Forms.GroupBox(); - 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.updateButton = new System.Windows.Forms.Button(); - this.resetButton = new System.Windows.Forms.Button(); - this.rowDownButton = new System.Windows.Forms.Button(); - this.rowUpButton = new System.Windows.Forms.Button(); - this.infoPictureBox = new System.Windows.Forms.PictureBox(); - this.rowRemoveButton = new System.Windows.Forms.Button(); - this.rowAddButton = new System.Windows.Forms.Button(); - this.propLeftPictureBox = new System.Windows.Forms.PictureBox(); - this.saveButton = new System.Windows.Forms.Button(); - this.overridesGroupBox = new System.Windows.Forms.GroupBox(); - this.numLockGroupBox = new System.Windows.Forms.GroupBox(); - this.numLockComboBox = new System.Windows.Forms.ComboBox(); - this.capsLockGroupBox = new System.Windows.Forms.GroupBox(); - this.capsLockComboBox = new System.Windows.Forms.ComboBox(); - this.rowCopyButton = new System.Windows.Forms.Button(); - this.skinNavAddButton = new System.Windows.Forms.Button(); - this.skinNavConfigButton = new System.Windows.Forms.Button(); - this.skinItems = new My.Common.SkinItems(); - ((System.ComponentModel.ISupportInitialize)(this.shortCutsDataGridView)).BeginInit(); - this.linkPropertiesGroupBox.SuspendLayout(); - this.loadParameterGroupBox.SuspendLayout(); - this.windowIdGroupBox.SuspendLayout(); - this.skinFileGroupBox.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.infoPictureBox)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.propLeftPictureBox)).BeginInit(); - this.overridesGroupBox.SuspendLayout(); - this.numLockGroupBox.SuspendLayout(); - this.capsLockGroupBox.SuspendLayout(); - this.SuspendLayout(); - // - // shortCutsDataGridView - // - this.shortCutsDataGridView.AllowUserToAddRows = false; - this.shortCutsDataGridView.AllowUserToDeleteRows = false; - this.shortCutsDataGridView.AllowUserToResizeRows = false; - this.shortCutsDataGridView.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(213)))), ((int)(((byte)(220)))), ((int)(((byte)(227))))); - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.shortCutsDataGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; - this.shortCutsDataGridView.ColumnHeadersHeight = 30; - this.shortCutsDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; - this.shortCutsDataGridView.Location = new System.Drawing.Point(6, 304); - this.shortCutsDataGridView.MultiSelect = false; - this.shortCutsDataGridView.Name = "shortCutsDataGridView"; - this.shortCutsDataGridView.RowHeadersWidth = 20; - this.shortCutsDataGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing; - this.shortCutsDataGridView.Size = new System.Drawing.Size(1006, 429); - this.shortCutsDataGridView.TabIndex = 0; - this.shortCutsDataGridView.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.shortCutsDataGridView_CellDoubleClick); - this.shortCutsDataGridView.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.shortCutsDataGridView_CellEndEdit); - this.shortCutsDataGridView.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.shortCutsDataGridView_CellFormatting); - this.shortCutsDataGridView.CurrentCellChanged += new System.EventHandler(this.shortCutsDataGridView_CurrentCellChanged); - this.shortCutsDataGridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.shortCutsDataGridView_DataError); - this.shortCutsDataGridView.EditingControlShowing += new System.Windows.Forms.DataGridViewEditingControlShowingEventHandler(this.shortCutsDataGridView_EditingControlShowing); - this.shortCutsDataGridView.Enter += new System.EventHandler(this.shortCutsDataGridView_Enter); - // - // linkPropertiesGroupBox - // - this.linkPropertiesGroupBox.Controls.Add(this.loadParameterGroupBox); - this.linkPropertiesGroupBox.Controls.Add(this.windowIdGroupBox); - this.linkPropertiesGroupBox.Controls.Add(this.skinFileGroupBox); - this.linkPropertiesGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.linkPropertiesGroupBox.Location = new System.Drawing.Point(602, 30); - this.linkPropertiesGroupBox.Name = "linkPropertiesGroupBox"; - this.linkPropertiesGroupBox.Size = new System.Drawing.Size(320, 175); - this.linkPropertiesGroupBox.TabIndex = 31; - this.linkPropertiesGroupBox.TabStop = false; - this.linkPropertiesGroupBox.Text = "Link Properties"; - // - // loadParameterGroupBox - // - this.loadParameterGroupBox.Controls.Add(this.loadParameterTextBox); - this.loadParameterGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.loadParameterGroupBox.Location = new System.Drawing.Point(4, 103); - this.loadParameterGroupBox.Name = "loadParameterGroupBox"; - this.loadParameterGroupBox.Size = new System.Drawing.Size(312, 68); - this.loadParameterGroupBox.TabIndex = 37; - this.loadParameterGroupBox.TabStop = false; - this.loadParameterGroupBox.Text = "Load Parameter:"; - // - // loadParameterTextBox - // - this.loadParameterTextBox.BackColor = System.Drawing.SystemColors.Control; - this.loadParameterTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.loadParameterTextBox.ForeColor = System.Drawing.Color.Blue; - this.loadParameterTextBox.Location = new System.Drawing.Point(6, 19); - this.loadParameterTextBox.Multiline = true; - this.loadParameterTextBox.Name = "loadParameterTextBox"; - this.loadParameterTextBox.ReadOnly = true; - this.loadParameterTextBox.Size = new System.Drawing.Size(300, 43); - this.loadParameterTextBox.TabIndex = 39; - this.loadParameterTextBox.Text = "-"; - this.loadParameterTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - // - // windowIdGroupBox - // - this.windowIdGroupBox.Controls.Add(this.windowIdLabel); - this.windowIdGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.windowIdGroupBox.Location = new System.Drawing.Point(4, 63); - this.windowIdGroupBox.Name = "windowIdGroupBox"; - this.windowIdGroupBox.Size = new System.Drawing.Size(312, 34); - this.windowIdGroupBox.TabIndex = 36; - this.windowIdGroupBox.TabStop = false; - this.windowIdGroupBox.Text = "Window ID:"; - // - // windowIdLabel - // - this.windowIdLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.windowIdLabel.ForeColor = System.Drawing.Color.Blue; - this.windowIdLabel.Location = new System.Drawing.Point(6, 16); - this.windowIdLabel.Name = "windowIdLabel"; - this.windowIdLabel.Size = new System.Drawing.Size(300, 13); - this.windowIdLabel.TabIndex = 6; - this.windowIdLabel.Text = "-"; - this.windowIdLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // skinFileGroupBox - // - this.skinFileGroupBox.Controls.Add(this.skinFileLabel); - this.skinFileGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.skinFileGroupBox.Location = new System.Drawing.Point(4, 23); - this.skinFileGroupBox.Name = "skinFileGroupBox"; - this.skinFileGroupBox.Size = new System.Drawing.Size(312, 34); - this.skinFileGroupBox.TabIndex = 6; - this.skinFileGroupBox.TabStop = false; - this.skinFileGroupBox.Text = "Skin File:"; - // - // skinFileLabel - // - this.skinFileLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.skinFileLabel.ForeColor = System.Drawing.Color.Blue; - this.skinFileLabel.Location = new System.Drawing.Point(6, 16); - this.skinFileLabel.Name = "skinFileLabel"; - this.skinFileLabel.Size = new System.Drawing.Size(300, 13); - this.skinFileLabel.TabIndex = 2; - this.skinFileLabel.Text = "-"; - this.skinFileLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // toolTip - // - this.toolTip.ShowAlways = true; - // - // updateButton - // - this.updateButton.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(192))))); - this.updateButton.Location = new System.Drawing.Point(67, 84); - this.updateButton.Name = "updateButton"; - this.updateButton.Size = new System.Drawing.Size(135, 38); - this.updateButton.TabIndex = 32; - this.updateButton.Text = "Save and Close"; - this.updateButton.UseVisualStyleBackColor = false; - this.updateButton.Click += new System.EventHandler(this.updateButton_Click); - // - // resetButton - // - this.resetButton.Location = new System.Drawing.Point(67, 8); - this.resetButton.Name = "resetButton"; - this.resetButton.Size = new System.Drawing.Size(133, 23); - this.resetButton.TabIndex = 33; - this.resetButton.Text = "Reset Configuration"; - this.resetButton.UseVisualStyleBackColor = true; - this.resetButton.Click += new System.EventHandler(this.resetButton_Click); - // - // rowDownButton - // - this.rowDownButton.AutoSize = true; - this.rowDownButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.rowDownButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowDown; - this.rowDownButton.Location = new System.Drawing.Point(226, 264); - this.rowDownButton.Name = "rowDownButton"; - this.rowDownButton.Size = new System.Drawing.Size(38, 38); - this.rowDownButton.TabIndex = 35; - this.rowDownButton.UseVisualStyleBackColor = true; - this.rowDownButton.Click += new System.EventHandler(this.rowDownButton_Click); - // - // rowUpButton - // - this.rowUpButton.AutoSize = true; - this.rowUpButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.rowUpButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowUp; - this.rowUpButton.Location = new System.Drawing.Point(186, 264); - this.rowUpButton.Name = "rowUpButton"; - this.rowUpButton.Size = new System.Drawing.Size(38, 38); - this.rowUpButton.TabIndex = 34; - this.rowUpButton.UseVisualStyleBackColor = true; - this.rowUpButton.Click += new System.EventHandler(this.rowUpButton_Click); - // - // infoPictureBox - // - this.infoPictureBox.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.Info; - this.infoPictureBox.Location = new System.Drawing.Point(990, 5); - this.infoPictureBox.Name = "infoPictureBox"; - this.infoPictureBox.Size = new System.Drawing.Size(24, 24); - this.infoPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.infoPictureBox.TabIndex = 30; - this.infoPictureBox.TabStop = false; - this.infoPictureBox.Click += new System.EventHandler(this.infoPictureBox_Click); - // - // rowRemoveButton - // - this.rowRemoveButton.AutoSize = true; - this.rowRemoveButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.rowRemoveButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowRemove; - this.rowRemoveButton.Location = new System.Drawing.Point(46, 264); - this.rowRemoveButton.Name = "rowRemoveButton"; - this.rowRemoveButton.Size = new System.Drawing.Size(38, 38); - this.rowRemoveButton.TabIndex = 26; - this.rowRemoveButton.UseVisualStyleBackColor = true; - this.rowRemoveButton.Click += new System.EventHandler(this.rowRemoveButton_Click); - // - // rowAddButton - // - this.rowAddButton.AutoSize = true; - this.rowAddButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; - this.rowAddButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowAdd; - this.rowAddButton.Location = new System.Drawing.Point(6, 264); - this.rowAddButton.Name = "rowAddButton"; - this.rowAddButton.Size = new System.Drawing.Size(38, 38); - this.rowAddButton.TabIndex = 25; - this.rowAddButton.UseVisualStyleBackColor = true; - this.rowAddButton.Click += new System.EventHandler(this.rowAddButton_Click); - // - // propLeftPictureBox - // - this.propLeftPictureBox.Enabled = false; - this.propLeftPictureBox.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.ArrowDown; - this.propLeftPictureBox.Location = new System.Drawing.Point(360, 257); - this.propLeftPictureBox.Name = "propLeftPictureBox"; - this.propLeftPictureBox.Size = new System.Drawing.Size(131, 56); - this.propLeftPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.propLeftPictureBox.TabIndex = 23; - this.propLeftPictureBox.TabStop = false; - this.propLeftPictureBox.Visible = false; - // - // saveButton - // - this.saveButton.Location = new System.Drawing.Point(67, 35); - this.saveButton.Name = "saveButton"; - this.saveButton.Size = new System.Drawing.Size(133, 23); - this.saveButton.TabIndex = 36; - this.saveButton.Text = "Save Configuration"; - this.saveButton.UseVisualStyleBackColor = true; - this.saveButton.Click += new System.EventHandler(this.saveButton_Click); - // - // overridesGroupBox - // - this.overridesGroupBox.Controls.Add(this.numLockGroupBox); - this.overridesGroupBox.Controls.Add(this.capsLockGroupBox); - this.overridesGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.overridesGroupBox.Location = new System.Drawing.Point(50, 133); - this.overridesGroupBox.Name = "overridesGroupBox"; - this.overridesGroupBox.Size = new System.Drawing.Size(165, 111); - this.overridesGroupBox.TabIndex = 37; - this.overridesGroupBox.TabStop = false; - this.overridesGroupBox.Text = "Overrides at Start-Up"; - // - // numLockGroupBox - // - this.numLockGroupBox.Controls.Add(this.numLockComboBox); - this.numLockGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.numLockGroupBox.Location = new System.Drawing.Point(6, 63); - this.numLockGroupBox.Name = "numLockGroupBox"; - this.numLockGroupBox.Size = new System.Drawing.Size(152, 42); - this.numLockGroupBox.TabIndex = 38; - this.numLockGroupBox.TabStop = false; - this.numLockGroupBox.Text = "Num-Lock Forcing:"; - // - // numLockComboBox - // - this.numLockComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.numLockComboBox.FormattingEnabled = true; - this.numLockComboBox.Location = new System.Drawing.Point(9, 15); - this.numLockComboBox.Name = "numLockComboBox"; - this.numLockComboBox.Size = new System.Drawing.Size(133, 21); - this.numLockComboBox.TabIndex = 1; - // - // capsLockGroupBox - // - this.capsLockGroupBox.Controls.Add(this.capsLockComboBox); - this.capsLockGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.capsLockGroupBox.Location = new System.Drawing.Point(6, 15); - this.capsLockGroupBox.Name = "capsLockGroupBox"; - this.capsLockGroupBox.Size = new System.Drawing.Size(152, 42); - this.capsLockGroupBox.TabIndex = 37; - this.capsLockGroupBox.TabStop = false; - this.capsLockGroupBox.Text = "Caps-Lock Forcing:"; - // - // capsLockComboBox - // - this.capsLockComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.capsLockComboBox.FormattingEnabled = true; - this.capsLockComboBox.Location = new System.Drawing.Point(9, 15); - this.capsLockComboBox.Name = "capsLockComboBox"; - this.capsLockComboBox.Size = new System.Drawing.Size(133, 21); - this.capsLockComboBox.TabIndex = 0; - // - // rowCopyButton - // - this.rowCopyButton.AutoSize = true; - this.rowCopyButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.rowCopyButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowCopy; - this.rowCopyButton.Location = new System.Drawing.Point(96, 264); - this.rowCopyButton.Name = "rowCopyButton"; - this.rowCopyButton.Size = new System.Drawing.Size(38, 38); - this.rowCopyButton.TabIndex = 38; - this.rowCopyButton.UseVisualStyleBackColor = true; - this.rowCopyButton.Click += new System.EventHandler(this.rowCopyButton_Click); - // - // skinNavAddButton - // - this.skinNavAddButton.AutoSize = true; - this.skinNavAddButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; - this.skinNavAddButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.SkinNavAdd; - this.skinNavAddButton.Location = new System.Drawing.Point(136, 264); - this.skinNavAddButton.Name = "skinNavAddButton"; - this.skinNavAddButton.Size = new System.Drawing.Size(38, 38); - this.skinNavAddButton.TabIndex = 40; - this.skinNavAddButton.UseVisualStyleBackColor = true; - this.skinNavAddButton.Click += new System.EventHandler(this.skinNavAddButton_Click); - // - // skinNavConfigButton - // - this.skinNavConfigButton.BackgroundImage = global::ProcessPlugins.ShortCuter.Properties.Resources.SkinNav; - this.skinNavConfigButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.skinNavConfigButton.Location = new System.Drawing.Point(726, 220); - this.skinNavConfigButton.Name = "skinNavConfigButton"; - this.skinNavConfigButton.Size = new System.Drawing.Size(70, 70); - this.skinNavConfigButton.TabIndex = 41; - this.skinNavConfigButton.UseVisualStyleBackColor = true; - this.skinNavConfigButton.Click += new System.EventHandler(this.skinNavConfigButton_Click); - // - // skinItems - // - this.skinItems.Location = new System.Drawing.Point(266, 8); - this.skinItems.Name = "skinItems"; - this.skinItems.SelectedIndex = -1; - this.skinItems.SelectedTab = My.Common.SkinItems.SkinItemsType.Links; - this.skinItems.Size = new System.Drawing.Size(330, 260); - this.skinItems.TabIndex = 39; - this.skinItems.Enter += new System.EventHandler(this.skinItems_Enter); - this.skinItems.DoubleClick += new System.EventHandler(this.skinItems_DoubleClick); - this.skinItems.SelectedIndexChanged += new System.EventHandler(this.skinItems_SelectedIndexChanged); - // - // ShortCuterConfig - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1018, 740); - this.Controls.Add(this.skinNavConfigButton); - this.Controls.Add(this.skinNavAddButton); - this.Controls.Add(this.skinItems); - this.Controls.Add(this.rowCopyButton); - this.Controls.Add(this.overridesGroupBox); - this.Controls.Add(this.saveButton); - this.Controls.Add(this.rowDownButton); - this.Controls.Add(this.linkPropertiesGroupBox); - this.Controls.Add(this.rowUpButton); - this.Controls.Add(this.resetButton); - this.Controls.Add(this.updateButton); - this.Controls.Add(this.infoPictureBox); - this.Controls.Add(this.rowRemoveButton); - this.Controls.Add(this.rowAddButton); - this.Controls.Add(this.shortCutsDataGridView); - this.Controls.Add(this.propLeftPictureBox); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.Name = "ShortCuterConfig"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "ShortCut\'er Plugin Configuration"; - this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ShortCuterConfig_FormClosing); - this.Load += new System.EventHandler(this.ShortCuterConfig_Load); - this.Shown += new System.EventHandler(this.ShortCuterConfig_Shown); - ((System.ComponentModel.ISupportInitialize)(this.shortCutsDataGridView)).EndInit(); - this.linkPropertiesGroupBox.ResumeLayout(false); - this.loadParameterGroupBox.ResumeLayout(false); - this.loadParameterGroupBox.PerformLayout(); - this.windowIdGroupBox.ResumeLayout(false); - this.skinFileGroupBox.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.infoPictureBox)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.propLeftPictureBox)).EndInit(); - this.overridesGroupBox.ResumeLayout(false); - this.numLockGroupBox.ResumeLayout(false); - this.capsLockGroupBox.ResumeLayout(false); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.DataGridView shortCutsDataGridView; - private System.Windows.Forms.PictureBox propLeftPictureBox; - private System.Windows.Forms.Button rowAddButton; - private System.Windows.Forms.Button rowRemoveButton; - private System.Windows.Forms.PictureBox infoPictureBox; - private System.Windows.Forms.GroupBox linkPropertiesGroupBox; - private System.Windows.Forms.ToolTip toolTip; - private System.Windows.Forms.Button updateButton; - private System.Windows.Forms.Button resetButton; - private System.Windows.Forms.Button rowDownButton; - private System.Windows.Forms.Button rowUpButton; - private System.Windows.Forms.GroupBox windowIdGroupBox; - private System.Windows.Forms.Label windowIdLabel; - private System.Windows.Forms.GroupBox skinFileGroupBox; - private System.Windows.Forms.Label skinFileLabel; - private System.Windows.Forms.GroupBox loadParameterGroupBox; - private System.Windows.Forms.Button saveButton; - private System.Windows.Forms.TextBox loadParameterTextBox; - private System.Windows.Forms.GroupBox overridesGroupBox; - private System.Windows.Forms.GroupBox capsLockGroupBox; - private System.Windows.Forms.GroupBox numLockGroupBox; - private System.Windows.Forms.ComboBox capsLockComboBox; - private System.Windows.Forms.ComboBox numLockComboBox; - private System.Windows.Forms.Button rowCopyButton; - private My.Common.SkinItems skinItems; - private System.Windows.Forms.Button skinNavAddButton; - private System.Windows.Forms.Button skinNavConfigButton; - - } -} \ No newline at end of file Deleted: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs 2014-05-23 13:36:12 UTC (rev 4813) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs 2014-05-23 13:47:11 UTC (rev 4814) @@ -1,517 +0,0 @@ -using System; -using System.ComponentModel; -using System.Drawing; -using System.Windows.Forms; -using MediaPortal.Configuration; -using MediaPortal.GUI.Library; -using MediaPortal.Profile; -using My.Common; - -namespace ProcessPlugins.ShortCuter -{ - [PluginIcons("ProcessPlugins.ShortCuter.Resources.Images.ShortCuterEnable.png", "ProcessPlugins.ShortCuter.Resources.Images.ShortCuterDisable.png")] - public partial class ShortCuterConfig : Form, ISetupForm //Form per la configurazione del plugin, con implementazione interfaccia ISetupForm (per lancio da configurazione MediaPortal) - { - #region Dati - private Skin mySkin; //Istanza classe Skin (dati relativi alla skin di MediaPortal) - private ShortCuts myShortCuts; //Istanza classe ShortCuts (dati relativi ai shortcuts configurati) - private bool unsavedChanges; //Presenza modifiche da salvare - private bool forceCell; //Azione di forzatura valore cella WindowID dello shortcut - #endregion - - #region Costruttore - public ShortCuterConfig() - { - InitializeComponent(); - } - #endregion - - #region Metodi Privati - private void InitializeGUI() //Inizializzazione interfaccia - { - skinItems.Populate(mySkin.SkinFiles, mySkin.SkinLinks, false, true); - FormatShortCutsGrid(); - - capsLockComboBox.DataSource = Enum.GetNames(typeof(LockKeys.LockKeyActions)); - capsLockComboBox.SelectedItem = Enum.GetName(typeof(LockKeys.LockKeyActions), myShortCuts.General.ForcingCapsLock); - numLockComboBox.DataSource = Enum.GetNames(typeof(LockKeys.LockKeyActions)); - numLockComboBox.SelectedItem = Enum.GetName(typeof(LockKeys.LockKeyActions), myShortCuts.General.ForcingNumLock); - - toolTip.SetToolTip(skinItems, "Double click to set the link's parameter to shortcut"); - toolTip.SetToolTip(rowAddButton, "Add shortcut to list"); - toolTip.SetToolTip(rowRemoveButton, "Remove selected shortcut from list"); - toolTip.SetToolTip(rowCopyButton, "Copy selected shortcut to list"); - toolTip.SetToolTip(skinNavAddButton, "Add a shortcut to Skin Navigator in list"); - toolTip.SetToolTip(rowUpButton, "Move up selected shortcut in list"); - toolTip.SetToolTip(rowDownButton, "Move down selected shortcut in list"); - toolTip.SetToolTip(resetButton, "Reset actual settings and load the default configuration"); - toolTip.SetToolTip(saveButton, "Save actual settings"); - toolTip.SetToolTip(updateButton, "Save actual setting and close the application"); - toolTip.SetToolTip(capsLockComboBox, "Set forcing for Caps-Lock when MediaPortal starts (OFF is recommended)"); - toolTip.SetToolTip(numLockComboBox, "Set forcing for Num-Lock when MediaPortal starts"); - toolTip.SetToolTip(skinNavConfigButton, "Configure Skin Navigator"); - toolTip.SetToolTip(infoPictureBox, "Version information"); - - unsavedChanges = false; //--> necessario a fine aggiornamento controlli grafici - } - private void FormatShortCutsGrid() //Formattazione (e popolazione) tabella shortcuts - { - shortCutsDataGridView.AutoGenerateColumns = false; - - DataGridViewTextBoxColumn captionColumn = new DataGridViewTextBoxColumn(); - captionColumn.DataPropertyName = "Caption"; - captionColumn.HeaderText = "Caption"; - captionColumn.Width = 155; - captionColumn.MaxInputLength = 32; - captionColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; - captionColumn.DefaultCellStyle.Font = new Font("Microsoft Sans Serif", 8, FontStyle.Bold); - captionColumn.ToolTipText = "Shortcut's title"; - - DataGridViewTextBoxColumn keyColumn = new DataGridViewTextBoxColumn(); - keyColumn.DataPropertyName = "Key"; - keyColumn.HeaderText = "Key [KeyCode]"; - keyColumn.Width = 120; - keyColumn.MaxInputLength = 24; - keyColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; - keyColumn.DefaultCellStyle.Font = new Font("Microsoft Sans Serif", 8, FontStyle.Bold); - keyColumn.DefaultCellStyle.BackColor = Color.Yellow; - keyColumn.ReadOnly = true; - keyColumn.ToolTipText = "Key assigned to the shortcut (double click on the cell)"; - - DataGridViewCheckBoxColumn ctrlColumn = new DataGridViewCheckBoxColumn(); - ctrlColumn.DataPropertyName = "Ctrl"; - ctrlColumn.HeaderText = "Ctrl"; - ctrlColumn.Width = 30; - ctrlColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; - ctrlColumn.DefaultCellStyle.BackColor = Color.LightCyan; - ctrlColumn.ToolTipText = "Use CTRL modifier + Key assigned"; - - DataGridViewCheckBoxColumn altColumn = new DataGridViewCheckBoxColumn(); - altColumn.DataPropertyName = "Alt"; - altColumn.HeaderText = "Alt"; - altColumn.Width = 30; - ... [truncated message content] |
From: <nic...@us...> - 2014-05-23 13:36:17
|
Revision: 4813 http://sourceforge.net/p/mp-plugins/code/4813 Author: nicsergio Date: 2014-05-23 13:36:12 +0000 (Fri, 23 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Program.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultConfig.xml trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Added Paths: ----------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/KeyboardHook.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.Designer.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.resx trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterKeyConfig.Designer.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterKeyConfig.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterKeyConfig.resx trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinNavigatorConfig.Designer.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinNavigatorConfig.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinNavigatorConfig.resx trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinWithSounds.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/LogHandler.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/RawInputHook.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/ShortCuter.cs Added: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/KeyboardHook.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/KeyboardHook.cs (rev 0) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/KeyboardHook.cs 2014-05-23 13:36:12 UTC (rev 4813) @@ -0,0 +1,123 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Windows.Forms; + +namespace ProcessPlugins.ShortCuter.Configuration +{ + internal class KeyboardHook //Classe per gestione hook di sistema + { + #region Delegati/Strutture + /// Delegato da richiamare all'intercettazione del messaggio + /// Parametri: + /// code : codice hook + /// wParam: ID evento intercettato + /// lParam: informazioni sull'evento intercettato + public delegate int HookProc(int code, int wParam, ref HookStruct lParam); + + public struct HookStruct //Struttura hook + { + public int vkCode; + public int scanCode; + public int flags; + public int time; + public int dwExtraInfo; + } + #endregion + + #region Dati + #region Costanti + private const int WH_KEYBOARD_LL = 13; //Id evento per hook di tastiera di basso livello + private const int WM_KEYDOWN = 0x100; //Id messaggio KeyDown + private const int WM_KEYUP = 0x101; //Id messaggio KeyUp + private const int WM_SYSKEYDOWN = 0x104; //Id messaggio KeyDown (tasto di sistema) + private const int WM_SYSKEYUP = 0x105; //Id messaggio KeyUp (tasto di sistema) + #endregion + + public List<Keys> HookedKeys = new List<Keys>(); //Eventuale lista dei tasti da monitorare/intercettare + private IntPtr hHook = IntPtr.Zero; //Handle dell'hook + private IntPtr hInstance = IntPtr.Zero; //Handle dell'istanza della libreria esterna + private bool _hooked = false; //Hook attivato + #endregion + + #region Costruttore/Distruttore + public KeyboardHook() + { + hInstance = LoadLibrary("User32"); //--> caricamento libreria esterna e memorizzazione handle + } + ~KeyboardHook() + { + unhook(); //--> eventuale disinstallazione dell'hook di sistema + } + #endregion + + #region Metodi Privati + private int hookProc(int code, int wParam, ref HookStruct lParam) //Metodo richiamato per l'hook di tastiera + { + if (code >= 0) //Se codice hook valorizzato + { + Keys key = (Keys)lParam.vkCode; + if (HookedKeys == null || HookedKeys.Count == 0 || HookedKeys.Contains(key)) //Se il tasto appartiene alla lista dei tasti da intercettare (o lista non utilizzata) + { + KeyEventArgs kea = new KeyEventArgs(key); + if ((wParam == WM_KEYDOWN || wParam == WM_SYSKEYDOWN) && (KeyDown != null)) + { + KeyDown(this, kea); //--> richiamo dell'evento KeyDown + } + else if ((wParam == WM_KEYUP || wParam == WM_SYSKEYUP) && (KeyUp != null)) + { + KeyUp(this, kea); //--> richiamo dell'evento KeyUp + } + if (kea.Handled) //Se l'evento \xE8 stato gestito + return 1; //--> il tasto non viene passato al sistema + } + } + return CallNextHookEx(hHook, code, wParam, ref lParam); + } + #endregion + + #region Metodi Pubblici + public void hook() //Installazione dell'hook di sistema + { + unhook(); //--> eventuale disinstallazione hook + hHook = SetWindowsHookEx(WH_KEYBOARD_LL, hookProc, hInstance, 0); //--> installazione hook + _hooked = true; //--> memorizzazione hook attivo + } + public void unhook() //Disinstallazione dell'hook di sistema + { + if (_hooked) //Se hook attivo + { + UnhookWindowsHookEx(hHook); //--> disinstallazione hook + _hooked = false; //--> memorizzazione hook disattivo + } + } + #endregion + + #region Eventi + public event KeyEventHandler KeyDown; //Evento di pressione di uno dei tasti da monitorare + public event KeyEventHandler KeyUp; //Evento di rilascio di uno dei tasti da monitorare + #endregion + + #region Propriet\xE0 + public bool Hooked { get { return this._hooked; } } + #endregion + + #region Importazione DLL + //Installazione dell'hook, esecuzione dell'evento desiderato [uno dei parametri hInstance o threadId deve essere valorizzato] + [DllImport("user32.dll")] + static extern IntPtr SetWindowsHookEx(int idHook, HookProc callback, IntPtr hInstance, uint threadId); + + //Disinstallazione dell'hook (ritorna true se esecuzione con successo) + [DllImport("user32.dll")] + static extern bool UnhookWindowsHookEx(IntPtr hInstance); + + //Chiamata a hook successivo + [DllImport("user32.dll")] + static extern int CallNextHookEx(IntPtr idHook, int nCode, int wParam, ref HookStruct lParam); + + //Caricamento di una libreria (ritorna l'handle associato) + [DllImport("kernel32.dll")] + static extern IntPtr LoadLibrary(string lpFileName); + #endregion + } +} Added: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.Designer.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.Designer.cs (rev 0) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.Designer.cs 2014-05-23 13:36:12 UTC (rev 4813) @@ -0,0 +1,468 @@ +namespace ProcessPlugins.ShortCuter.Configuration +{ + partial class ShortCuterConfig + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </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(ShortCuterConfig)); + this.shortCutsDataGridView = new System.Windows.Forms.DataGridView(); + this.linkPropertiesGroupBox = new System.Windows.Forms.GroupBox(); + this.loadParameterGroupBox = new System.Windows.Forms.GroupBox(); + this.loadParameterTextBox = new System.Windows.Forms.TextBox(); + this.windowIdGroupBox = new System.Windows.Forms.GroupBox(); + 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.updateButton = new System.Windows.Forms.Button(); + this.resetButton = new System.Windows.Forms.Button(); + this.rowDownButton = new System.Windows.Forms.Button(); + this.rowUpButton = new System.Windows.Forms.Button(); + this.infoPictureBox = new System.Windows.Forms.PictureBox(); + this.rowRemoveButton = new System.Windows.Forms.Button(); + this.rowAddButton = new System.Windows.Forms.Button(); + this.propLeftPictureBox = new System.Windows.Forms.PictureBox(); + this.saveButton = new System.Windows.Forms.Button(); + this.overridesGroupBox = new System.Windows.Forms.GroupBox(); + this.numLockGroupBox = new System.Windows.Forms.GroupBox(); + this.numLockComboBox = new System.Windows.Forms.ComboBox(); + this.capsLockGroupBox = new System.Windows.Forms.GroupBox(); + this.capsLockComboBox = new System.Windows.Forms.ComboBox(); + this.rowCopyButton = new System.Windows.Forms.Button(); + this.skinNavAddButton = new System.Windows.Forms.Button(); + this.skinNavConfigButton = new System.Windows.Forms.Button(); + this.skinItems = new My.Common.SkinItems(); + ((System.ComponentModel.ISupportInitialize)(this.shortCutsDataGridView)).BeginInit(); + this.linkPropertiesGroupBox.SuspendLayout(); + this.loadParameterGroupBox.SuspendLayout(); + this.windowIdGroupBox.SuspendLayout(); + this.skinFileGroupBox.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.infoPictureBox)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.propLeftPictureBox)).BeginInit(); + this.overridesGroupBox.SuspendLayout(); + this.numLockGroupBox.SuspendLayout(); + this.capsLockGroupBox.SuspendLayout(); + this.SuspendLayout(); + // + // shortCutsDataGridView + // + this.shortCutsDataGridView.AllowUserToAddRows = false; + this.shortCutsDataGridView.AllowUserToDeleteRows = false; + this.shortCutsDataGridView.AllowUserToResizeRows = false; + this.shortCutsDataGridView.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(213)))), ((int)(((byte)(220)))), ((int)(((byte)(227))))); + dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.shortCutsDataGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; + this.shortCutsDataGridView.ColumnHeadersHeight = 30; + this.shortCutsDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; + this.shortCutsDataGridView.Location = new System.Drawing.Point(6, 304); + this.shortCutsDataGridView.MultiSelect = false; + this.shortCutsDataGridView.Name = "shortCutsDataGridView"; + this.shortCutsDataGridView.RowHeadersWidth = 20; + this.shortCutsDataGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing; + this.shortCutsDataGridView.Size = new System.Drawing.Size(1006, 429); + this.shortCutsDataGridView.TabIndex = 0; + this.shortCutsDataGridView.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.shortCutsDataGridView_CellDoubleClick); + this.shortCutsDataGridView.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.shortCutsDataGridView_CellEndEdit); + this.shortCutsDataGridView.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.shortCutsDataGridView_CellFormatting); + this.shortCutsDataGridView.CurrentCellChanged += new System.EventHandler(this.shortCutsDataGridView_CurrentCellChanged); + this.shortCutsDataGridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.shortCutsDataGridView_DataError); + this.shortCutsDataGridView.EditingControlShowing += new System.Windows.Forms.DataGridViewEditingControlShowingEventHandler(this.shortCutsDataGridView_EditingControlShowing); + this.shortCutsDataGridView.Enter += new System.EventHandler(this.shortCutsDataGridView_Enter); + // + // linkPropertiesGroupBox + // + this.linkPropertiesGroupBox.Controls.Add(this.loadParameterGroupBox); + this.linkPropertiesGroupBox.Controls.Add(this.windowIdGroupBox); + this.linkPropertiesGroupBox.Controls.Add(this.skinFileGroupBox); + this.linkPropertiesGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.linkPropertiesGroupBox.Location = new System.Drawing.Point(602, 30); + this.linkPropertiesGroupBox.Name = "linkPropertiesGroupBox"; + this.linkPropertiesGroupBox.Size = new System.Drawing.Size(320, 175); + this.linkPropertiesGroupBox.TabIndex = 31; + this.linkPropertiesGroupBox.TabStop = false; + this.linkPropertiesGroupBox.Text = "Link Properties"; + // + // loadParameterGroupBox + // + this.loadParameterGroupBox.Controls.Add(this.loadParameterTextBox); + this.loadParameterGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.loadParameterGroupBox.Location = new System.Drawing.Point(4, 103); + this.loadParameterGroupBox.Name = "loadParameterGroupBox"; + this.loadParameterGroupBox.Size = new System.Drawing.Size(312, 68); + this.loadParameterGroupBox.TabIndex = 37; + this.loadParameterGroupBox.TabStop = false; + this.loadParameterGroupBox.Text = "Load Parameter:"; + // + // loadParameterTextBox + // + this.loadParameterTextBox.BackColor = System.Drawing.SystemColors.Control; + this.loadParameterTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.loadParameterTextBox.ForeColor = System.Drawing.Color.Blue; + this.loadParameterTextBox.Location = new System.Drawing.Point(6, 19); + this.loadParameterTextBox.Multiline = true; + this.loadParameterTextBox.Name = "loadParameterTextBox"; + this.loadParameterTextBox.ReadOnly = true; + this.loadParameterTextBox.Size = new System.Drawing.Size(300, 43); + this.loadParameterTextBox.TabIndex = 39; + this.loadParameterTextBox.Text = "-"; + this.loadParameterTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // windowIdGroupBox + // + this.windowIdGroupBox.Controls.Add(this.windowIdLabel); + this.windowIdGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.windowIdGroupBox.Location = new System.Drawing.Point(4, 63); + this.windowIdGroupBox.Name = "windowIdGroupBox"; + this.windowIdGroupBox.Size = new System.Drawing.Size(312, 34); + this.windowIdGroupBox.TabIndex = 36; + this.windowIdGroupBox.TabStop = false; + this.windowIdGroupBox.Text = "Window ID:"; + // + // windowIdLabel + // + this.windowIdLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.windowIdLabel.ForeColor = System.Drawing.Color.Blue; + this.windowIdLabel.Location = new System.Drawing.Point(6, 16); + this.windowIdLabel.Name = "windowIdLabel"; + this.windowIdLabel.Size = new System.Drawing.Size(300, 13); + this.windowIdLabel.TabIndex = 6; + this.windowIdLabel.Text = "-"; + this.windowIdLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // skinFileGroupBox + // + this.skinFileGroupBox.Controls.Add(this.skinFileLabel); + this.skinFileGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.skinFileGroupBox.Location = new System.Drawing.Point(4, 23); + this.skinFileGroupBox.Name = "skinFileGroupBox"; + this.skinFileGroupBox.Size = new System.Drawing.Size(312, 34); + this.skinFileGroupBox.TabIndex = 6; + this.skinFileGroupBox.TabStop = false; + this.skinFileGroupBox.Text = "Skin File:"; + // + // skinFileLabel + // + this.skinFileLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.skinFileLabel.ForeColor = System.Drawing.Color.Blue; + this.skinFileLabel.Location = new System.Drawing.Point(6, 16); + this.skinFileLabel.Name = "skinFileLabel"; + this.skinFileLabel.Size = new System.Drawing.Size(300, 13); + this.skinFileLabel.TabIndex = 2; + this.skinFileLabel.Text = "-"; + this.skinFileLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // toolTip + // + this.toolTip.ShowAlways = true; + // + // updateButton + // + this.updateButton.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(192))))); + this.updateButton.Location = new System.Drawing.Point(67, 84); + this.updateButton.Name = "updateButton"; + this.updateButton.Size = new System.Drawing.Size(135, 38); + this.updateButton.TabIndex = 32; + this.updateButton.Text = "Save and Close"; + this.updateButton.UseVisualStyleBackColor = false; + this.updateButton.Click += new System.EventHandler(this.updateButton_Click); + // + // resetButton + // + this.resetButton.Location = new System.Drawing.Point(67, 8); + this.resetButton.Name = "resetButton"; + this.resetButton.Size = new System.Drawing.Size(133, 23); + this.resetButton.TabIndex = 33; + this.resetButton.Text = "Reset Configuration"; + this.resetButton.UseVisualStyleBackColor = true; + this.resetButton.Click += new System.EventHandler(this.resetButton_Click); + // + // rowDownButton + // + this.rowDownButton.AutoSize = true; + this.rowDownButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.rowDownButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowDown; + this.rowDownButton.Location = new System.Drawing.Point(226, 264); + this.rowDownButton.Name = "rowDownButton"; + this.rowDownButton.Size = new System.Drawing.Size(38, 38); + this.rowDownButton.TabIndex = 35; + this.rowDownButton.UseVisualStyleBackColor = true; + this.rowDownButton.Click += new System.EventHandler(this.rowDownButton_Click); + // + // rowUpButton + // + this.rowUpButton.AutoSize = true; + this.rowUpButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.rowUpButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowUp; + this.rowUpButton.Location = new System.Drawing.Point(186, 264); + this.rowUpButton.Name = "rowUpButton"; + this.rowUpButton.Size = new System.Drawing.Size(38, 38); + this.rowUpButton.TabIndex = 34; + this.rowUpButton.UseVisualStyleBackColor = true; + this.rowUpButton.Click += new System.EventHandler(this.rowUpButton_Click); + // + // infoPictureBox + // + this.infoPictureBox.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.Info; + this.infoPictureBox.Location = new System.Drawing.Point(990, 5); + this.infoPictureBox.Name = "infoPictureBox"; + this.infoPictureBox.Size = new System.Drawing.Size(24, 24); + this.infoPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.infoPictureBox.TabIndex = 30; + this.infoPictureBox.TabStop = false; + this.infoPictureBox.Click += new System.EventHandler(this.infoPictureBox_Click); + // + // rowRemoveButton + // + this.rowRemoveButton.AutoSize = true; + this.rowRemoveButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.rowRemoveButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowRemove; + this.rowRemoveButton.Location = new System.Drawing.Point(46, 264); + this.rowRemoveButton.Name = "rowRemoveButton"; + this.rowRemoveButton.Size = new System.Drawing.Size(38, 38); + this.rowRemoveButton.TabIndex = 26; + this.rowRemoveButton.UseVisualStyleBackColor = true; + this.rowRemoveButton.Click += new System.EventHandler(this.rowRemoveButton_Click); + // + // rowAddButton + // + this.rowAddButton.AutoSize = true; + this.rowAddButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.rowAddButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowAdd; + this.rowAddButton.Location = new System.Drawing.Point(6, 264); + this.rowAddButton.Name = "rowAddButton"; + this.rowAddButton.Size = new System.Drawing.Size(38, 38); + this.rowAddButton.TabIndex = 25; + this.rowAddButton.UseVisualStyleBackColor = true; + this.rowAddButton.Click += new System.EventHandler(this.rowAddButton_Click); + // + // propLeftPictureBox + // + this.propLeftPictureBox.Enabled = false; + this.propLeftPictureBox.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.ArrowDown; + this.propLeftPictureBox.Location = new System.Drawing.Point(360, 257); + this.propLeftPictureBox.Name = "propLeftPictureBox"; + this.propLeftPictureBox.Size = new System.Drawing.Size(131, 56); + this.propLeftPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.propLeftPictureBox.TabIndex = 23; + this.propLeftPictureBox.TabStop = false; + this.propLeftPictureBox.Visible = false; + // + // saveButton + // + this.saveButton.Location = new System.Drawing.Point(67, 35); + this.saveButton.Name = "saveButton"; + this.saveButton.Size = new System.Drawing.Size(133, 23); + this.saveButton.TabIndex = 36; + this.saveButton.Text = "Save Configuration"; + this.saveButton.UseVisualStyleBackColor = true; + this.saveButton.Click += new System.EventHandler(this.saveButton_Click); + // + // overridesGroupBox + // + this.overridesGroupBox.Controls.Add(this.numLockGroupBox); + this.overridesGroupBox.Controls.Add(this.capsLockGroupBox); + this.overridesGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.overridesGroupBox.Location = new System.Drawing.Point(50, 133); + this.overridesGroupBox.Name = "overridesGroupBox"; + this.overridesGroupBox.Size = new System.Drawing.Size(165, 111); + this.overridesGroupBox.TabIndex = 37; + this.overridesGroupBox.TabStop = false; + this.overridesGroupBox.Text = "Overrides at Start-Up"; + // + // numLockGroupBox + // + this.numLockGroupBox.Controls.Add(this.numLockComboBox); + this.numLockGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.numLockGroupBox.Location = new System.Drawing.Point(6, 63); + this.numLockGroupBox.Name = "numLockGroupBox"; + this.numLockGroupBox.Size = new System.Drawing.Size(152, 42); + this.numLockGroupBox.TabIndex = 38; + this.numLockGroupBox.TabStop = false; + this.numLockGroupBox.Text = "Num-Lock Forcing:"; + // + // numLockComboBox + // + this.numLockComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.numLockComboBox.FormattingEnabled = true; + this.numLockComboBox.Location = new System.Drawing.Point(9, 15); + this.numLockComboBox.Name = "numLockComboBox"; + this.numLockComboBox.Size = new System.Drawing.Size(133, 21); + this.numLockComboBox.TabIndex = 1; + // + // capsLockGroupBox + // + this.capsLockGroupBox.Controls.Add(this.capsLockComboBox); + this.capsLockGroupBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.capsLockGroupBox.Location = new System.Drawing.Point(6, 15); + this.capsLockGroupBox.Name = "capsLockGroupBox"; + this.capsLockGroupBox.Size = new System.Drawing.Size(152, 42); + this.capsLockGroupBox.TabIndex = 37; + this.capsLockGroupBox.TabStop = false; + this.capsLockGroupBox.Text = "Caps-Lock Forcing:"; + // + // capsLockComboBox + // + this.capsLockComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.capsLockComboBox.FormattingEnabled = true; + this.capsLockComboBox.Location = new System.Drawing.Point(9, 15); + this.capsLockComboBox.Name = "capsLockComboBox"; + this.capsLockComboBox.Size = new System.Drawing.Size(133, 21); + this.capsLockComboBox.TabIndex = 0; + // + // rowCopyButton + // + this.rowCopyButton.AutoSize = true; + this.rowCopyButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.rowCopyButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.RowCopy; + this.rowCopyButton.Location = new System.Drawing.Point(96, 264); + this.rowCopyButton.Name = "rowCopyButton"; + this.rowCopyButton.Size = new System.Drawing.Size(38, 38); + this.rowCopyButton.TabIndex = 38; + this.rowCopyButton.UseVisualStyleBackColor = true; + this.rowCopyButton.Click += new System.EventHandler(this.rowCopyButton_Click); + // + // skinNavAddButton + // + this.skinNavAddButton.AutoSize = true; + this.skinNavAddButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.skinNavAddButton.Image = global::ProcessPlugins.ShortCuter.Properties.Resources.SkinNavAdd; + this.skinNavAddButton.Location = new System.Drawing.Point(136, 264); + this.skinNavAddButton.Name = "skinNavAddButton"; + this.skinNavAddButton.Size = new System.Drawing.Size(38, 38); + this.skinNavAddButton.TabIndex = 40; + this.skinNavAddButton.UseVisualStyleBackColor = true; + this.skinNavAddButton.Click += new System.EventHandler(this.skinNavAddButton_Click); + // + // skinNavConfigButton + // + this.skinNavConfigButton.BackgroundImage = global::ProcessPlugins.ShortCuter.Properties.Resources.SkinNav; + this.skinNavConfigButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.skinNavConfigButton.Location = new System.Drawing.Point(726, 220); + this.skinNavConfigButton.Name = "skinNavConfigButton"; + this.skinNavConfigButton.Size = new System.Drawing.Size(70, 70); + this.skinNavConfigButton.TabIndex = 41; + this.skinNavConfigButton.UseVisualStyleBackColor = true; + this.skinNavConfigButton.Click += new System.EventHandler(this.skinNavConfigButton_Click); + // + // skinItems + // + this.skinItems.Location = new System.Drawing.Point(266, 8); + this.skinItems.Name = "skinItems"; + this.skinItems.SelectedIndex = -1; + this.skinItems.SelectedTab = My.Common.SkinItems.SkinItemsType.Links; + this.skinItems.Size = new System.Drawing.Size(330, 260); + this.skinItems.TabIndex = 39; + this.skinItems.Enter += new System.EventHandler(this.skinItems_Enter); + this.skinItems.DoubleClick += new System.EventHandler(this.skinItems_DoubleClick); + this.skinItems.SelectedIndexChanged += new System.EventHandler(this.skinItems_SelectedIndexChanged); + // + // ShortCuterConfig + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1018, 740); + this.Controls.Add(this.skinNavConfigButton); + this.Controls.Add(this.skinNavAddButton); + this.Controls.Add(this.skinItems); + this.Controls.Add(this.rowCopyButton); + this.Controls.Add(this.overridesGroupBox); + this.Controls.Add(this.saveButton); + this.Controls.Add(this.rowDownButton); + this.Controls.Add(this.linkPropertiesGroupBox); + this.Controls.Add(this.rowUpButton); + this.Controls.Add(this.resetButton); + this.Controls.Add(this.updateButton); + this.Controls.Add(this.infoPictureBox); + this.Controls.Add(this.rowRemoveButton); + this.Controls.Add(this.rowAddButton); + this.Controls.Add(this.shortCutsDataGridView); + this.Controls.Add(this.propLeftPictureBox); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MaximizeBox = false; + this.Name = "ShortCuterConfig"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "ShortCut\'er Plugin Configuration"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ShortCuterConfig_FormClosing); + this.Load += new System.EventHandler(this.ShortCuterConfig_Load); + this.Shown += new System.EventHandler(this.ShortCuterConfig_Shown); + ((System.ComponentModel.ISupportInitialize)(this.shortCutsDataGridView)).EndInit(); + this.linkPropertiesGroupBox.ResumeLayout(false); + this.loadParameterGroupBox.ResumeLayout(false); + this.loadParameterGroupBox.PerformLayout(); + this.windowIdGroupBox.ResumeLayout(false); + this.skinFileGroupBox.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.infoPictureBox)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.propLeftPictureBox)).EndInit(); + this.overridesGroupBox.ResumeLayout(false); + this.numLockGroupBox.ResumeLayout(false); + this.capsLockGroupBox.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.DataGridView shortCutsDataGridView; + private System.Windows.Forms.PictureBox propLeftPictureBox; + private System.Windows.Forms.Button rowAddButton; + private System.Windows.Forms.Button rowRemoveButton; + private System.Windows.Forms.PictureBox infoPictureBox; + private System.Windows.Forms.GroupBox linkPropertiesGroupBox; + private System.Windows.Forms.ToolTip toolTip; + private System.Windows.Forms.Button updateButton; + private System.Windows.Forms.Button resetButton; + private System.Windows.Forms.Button rowDownButton; + private System.Windows.Forms.Button rowUpButton; + private System.Windows.Forms.GroupBox windowIdGroupBox; + private System.Windows.Forms.Label windowIdLabel; + private System.Windows.Forms.GroupBox skinFileGroupBox; + private System.Windows.Forms.Label skinFileLabel; + private System.Windows.Forms.GroupBox loadParameterGroupBox; + private System.Windows.Forms.Button saveButton; + private System.Windows.Forms.TextBox loadParameterTextBox; + private System.Windows.Forms.GroupBox overridesGroupBox; + private System.Windows.Forms.GroupBox capsLockGroupBox; + private System.Windows.Forms.GroupBox numLockGroupBox; + private System.Windows.Forms.ComboBox capsLockComboBox; + private System.Windows.Forms.ComboBox numLockComboBox; + private System.Windows.Forms.Button rowCopyButton; + private My.Common.SkinItems skinItems; + private System.Windows.Forms.Button skinNavAddButton; + private System.Windows.Forms.Button skinNavConfigButton; + + } +} \ No newline at end of file Added: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.cs (rev 0) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.cs 2014-05-23 13:36:12 UTC (rev 4813) @@ -0,0 +1,517 @@ +using System; +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; +using MediaPortal.Configuration; +using MediaPortal.GUI.Library; +using MediaPortal.Profile; +using My.Common; + +namespace ProcessPlugins.ShortCuter.Configuration +{ + [PluginIcons("ProcessPlugins.ShortCuter.Resources.Images.ShortCuterEnable.png", "ProcessPlugins.ShortCuter.Resources.Images.ShortCuterDisable.png")] + public partial class ShortCuterConfig : Form, ISetupForm //Form per la configurazione del plugin, con implementazione interfaccia ISetupForm (per lancio da configurazione MediaPortal) + { + #region Dati + private Skin mySkin; //Istanza classe Skin (dati relativi alla skin di MediaPortal) + private ShortCuts myShortCuts; //Istanza classe ShortCuts (dati relativi ai shortcuts configurati) + private bool unsavedChanges; //Presenza modifiche da salvare + private bool forceCell; //Azione di forzatura valore cella WindowID dello shortcut + #endregion + + #region Costruttore + public ShortCuterConfig() + { + InitializeComponent(); + } + #endregion + + #region Metodi Privati + private void InitializeGUI() //Inizializzazione interfaccia + { + skinItems.Populate(mySkin.SkinFiles, mySkin.SkinLinks, false, true); + FormatShortCutsGrid(); + + capsLockComboBox.DataSource = Enum.GetNames(typeof(LockKeys.LockKeyActions)); + capsLockComboBox.SelectedItem = Enum.GetName(typeof(LockKeys.LockKeyActions), myShortCuts.General.ForcingCapsLock); + numLockComboBox.DataSource = Enum.GetNames(typeof(LockKeys.LockKeyActions)); + numLockComboBox.SelectedItem = Enum.GetName(typeof(LockKeys.LockKeyActions), myShortCuts.General.ForcingNumLock); + + toolTip.SetToolTip(skinItems, "Double click to set the link's parameter to shortcut"); + toolTip.SetToolTip(rowAddButton, "Add shortcut to list"); + toolTip.SetToolTip(rowRemoveButton, "Remove selected shortcut from list"); + toolTip.SetToolTip(rowCopyButton, "Copy selected shortcut to list"); + toolTip.SetToolTip(skinNavAddButton, "Add a shortcut to Skin Navigator in list"); + toolTip.SetToolTip(rowUpButton, "Move up selected shortcut in list"); + toolTip.SetToolTip(rowDownButton, "Move down selected shortcut in list"); + toolTip.SetToolTip(resetButton, "Reset actual settings and load the default configuration"); + toolTip.SetToolTip(saveButton, "Save actual settings"); + toolTip.SetToolTip(updateButton, "Save actual setting and close the application"); + toolTip.SetToolTip(capsLockComboBox, "Set forcing for Caps-Lock when MediaPortal starts (OFF is recommended)"); + toolTip.SetToolTip(numLockComboBox, "Set forcing for Num-Lock when MediaPortal starts"); + toolTip.SetToolTip(skinNavConfigButton, "Configure Skin Navigator"); + toolTip.SetToolTip(infoPictureBox, "Version information"); + + unsavedChanges = false; //--> necessario a fine aggiornamento controlli grafici + } + private void FormatShortCutsGrid() //Formattazione (e popolazione) tabella shortcuts + { + shortCutsDataGridView.AutoGenerateColumns = false; + + DataGridViewTextBoxColumn captionColumn = new DataGridViewTextBoxColumn(); + captionColumn.DataPropertyName = "Caption"; + captionColumn.HeaderText = "Caption"; + captionColumn.Width = 155; + captionColumn.MaxInputLength = 32; + captionColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; + captionColumn.DefaultCellStyle.Font = new Font("Microsoft Sans Serif", 8, FontStyle.Bold); + captionColumn.ToolTipText = "Shortcut's title"; + + DataGridViewTextBoxColumn keyColumn = new DataGridViewTextBoxColumn(); + keyColumn.DataPropertyName = "Key"; + keyColumn.HeaderText = "Key [KeyCode]"; + keyColumn.Width = 120; + keyColumn.MaxInputLength = 24; + keyColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; + keyColumn.DefaultCellStyle.Font = new Font("Microsoft Sans Serif", 8, FontStyle.Bold); + keyColumn.DefaultCellStyle.BackColor = Color.Yellow; + keyColumn.ReadOnly = true; + keyColumn.ToolTipText = "Key assigned to the shortcut (double click on the cell)"; + + DataGridViewCheckBoxColumn ctrlColumn = new DataGridViewCheckBoxColumn(); + ctrlColumn.DataPropertyName = "Ctrl"; + ctrlColumn.HeaderText = "Ctrl"; + ctrlColumn.Width = 30; + ctrlColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; + ctrlColumn.DefaultCellStyle.BackColor = Color.LightCyan; + ctrlColumn.ToolTipText = "Use CTRL modifier + Key assigned"; + + DataGridViewCheckBoxColumn altColumn = new DataGridViewCheckBoxColumn(); + altColumn.DataPropertyName = "Alt"; + altColumn.HeaderText = "Alt"; + altColumn.Width = 30; + altColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; + altColumn.DefaultCellStyle.BackColor = Color.LightCyan; + altColumn.ToolTipText = "Use ALT modifier + Key assigned"; + + DataGridViewCheckBoxColumn shiftColumn = new DataGridViewCheckBoxColumn(); + shiftColumn.DataPropertyName = "Shift"; + shiftColumn.HeaderText = "Shift"; + shiftColumn.Width = 30; + shiftColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; + shiftColumn.DefaultCellStyle.BackColor = Color.LightCyan; + shiftColumn.ToolTipText = "Use SHIFT modifier + Key assigned"; + + DataGridViewTextBoxColumn windowIdColumn = new DataGridViewTextBoxColumn(); + windowIdColumn.DataPropertyName = "WindowID"; + windowIdColumn.HeaderText = "Window ID"; + windowIdColumn.Width = 70; + windowIdColumn.MaxInputLength = 10; + windowIdColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; + windowIdColumn.ToolTipText = "MediaPortal window ID for the shortcut's destination"; + + DataGridViewTextBoxColumn loadParameterColumn = new DataGridViewTextBoxColumn(); + loadParameterColumn.DataPropertyName = "LoadParameter"; + loadParameterColumn.HeaderText = "Load Parameter"; + loadParameterColumn.Width = 358; + loadParameterColumn.MaxInputLength = 300; + loadParameterColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; + loadParameterColumn.ToolTipText = "Any parameter for load window (see destination plugin's documentation)"; + + DataGridViewCheckBoxColumn returnColumn = new DataGridViewCheckBoxColumn(); + returnColumn.DataPropertyName = "Return"; + returnColumn.HeaderText = "Return"; + returnColumn.Width = 50; + returnColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; + returnColumn.ToolTipText = "If you're already on the window ID, another activation of the shortcut will display the previous window"; + + DataGridViewComboBoxColumn soundEffectColumn = new DataGridViewComboBoxColumn(); + soundEffectColumn.DataPropertyName = "SoundEffect"; + soundEffectColumn.HeaderText = "Sound Effect"; + soundEffectColumn.Width = 140; + soundEffectColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; + soundEffectColumn.FlatStyle = FlatStyle.Flat; //--> necessario con Win7 per aggiornare il colore di sfondo se selezionato + soundEffectColumn.DataSource = mySkin.SkinSounds; + soundEffectColumn.ToolTipText = "Sound effect played on the shortcut"; + + shortCutsDataGridView.Columns.Add(captionColumn); + shortCutsDataGridView.Columns.Add(keyColumn); + shortCutsDataGridView.Columns.Add(ctrlColumn); + shortCutsDataGridView.Columns.Add(altColumn); + shortCutsDataGridView.Columns.Add(shiftColumn); + shortCutsDataGridView.Columns.Add(windowIdColumn); + shortCutsDataGridView.Columns.Add(loadParameterColumn); + shortCutsDataGridView.Columns.Add(returnColumn); + shortCutsDataGridView.Columns.Add(soundEffectColumn); + + shortCutsDataGridView.DataSource = myShortCuts.Items; + } + private void ShowLinkProperties() //Visualizzazione proprietà link + { + if (skinItems.SelectedIndex < 0) //Se indice invalido --> reset proprietà + { + skinFileLabel.Text = "-"; + windowIdLabel.Text = "-"; + loadParameterTextBox.Text = "-"; + } + else //Visualizzazione proprietà elemento selezionato + { + switch (skinItems.SelectedTab) + { + case SkinItems.SkinItemsType.Files: //Lista files della skin + skinFileLabel.Text = mySkin.SkinFiles[skinItems.SelectedIndex].Name; + windowIdLabel.Text = mySkin.SkinFiles[skinItems.SelectedIndex].Id.ToString(); + loadParameterTextBox.Text = "-"; + break; + + case SkinItems.SkinItemsType.Links: //Lista links predefiniti della skin + skinFileLabel.Text = mySkin.SkinLinks[skinItems.SelectedIndex].XmlFile; + windowIdLabel.Text = mySkin.SkinLinks[skinItems.SelectedIndex].WindowID.ToString(); + loadParameterTextBox.Text = mySkin.SkinLinks[skinItems.SelectedIndex].LoadParameter; + break; + } + } + } + private void ShowLinkItem() //Visualizzazione link corrispondente allo shortcut + { + if (shortCutsDataGridView.CurrentCell != null) + { + if (!forceCell) //Non nel caso di forzatura valore cella WindowID (doppio click da lista links) + { + int showIndex; + int windowID = Convert.ToInt32(shortCutsDataGridView.Rows[shortCutsDataGridView.CurrentRow.Index].Cells[5].Value); + + if (skinItems.SelectedTab == SkinItems.SkinItemsType.Links) + { + //Selezione eventuale link corrispondente a WindowID & LoadParameter + string loadParameter = Convert.ToString(shortCutsDataGridView.Rows[shortCutsDataGridView.CurrentRow.Index].Cells[6].Value); + showIndex = mySkin.SkinLinks.FindIndex(x => x.WindowID == windowID && x.LoadParameter == loadParameter); + } + else + //Selezione eventuale file corrispondente a WindowID + showIndex = mySkin.SkinFiles.FindLastIndex(x => x.Id == windowID); + + skinItems.SelectedIndex = showIndex; + } + } + } + private void MoveItemList(bool dirUp) //Spostamento shortcut + { + if (shortCutsDataGridView.CurrentCell != null) + { + forceCell = true; + int index = shortCutsDataGridView.CurrentRow.Index; + shortCutsDataGridView.CurrentCell = shortCutsDataGridView[0, index]; //Importante cambiare la colonna prima di muovere la riga se posizionati su KeyCode (Hook attivo) + ShortCut sc = myShortCuts.Items[index]; + myShortCuts.Items.RemoveAt(index); + if (dirUp) + index--; + else + index++; + myShortCuts.Items.Insert(index, sc); + shortCutsDataGridView.CurrentCell = shortCutsDataGridView[0, index]; + shortCutsDataGridView.Rows[index].Selected = true; + shortCutsDataGridView.Focus(); + forceCell = false; + } + } + private void MoveItemsListButtonsEnable() //Abilitazione/disabilitazione pulsanti di spostamento shortcuts + { + if (shortCutsDataGridView.CurrentCell != null) + { + rowUpButton.Enabled = (shortCutsDataGridView.CurrentRow.Index > 0); + rowDownButton.Enabled = (shortCutsDataGridView.CurrentRow.Index < myShortCuts.Items.Count - 1); + } + else + { + rowUpButton.Enabled = false; + rowDownButton.Enabled = false; + } + } + private bool Save() //Salvataggio configurazione plugin + { + myShortCuts.General.ForcingCapsLock = (LockKeys.LockKeyActions)Enum.Parse(typeof(LockKeys.LockKeyActions), capsLockComboBox.SelectedItem.ToString()); + myShortCuts.General.ForcingNumLock = (LockKeys.LockKeyActions)Enum.Parse(typeof(LockKeys.LockKeyActions), numLockComboBox.SelectedItem.ToString()); + return myShortCuts.SaveConfig(); + } + #endregion + + #region Consumazione Eventi + #region Eventi Form + private void ShortCuterConfig_Load(object sender, EventArgs e) + { + using (Settings confReader = new MPSettings()) + { + //Raccolta dati relativi alla skin + mySkin = new Skin(confReader.GetValueAsString("skin", "name", "DefaultWide"), Config.GetFolder(Config.Dir.Skin) + @"\", Config.GetFolder(Config.Dir.Cache) + @"\"); + } + if (mySkin.Initialized) + { + string settingsFile = Config.GetFile(Config.Dir.Config, Tools.MyAssembly.Name + ".xml"); + + myShortCuts = new ShortCuts(settingsFile); //Creazione classe per gestione shorcuts + myShortCuts.Log += new LogEventHandler(myShortCuts_Log); //Sottoscrizione evento di log shortuts + if (myShortCuts.Initialize()) //Inizializzazione & lettura impostazioni shorcuts + { + //Sottoscrizione evento di modifica lista shortcuts + myShortCuts.Items.ListChanged += new ListChangedEventHandler(myShortCutsItems_ListChanged); + + //Inizializzazione interfaccia grafica + InitializeGUI(); + } + } + //Se inizializzazione classi non completata + if (!mySkin.Initialized || !myShortCuts.Initialized) + { + this.Close(); + this.Dispose(); + } + } + private void ShortCuterConfig_Shown(object sender, EventArgs e) + { + shortCutsDataGridView.Focus(); + } + private void ShortCuterConfig_FormClosing(object sender, FormClosingEventArgs e) + { + //Se presenti modifiche non salvate: richiesta conferma per chiusura applicazione + if (unsavedChanges && !Tools.QuestionMessage("Unsaved changes will be lost...\nDo you want to proceed?")) + e.Cancel = true; //--> annullamento chiusura form + } + #endregion + #region Evento di Log Shortcuts + private void myShortCuts_Log(object sender, LogEventArgs e) + { + switch (e.LogLevel) + { + case LogEventArgs.LogLevels.Error: + if (e.LogException != null) + Tools.ErrorMessage(e.LogMessage, e.LogException.Message); //--> emissione finestra di errore (con descrizione errore) + else + Tools.ErrorMessage(e.LogMessage); //--> emissione finestra di errore + break; + case LogEventArgs.LogLevels.Info: + Tools.InfoMessage(e.LogMessage); //--> emissione finestra informativa + break; + } + } + #endregion + #region Eventi Modifica Griglia + private void shortCutsDataGridView_Enter(object sender, EventArgs e) + { + propLeftPictureBox.Visible = true; //--> il link è collegato allo shortcut selezionato + ShowLinkItem(); + MoveItemsListButtonsEnable(); + } + private void shortCutsDataGridView_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) + { + e.Control.KeyPress -= idTextBox_KeyPress; + + if (e.Control is TextBox && ((DataGridView)(sender)).CurrentCell.ColumnIndex == 5) + e.Control.KeyPress += new KeyPressEventHandler(idTextBox_KeyPress); //--> sottoscrizione evento KeyPress per la cella WindowID + } + void idTextBox_KeyPress(object sender, KeyPressEventArgs e) + { + if ((int)shortCutsDataGridView.CurrentCell.Value <= 0) //Se WindowID negativo (possibile solo con Skin Navigator) + e.Handled = true; //--> carattere inputato da ignorare + else + { + if (!(char.IsDigit(e.KeyChar))) //Filtro per input numerico per la cella WindowID + { + Keys key = (Keys)e.KeyChar; + if (!(key == Keys.Back || key == Keys.Delete)) + { + e.Handled = true; //--> carattere inputato da ignorare + } + } + } + } + private void shortCutsDataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e) + { + //Eventuale visualizzazione form per assegnazione key allo shortcut corrente + if (shortCutsDataGridView.CurrentCell != null && shortCutsDataGridView.CurrentCell.ColumnIndex == 1) + new ShortCuterKeyConfig(myShortCuts.Items[shortCutsDataGridView.CurrentCell.RowIndex], + new Point(Location.X + shortCutsDataGridView.Location.X + 305, + Location.Y + shortCutsDataGridView.Location.Y + shortCutsDataGridView.CurrentRow.Height * shortCutsDataGridView.CurrentCell.RowIndex) + ).ShowDialog(); + } + private void shortCutsDataGridView_CellEndEdit(object sender, DataGridViewCellEventArgs e) + { + ShowLinkItem(); + } + private void shortCutsDataGridView_CurrentCellChanged(object sender, EventArgs e) + { + ShowLinkItem(); + MoveItemsListButtonsEnable(); + } + private void shortCutsDataGridView_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) + { + shortCutsDataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].ToolTipText = shortCutsDataGridView.Columns[e.ColumnIndex].ToolTipText; + } + private void shortCutsDataGridView_DataError(object sender, DataGridViewDataErrorEventArgs e) + { + //Gestione evento per evitare messaggi di errore (esempio se file effetto sonoro non disponibile nella skin) + } + #endregion + #region Eventi Modifica Impostazioni Plugin & Shortcuts + private void myShortCutsItems_ListChanged(object sender, EventArgs e) + { + unsavedChanges = true; + rowRemoveButton.Enabled = (myShortCuts.Items.Count > 0); + rowCopyButton.Enabled = (myShortCuts.Items.Count > 0); + MoveItemsListButtonsEnable(); + } + private void rowAddButton_Click(object sender, EventArgs e) + { + ShortCut sc = new ShortCut(); + myShortCuts.Items.Add(sc); + shortCutsDataGridView.CurrentCell = shortCutsDataGridView[0, shortCutsDataGridView.RowCount - 1]; + shortCutsDat... [truncated message content] |
From: <nic...@us...> - 2014-05-21 21:05:46
|
Revision: 4812 http://sourceforge.net/p/mp-plugins/code/4812 Author: nicsergio Date: 2014-05-21 21:05:44 +0000 (Wed, 21 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2014-05-20 13:03:01 UTC (rev 4811) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2014-05-21 21:05:44 UTC (rev 4812) @@ -6,7 +6,7 @@ <ProductVersion>8.0.30703</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{20CEBE32-A39E-4A61-B2BD-90BF16E2AEE8}</ProjectGuid> - <OutputType>WinExe</OutputType> + <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>ProcessPlugins.ShortCuter</RootNamespace> <AssemblyName>ShortCuter</AssemblyName> Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-20 13:03:01 UTC (rev 4811) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-21 21:05:44 UTC (rev 4812) @@ -641,7 +641,7 @@ try { - int actWindowID = (int)GUIWindowManager.ActiveWindow; //--> id finestra attuale + int actWindowID = GUIWindowManager.ActiveWindow; //--> id finestra attuale GUIDialogMenu dlgMenu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); dlgMenu.Reset(); dlgMenu.SetHeading(_general.MenuHeader); //--> titolo menu @@ -662,7 +662,12 @@ dlgMenu.Add(_general.Separator); dlgLinks.Add(null); } - dlgMenu.Add(dst.Caption); //--> aggiunta voce di menu + + using (GUIListItem listItem = new GUIListItem(dst.Caption)) + { + listItem.PinImage = @"d:\tvseries.png"; + dlgMenu.Add(listItem); //--> aggiunta voce di menu + } dlgLinks.Add(new WindowLink().GetData(dst)); //--> aggiunta destinazione corrispondente (classe WindowLink) first = false; } @@ -767,7 +772,7 @@ } private bool AlreadyAtDestination(ShortCut sc) //Verifica se finestra attuale corrispondente a destinazione shortcut { - if ((int)GUIWindowManager.ActiveWindow == sc.WindowID) //Prima verifica: da gestore finestre di mediaPortal + if (GUIWindowManager.ActiveWindow == sc.WindowID) //Prima verifica: da gestore finestre di mediaPortal { if (lastDestination.WindowID == sc.WindowID) //Seconda verifica: utilizzo dei parametri memorizzati dalla classe se attendibili if (lastDestination.LoadParameter == sc.LoadParameter) //--> verifica corrispondenza eventuali parametri di caricamento per visualizzazione This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-05-20 13:03:03
|
Revision: 4811 http://sourceforge.net/p/mp-plugins/code/4811 Author: nicsergio Date: 2014-05-20 13:03:01 +0000 (Tue, 20 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-20 05:19:54 UTC (rev 4810) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-20 13:03:01 UTC (rev 4811) @@ -514,14 +514,11 @@ { xmlFile.Load(defaultConfig); //Configurazione predefinita --> lettura file xml incapsulato } - return LoadConfig(ref xmlFile); //--> caricamento configurazione Skin Navigator - } - catch - { - return false; + return LoadConfig(xmlFile); //--> caricamento configurazione Skin Navigator } + catch { return false; } } - public bool LoadConfig(ref XmlDocument xmlFile) //Caricamento configurazione + public bool LoadConfig(XmlDocument xmlFile) //Caricamento configurazione { _items.Clear(); //--> pulizia lista elementi di navigazione @@ -595,7 +592,7 @@ else return false; //--> impostazioni non caricate (sezione Navigator non presente) } - public void SaveConfig(ref XmlTextWriter xmlSettings) //Salvataggio configurazione + public void SaveConfig(XmlTextWriter xmlSettings) //Salvataggio configurazione { xmlSettings.WriteStartElement("Navigator"); xmlSettings.WriteStartElement("General"); @@ -732,33 +729,37 @@ #region Metodi Privati private bool LoadDeprecatedConfig() //Caricamento configurazione obsoleta { - using (Settings confReader = new Settings(SettingsFile)) + try { - const string sectionName = "ShortCuterForm"; - const string capPrefix = "Titel"; - const string keyPrefix = "Key"; - const string widPrefix = "ID"; + using (Settings confReader = new Settings(SettingsFile)) + { + const string sectionName = "ShortCuterForm"; + const string capPrefix = "Titel"; + const string keyPrefix = "Key"; + const string widPrefix = "ID"; - if (!confReader.HasSection<string>(sectionName)) - return false; //--> se sezione non presente: il file non corrisponde + if (!confReader.HasSection<string>(sectionName)) + return false; //--> se sezione non presente: il file non corrisponde - bool ctrl = confReader.GetValueAsBool(sectionName, "ModCtrl", false); //--> utilizzo del modificatore ctrl per tutti gli shortcut - bool shift = confReader.GetValueAsBool(sectionName, "ModShift", false); //--> utilizzo del modificatore shift per tutti gli shortcut + bool ctrl = confReader.GetValueAsBool(sectionName, "ModCtrl", false); //--> utilizzo del modificatore ctrl per tutti gli shortcut + bool shift = confReader.GetValueAsBool(sectionName, "ModShift", false); //--> utilizzo del modificatore shift per tutti gli shortcut - for (int i = 1; i <= 20; i++) //Iterazione di lettura shortcut - { - ShortCut sc = new ShortCut(); - sc.Caption = confReader.GetValueAsString(sectionName, capPrefix + string.Format("{0:00}", i), ""); - sc.Key = confReader.GetValueAsString(sectionName, keyPrefix + string.Format("{0:00}", i), "").ToUpper(); - sc.WindowID = confReader.GetValueAsInt(sectionName, widPrefix + string.Format("{0:00}", i), -1); - sc.Ctrl = ctrl; - sc.Alt = false; - sc.Shift = shift; - if (sc.IsValid) //Se shortcut valido - _items.Add(sc); //--> aggiunta dello shortcut nella lista + for (int i = 1; i <= 20; i++) //Iterazione di lettura shortcut + { + ShortCut sc = new ShortCut(); + sc.Caption = confReader.GetValueAsString(sectionName, capPrefix + string.Format("{0:00}", i), ""); + sc.Key = confReader.GetValueAsString(sectionName, keyPrefix + string.Format("{0:00}", i), "").ToUpper(); + sc.WindowID = confReader.GetValueAsInt(sectionName, widPrefix + string.Format("{0:00}", i), -1); + sc.Ctrl = ctrl; + sc.Alt = false; + sc.Shift = shift; + if (sc.IsValid) //Se shortcut valido + _items.Add(sc); //--> aggiunta dello shortcut nella lista + } + return (_items.Count > 0); } - return (_items.Count > 0); } + catch { return false; } } private List<ShortCut> GetShortCutsGroup(KeyCombination k) //Raccolta lista shortcut associati alla combinazione di tasti { @@ -902,7 +903,7 @@ } if (_items.Count > 0) { - if (!_navigator.LoadConfig(ref xmlFile) && Log != null) //--> caricamento configurazione Skin Navigator + if (!_navigator.LoadConfig(xmlFile) && Log != null) //--> caricamento configurazione Skin Navigator Log(this, new LogEventArgs(LogEventArgs.LogLevels.Debug, "No Skin Navigator settings found loading configuration.")); return true; //--> lettura configurazione effettuata } @@ -961,10 +962,9 @@ xmlSettings.WriteEndElement(); } xmlSettings.WriteEndElement(); + _navigator.SaveConfig(xmlSettings); //--> salvataggio configurazione Skin Navigator xmlSettings.WriteEndElement(); - _navigator.SaveConfig(ref xmlSettings); //--> salvataggio configurazione Skin Navigator - xmlSettings.Flush(); xmlSettings.Close(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2014-05-20 05:19:58
|
Revision: 4810 http://sourceforge.net/p/mp-plugins/code/4810 Author: framug Date: 2014-05-20 05:19:54 +0000 (Tue, 20 May 2014) Log Message: ----------- WebEPGfr V 1.3 : Fix Kazer and ZguideTV urls. Add TITANIUS skin. Modified Paths: -------------- trunk/plugins/WebEPGfr/InfosSuivantSites.cs trunk/plugins/WebEPGfr/Properties/AssemblyInfo.cs trunk/plugins/WebEPGfr/WebEPGfrSetup.cs trunk/plugins/WebEPGfr/XmlToolBox.cs Added Paths: ----------- trunk/plugins/WebEPGfr/skin/TITANIUS/ trunk/plugins/WebEPGfr/skin/TITANIUS/Kazer.xml trunk/plugins/WebEPGfr/skin/TITANIUS/Media/ trunk/plugins/WebEPGfr/skin/TITANIUS/Media/hover_WebEPGfr.png trunk/plugins/WebEPGfr/skin/TITANIUS/Media/hover_ZguideTV.png trunk/plugins/WebEPGfr/skin/TITANIUS/Media/hover_kazer.png trunk/plugins/WebEPGfr/skin/TITANIUS/ZguideTV.xml Modified: trunk/plugins/WebEPGfr/InfosSuivantSites.cs =================================================================== --- trunk/plugins/WebEPGfr/InfosSuivantSites.cs 2014-05-19 14:44:46 UTC (rev 4809) +++ trunk/plugins/WebEPGfr/InfosSuivantSites.cs 2014-05-20 05:19:54 UTC (rev 4810) @@ -82,7 +82,7 @@ { //logique de recuperation _oParametre.Add(InfosSuivantSites.Grabber.Kazer.ToString(), XmlConfig.ReadXmlConfig("WebEPGfr", "Kazer", "Uri", "")); - _oParametre.Add(InfosSuivantSites.Grabber.ZGuideTV.ToString(), XmlConfig.ReadXmlConfig("WebEPGfr", "ZguideTV", "Uri", @"http://xmltv.dyndns.org/download/tnt.zip").ToString()); + _oParametre.Add(InfosSuivantSites.Grabber.ZGuideTV.ToString(), XmlConfig.ReadXmlConfig("WebEPGfr", "ZguideTV", "Uri", @"http://xmltv.dtdns.net/download/tnt.zip").ToString()); } catch { } } @@ -122,7 +122,7 @@ sURL_de_verification = @"http://www.kazer.org"; break; case Grabber.ZGuideTV: - sURL_de_verification = @"http://xmltv.dyndns.org/download/"; + sURL_de_verification = @"http://xmltv.dtdns.net/download/"; break; } return sURL_de_verification; @@ -154,7 +154,7 @@ sURL_de_download = @"http://www.google.fr"; break; case Grabber.Kazer: - sURL_de_download = @"http://kazer.org/tvguide.xml?u=" + ReadValueByKey( Grabber.Kazer.ToString() ); + sURL_de_download = @"http://www.kazer.org/tvguide.xml?u=" + ReadValueByKey( Grabber.Kazer.ToString() ); break; case Grabber.ZGuideTV: sURL_de_download = ReadValueByKey(Grabber.ZGuideTV.ToString()); Modified: trunk/plugins/WebEPGfr/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/WebEPGfr/Properties/AssemblyInfo.cs 2014-05-19 14:44:46 UTC (rev 4809) +++ trunk/plugins/WebEPGfr/Properties/AssemblyInfo.cs 2014-05-20 05:19:54 UTC (rev 4810) @@ -34,8 +34,8 @@ // // Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de révision et de build par défaut // en utilisant '*', comme indiqué ci-dessous : -[assembly: AssemblyVersion("1.2.0.0")] -[assembly: AssemblyFileVersion("1.2.0.0")] +[assembly: AssemblyVersion("1.3.0.0")] +[assembly: AssemblyFileVersion("1.3.0.0")] [assembly: NeutralResourcesLanguageAttribute("fr-FR")] // MediaPortal plugin version compatibility Modified: trunk/plugins/WebEPGfr/WebEPGfrSetup.cs =================================================================== --- trunk/plugins/WebEPGfr/WebEPGfrSetup.cs 2014-05-19 14:44:46 UTC (rev 4809) +++ trunk/plugins/WebEPGfr/WebEPGfrSetup.cs 2014-05-20 05:19:54 UTC (rev 4810) @@ -196,11 +196,11 @@ XmlConfig.WriteXmlConfig("WebEPGfr", "Kazer", "Uri", kazer_UserName.Text.ToString()); if (Bouton_ZguideTV_TNT.Checked) { - XmlConfig.WriteXmlConfig("WebEPGfr", "ZguideTV", "Uri", @"http://xmltv.dyndns.org/download/tnt.zip"); + XmlConfig.WriteXmlConfig("WebEPGfr", "ZguideTV", "Uri", @"http://xmltv.dtdns.net/download/tnt.zip"); } else { - XmlConfig.WriteXmlConfig("WebEPGfr", "ZguideTV", "Uri", @"http://xmltv.dyndns.org/download/complet.zip"); + XmlConfig.WriteXmlConfig("WebEPGfr", "ZguideTV", "Uri", @"http://xmltv.dtdns.net/download/complet.zip"); } } @@ -237,7 +237,7 @@ string sTempUri = InfosSuivantSites.URL_de_download(InfosSuivantSites.Grabber.Kazer); if (sTempUri.Length > 0) { - string sBAseUri = @"http://kazer.org/tvguide.xml?u="; + string sBAseUri = @"http://www.kazer.org/tvguide.xml?u="; kazer_UserName.Text = sTempUri.Substring(sBAseUri.Length, sTempUri.Length - sBAseUri.Length); } sTempUri = InfosSuivantSites.URL_de_download(InfosSuivantSites.Grabber.ZGuideTV); @@ -346,12 +346,12 @@ if (oUsedGrabber == InfosSuivantSites.Grabber.Kazer) { if (kazer_UserName.Text.Length > 0) - oGrabber.Configuration.DownloadUri = new Uri(@"http://kazer.org/tvguide.xml?u=" + kazer_UserName.Text.ToString()); + oGrabber.Configuration.DownloadUri = new Uri(@"http://www.kazer.org/tvguide.xml?u=" + kazer_UserName.Text.ToString()); } else { - if (Bouton_ZguideTV_TNT.Checked) { oGrabber.Configuration.DownloadUri = new Uri(@"http://xmltv.dyndns.org/download/tnt.zip"); } - else { oGrabber.Configuration.DownloadUri = new Uri(@"http://xmltv.dyndns.org/download/complet.zip"); } + if (Bouton_ZguideTV_TNT.Checked) { oGrabber.Configuration.DownloadUri = new Uri(@"http://xmltv.dtdns.net/download/tnt.zip"); } + else { oGrabber.Configuration.DownloadUri = new Uri(@"http://xmltv.dtdns.net/download/complet.zip"); } } oGrabber.Configuration.MappingFile = InfosSuivantSites.GetMappingFileName(oUsedGrabber); lXmlTvFileIsAvalaible = oGrabber.DownloadXmlTvFile(oGrabber.Configuration.DownloadUri); @@ -403,12 +403,12 @@ if (oUsedGrabber == InfosSuivantSites.Grabber.Kazer) { if (kazer_UserName.Text.Length>0) - oGrabber.Configuration.DownloadUri = new Uri(@"http://kazer.org/tvguide.xml?u=" + kazer_UserName.Text.ToString()); + oGrabber.Configuration.DownloadUri = new Uri(@"http://www.kazer.org/tvguide.xml?u=" + kazer_UserName.Text.ToString()); } else { - if (Bouton_ZguideTV_TNT.Checked) { oGrabber.Configuration.DownloadUri = new Uri(@"http://xmltv.dyndns.org/download/tnt.zip"); } - else { oGrabber.Configuration.DownloadUri = new Uri(@"http://xmltv.dyndns.org/download/complet.zip"); } + if (Bouton_ZguideTV_TNT.Checked) { oGrabber.Configuration.DownloadUri = new Uri(@"http://xmltv.dtdns.net/download/tnt.zip"); } + else { oGrabber.Configuration.DownloadUri = new Uri(@"http://xmltv.dtdns.net/download/complet.zip"); } } oGrabber.Configuration.MappingFile = InfosSuivantSites.GetMappingFileName(oUsedGrabber); lXmlTvFileIsAvalaible = oGrabber.DownloadXmlTvFile(oGrabber.Configuration.DownloadUri); @@ -594,7 +594,7 @@ libinfo.Text = "Acc\xE8s \xE0 la page de t\xE9l\xE9chargement de ZguideTV"; libinfo.ForeColor = Color.Blue; // On cha\xEEne sur le forum de ZguideTV - Process.Start("http://xmltv.dyndns.org/download/"); + Process.Start("http://xmltv.dtdns.net/download/"); } // On a cliqu\xE9 sur le nom d'utilisateur @@ -722,7 +722,7 @@ { GuiResetButton(); - string sDownloadUri = @"http://kazer.org/tvguide.xml?u=" + kazer_UserName.Text.ToString(); + string sDownloadUri = @"http://www.kazer.org/tvguide.xml?u=" + kazer_UserName.Text.ToString(); if (TestGrabber(sDownloadUri) == true) { @@ -750,8 +750,8 @@ string sDownloadUri; //Choix du guide if (Bouton_ZguideTV_TNT.Checked) - { sDownloadUri = @"http://xmltv.dyndns.org/download/tnt.zip"; } - else { sDownloadUri = @"http://xmltv.dyndns.org/download/complet.zip"; } + { sDownloadUri = @"http://xmltv.dtdns.net/download/tnt.zip"; } + else { sDownloadUri = @"http://xmltv.dtdns.net/download/complet.zip"; } if (TestGrabber(sDownloadUri) == true) { @@ -846,7 +846,7 @@ libinfo.ForeColor = Color.Blue; if (oGrabber != null) { - oGrabber.Configuration.DownloadUri = new Uri(@"http://xmltv.dyndns.org/download/tnt.zip"); + oGrabber.Configuration.DownloadUri = new Uri(@"http://xmltv.dtdns.net/download/tnt.zip"); } } @@ -860,7 +860,7 @@ libinfo.ForeColor = Color.Blue; if (oGrabber != null) { - oGrabber.Configuration.DownloadUri = new Uri(@"http://xmltv.dyndns.org/download/complet.zip"); + oGrabber.Configuration.DownloadUri = new Uri(@"http://xmltv.dtdns.net/download/complet.zip"); } } #endregion Modified: trunk/plugins/WebEPGfr/XmlToolBox.cs =================================================================== --- trunk/plugins/WebEPGfr/XmlToolBox.cs 2014-05-19 14:44:46 UTC (rev 4809) +++ trunk/plugins/WebEPGfr/XmlToolBox.cs 2014-05-20 05:19:54 UTC (rev 4810) @@ -29,7 +29,7 @@ { if ((_sUserHash != null) && (_oDownloadUri == null)) { - _oDownloadUri = new Uri(@"http://kazer.org/tvguide.xml?u=" + _sUserHash); + _oDownloadUri = new Uri(@"http://www.kazer.org/tvguide.xml?u=" + _sUserHash); } return _oDownloadUri; } @@ -137,7 +137,7 @@ { if (_sUserHash != null) { - _oDownloadUri = new Uri(@"http://kazer.org/tvguide.xml?u=" + _sUserHash); + _oDownloadUri = new Uri(@"http://www.kazer.org/tvguide.xml?u=" + _sUserHash); } return _sUserHash; } Added: trunk/plugins/WebEPGfr/skin/TITANIUS/Kazer.xml =================================================================== --- trunk/plugins/WebEPGfr/skin/TITANIUS/Kazer.xml (rev 0) +++ trunk/plugins/WebEPGfr/skin/TITANIUS/Kazer.xml 2014-05-20 05:19:54 UTC (rev 4810) @@ -0,0 +1,211 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<window> + <id>10124</id> + <defaultcontrol>2</defaultcontrol> + <allowoverlay>yes</allowoverlay> + <define>#header.label:WebEPGfr</define> + <define>#header.image:kazer_logo.png</define> + <define>#header.hover:hover_kazer.png</define> + <controls> + <control> + <type>image</type> + <posX>0</posX> + <posY>0</posY> + <width>1920</width> + <height>1080</height> + <texture>background.png</texture> + </control> + <control> + <description>VIEWPORT</description> + <type>image</type> + <id>0</id> + <posX>10</posX> + <posY>145</posY> + <width>1903</width> + <height>897</height> + <texture>panel_tv.png</texture> + <animation effect="fade" time="250">WindowOpen</animation> + <animation effect="fade" time="250">WindowClose</animation> + </control> + <control> + <id>0</id> + <type>image</type> + <posX>66</posX> + <posY>34</posY> + <width>61</width> + <height>57</height> + <texture>icon_tv.png</texture> + <animation effect="fade" time="250">WindowOpen</animation> + <animation effect="fade" time="250">WindowClose</animation> + </control> + <control> + <type>image</type> + <posX>100</posX> + <posY>650</posY> + <width>300</width> + <height>260</height> + <texture>hover_kazer.png</texture> + </control> + + <control> + <description>buttons</description> + <type>group</type> + <posX>120</posX> + <posY>300</posY> + <dimColor>ffffffff</dimColor> + <layout>StackLayout(10, Vertical, true)</layout> + <control> + <id>14</id> + <description>Guide Télé</description> + <type>button</type> + <onleft>14</onleft> + <onright>14</onright> + <onup>99</onup> + <ondown>2</ondown> + <hyperlink>600</hyperlink> + <label>Voir le Guide Télé</label> + <font>TitanLight12</font> + <textcolor>FF000000</textcolor> + <textcolorNoFocus>ffffffff</textcolorNoFocus> + </control> + <control> + <id>2</id> + <description>Download</description> + <type>button</type> + <onleft>2</onleft> + <onright>2</onright> + <onup>14</onup> + <ondown>3</ondown> + <label>Télécharger</label> + <font>TitanLight12</font> + <textcolor>FF000000</textcolor> + <textcolorNoFocus>ffffffff</textcolorNoFocus> + </control> + <control> + <id>3</id> + <description>Update</description> + <type>button</type> + <onleft>3</onleft> + <onright>3</onright> + <onup>2</onup> + <ondown>9</ondown> + <label>Mettre à jour</label> + <font>TitanLight12</font> + <textcolor>FF000000</textcolor> + <textcolorNoFocus>ffffffff</textcolorNoFocus> + </control> + <control> + <id>9</id> + <description>Restaurer</description> + <type>button</type> + <onleft>9</onleft> + <onright>9</onright> + <onup>3</onup> + <ondown>14</ondown> + <label>Restaurer</label> + <font>TitanLight12</font> + <textcolor>FF000000</textcolor> + <textcolorNoFocus>ffffffff</textcolorNoFocus> + </control> + </control> + + <control> + <id>4</id> + <description>Libellé date tvguide MP</description> + <type>label</type> + <posX>600</posX> + <posY>310</posY> + <textcolor>ffffffff</textcolor> + <align>LEFT</align> + <label>Date du guide télé de MediaPortal : </label> + </control> + <control> + <id>5</id> + <description>Libellé date tvguide kazer</description> + <type>label</type> + <colordiffuse>ffffffff</colordiffuse> + <posX>600</posX> + <posY>375</posY> + <textcolor>ffffffff</textcolor> + <align>LEFT</align> + <label>Date du guide télé de kazer : </label> + </control> + <control> + <id>10</id> + <description>Libellé date de la sauvegarde</description> + <type>label</type> + <colordiffuse>ffffffff</colordiffuse> + <posX>600</posX> + <posY>440</posY> + <textcolor>ffffffff</textcolor> + <align>LEFT</align> + <label>Date de la dernière sauvegarde : </label> + </control> + <control> + <id>11</id> + <description>Libellé date du guide télé dans la sauvegarde</description> + <type>label</type> + <colordiffuse>ffffffff</colordiffuse> + <posX>600</posX> + <posY>505</posY> + <textcolor>ffffffff</textcolor> + <align>LEFT</align> + <label>Date du guide Télé dans la sauvegarde : </label> + </control> + <control> + <id>6</id> + <description>date tvguide MediaPortal</description> + <type>label</type> + <posX>1400</posX> + <posY>310</posY> + <textcolor>ffffffff</textcolor> + <align>LEFT</align> + <label>-</label> + </control> + <control> + <id>7</id> + <description>date tvguide kazer</description> + <type>label</type> + <colordiffuse>ffffffff</colordiffuse> + <posX>1400</posX> + <posY>375</posY> + <textcolor>ffffffff</textcolor> + <align>LEFT</align> + <label>-</label> + </control> + <control> + <id>12</id> + <description>date de la sauvegarde</description> + <type>label</type> + <colordiffuse>ffffffff</colordiffuse> + <posX>1400</posX> + <posY>440</posY> + <textcolor>ffffffff</textcolor> + <align>LEFT</align> + <label>-</label> + </control> + <control> + <id>13</id> + <description>date du guide télé dans la sauvegarde</description> + <type>label</type> + <colordiffuse>ffffffff</colordiffuse> + <posX>1400</posX> + <posY>505</posY> + <textcolor>ffffffff</textcolor> + <align>LEFT</align> + <label>-</label> + </control> + <control> + <id>8</id> + <description>Libellé d'information</description> + <type>label</type> + <posX>600</posX> + <posY>770</posY> + <textcolor>ffff0000</textcolor> + <align>LEFT</align> + <label>-</label> + </control> + <import>common.time.xml</import> + <import>common.overlay.xml</import> + </controls> +</window> Added: trunk/plugins/WebEPGfr/skin/TITANIUS/Media/hover_WebEPGfr.png =================================================================== (Binary files differ) Index: trunk/plugins/WebEPGfr/skin/TITANIUS/Media/hover_WebEPGfr.png =================================================================== --- trunk/plugins/WebEPGfr/skin/TITANIUS/Media/hover_WebEPGfr.png 2014-05-19 14:44:46 UTC (rev 4809) +++ trunk/plugins/WebEPGfr/skin/TITANIUS/Media/hover_WebEPGfr.png 2014-05-20 05:19:54 UTC (rev 4810) Property changes on: trunk/plugins/WebEPGfr/skin/TITANIUS/Media/hover_WebEPGfr.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: trunk/plugins/WebEPGfr/skin/TITANIUS/Media/hover_ZguideTV.png =================================================================== (Binary files differ) Index: trunk/plugins/WebEPGfr/skin/TITANIUS/Media/hover_ZguideTV.png =================================================================== --- trunk/plugins/WebEPGfr/skin/TITANIUS/Media/hover_ZguideTV.png 2014-05-19 14:44:46 UTC (rev 4809) +++ trunk/plugins/WebEPGfr/skin/TITANIUS/Media/hover_ZguideTV.png 2014-05-20 05:19:54 UTC (rev 4810) Property changes on: trunk/plugins/WebEPGfr/skin/TITANIUS/Media/hover_ZguideTV.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: trunk/plugins/WebEPGfr/skin/TITANIUS/Media/hover_kazer.png =================================================================== (Binary files differ) Index: trunk/plugins/WebEPGfr/skin/TITANIUS/Media/hover_kazer.png =================================================================== --- trunk/plugins/WebEPGfr/skin/TITANIUS/Media/hover_kazer.png 2014-05-19 14:44:46 UTC (rev 4809) +++ trunk/plugins/WebEPGfr/skin/TITANIUS/Media/hover_kazer.png 2014-05-20 05:19:54 UTC (rev 4810) Property changes on: trunk/plugins/WebEPGfr/skin/TITANIUS/Media/hover_kazer.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: trunk/plugins/WebEPGfr/skin/TITANIUS/ZguideTV.xml =================================================================== --- trunk/plugins/WebEPGfr/skin/TITANIUS/ZguideTV.xml (rev 0) +++ trunk/plugins/WebEPGfr/skin/TITANIUS/ZguideTV.xml 2014-05-20 05:19:54 UTC (rev 4810) @@ -0,0 +1,211 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<window> + <id>10124</id> + <defaultcontrol>2</defaultcontrol> + <allowoverlay>yes</allowoverlay> + <define>#header.label:WebEPGfr</define> + <define>#header.image:ZguideTV_logo.png</define> + <define>#header.hover:hover_ZguideTV.png</define> + <controls> + <control> + <type>image</type> + <posX>0</posX> + <posY>0</posY> + <width>1920</width> + <height>1080</height> + <texture>background.png</texture> + </control> + <control> + <description>VIEWPORT</description> + <type>image</type> + <id>0</id> + <posX>10</posX> + <posY>145</posY> + <width>1903</width> + <height>897</height> + <texture>panel_tv.png</texture> + <animation effect="fade" time="250">WindowOpen</animation> + <animation effect="fade" time="250">WindowClose</animation> + </control> + <control> + <id>0</id> + <type>image</type> + <posX>66</posX> + <posY>34</posY> + <width>61</width> + <height>57</height> + <texture>icon_tv.png</texture> + <animation effect="fade" time="250">WindowOpen</animation> + <animation effect="fade" time="250">WindowClose</animation> + </control> + <control> + <type>image</type> + <posX>100</posX> + <posY>650</posY> + <width>300</width> + <height>260</height> + <texture>hover_ZguideTV.png</texture> + </control> + + <control> + <description>buttons</description> + <type>group</type> + <posX>120</posX> + <posY>300</posY> + <dimColor>ffffffff</dimColor> + <layout>StackLayout(10, Vertical, true)</layout> + <control> + <id>14</id> + <description>Guide Télé</description> + <type>button</type> + <onleft>14</onleft> + <onright>14</onright> + <onup>99</onup> + <ondown>2</ondown> + <hyperlink>600</hyperlink> + <label>Voir le Guide Télé</label> + <font>TitanLight12</font> + <textcolor>FF000000</textcolor> + <textcolorNoFocus>ffffffff</textcolorNoFocus> + </control> + <control> + <id>2</id> + <description>Download</description> + <type>button</type> + <onleft>2</onleft> + <onright>2</onright> + <onup>14</onup> + <ondown>3</ondown> + <label>Télécharger</label> + <font>TitanLight12</font> + <textcolor>FF000000</textcolor> + <textcolorNoFocus>ffffffff</textcolorNoFocus> + </control> + <control> + <id>3</id> + <description>Update</description> + <type>button</type> + <onleft>3</onleft> + <onright>3</onright> + <onup>2</onup> + <ondown>9</ondown> + <label>Mettre à jour</label> + <font>TitanLight12</font> + <textcolor>FF000000</textcolor> + <textcolorNoFocus>ffffffff</textcolorNoFocus> + </control> + <control> + <id>9</id> + <description>Restaurer</description> + <type>button</type> + <onleft>9</onleft> + <onright>9</onright> + <onup>3</onup> + <ondown>14</ondown> + <label>Restaurer</label> + <font>TitanLight12</font> + <textcolor>FF000000</textcolor> + <textcolorNoFocus>ffffffff</textcolorNoFocus> + </control> + </control> + + <control> + <id>4</id> + <description>Libellé date tvguide MP</description> + <type>label</type> + <posX>600</posX> + <posY>310</posY> + <textcolor>ffffffff</textcolor> + <align>LEFT</align> + <label>Date du guide télé de MediaPortal : </label> + </control> + <control> + <id>5</id> + <description>Libellé date tvguide ZguideTV</description> + <type>label</type> + <colordiffuse>ffffffff</colordiffuse> + <posX>600</posX> + <posY>375</posY> + <textcolor>ffffffff</textcolor> + <align>LEFT</align> + <label>Date du guide télé de ZguideTV : </label> + </control> + <control> + <id>10</id> + <description>Libellé date de la sauvegarde</description> + <type>label</type> + <colordiffuse>ffffffff</colordiffuse> + <posX>600</posX> + <posY>440</posY> + <textcolor>ffffffff</textcolor> + <align>LEFT</align> + <label>Date de la dernière sauvegarde : </label> + </control> + <control> + <id>11</id> + <description>Libellé date du guide télé dans la sauvegarde</description> + <type>label</type> + <colordiffuse>ffffffff</colordiffuse> + <posX>600</posX> + <posY>505</posY> + <textcolor>ffffffff</textcolor> + <align>LEFT</align> + <label>Date du guide Télé dans la sauvegarde : </label> + </control> + <control> + <id>6</id> + <description>date tvguide MediaPortal</description> + <type>label</type> + <posX>1400</posX> + <posY>310</posY> + <textcolor>ffffffff</textcolor> + <align>LEFT</align> + <label>-</label> + </control> + <control> + <id>7</id> + <description>date tvguide ZguideTV</description> + <type>label</type> + <colordiffuse>ffffffff</colordiffuse> + <posX>1400</posX> + <posY>375</posY> + <textcolor>ffffffff</textcolor> + <align>LEFT</align> + <label>-</label> + </control> + <control> + <id>12</id> + <description>date de la sauvegarde</description> + <type>label</type> + <colordiffuse>ffffffff</colordiffuse> + <posX>1400</posX> + <posY>440</posY> + <textcolor>ffffffff</textcolor> + <align>LEFT</align> + <label>-</label> + </control> + <control> + <id>13</id> + <description>date du guide télé dans la sauvegarde</description> + <type>label</type> + <colordiffuse>ffffffff</colordiffuse> + <posX>1400</posX> + <posY>505</posY> + <textcolor>ffffffff</textcolor> + <align>LEFT</align> + <label>-</label> + </control> + <control> + <id>8</id> + <description>Libellé d'information</description> + <type>label</type> + <posX>600</posX> + <posY>770</posY> + <textcolor>ffff0000</textcolor> + <align>LEFT</align> + <label>-</label> + </control> + <import>common.time.xml</import> + <import>common.overlay.xml</import> + </controls> +</window> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-05-19 14:44:50
|
Revision: 4809 http://sourceforge.net/p/mp-plugins/code/4809 Author: nicsergio Date: 2014-05-19 14:44:46 +0000 (Mon, 19 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-19 09:47:21 UTC (rev 4808) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-19 14:44:46 UTC (rev 4809) @@ -514,13 +514,14 @@ { xmlFile.Load(defaultConfig); //Configurazione predefinita --> lettura file xml incapsulato } - LoadConfig(xmlFile); + return LoadConfig(ref xmlFile); //--> caricamento configurazione Skin Navigator } - catch {} - - return true; + catch + { + return false; + } } - public void LoadConfig(XmlDocument xmlFile) //Caricamento configurazione + public bool LoadConfig(ref XmlDocument xmlFile) //Caricamento configurazione { _items.Clear(); //--> pulizia lista elementi di navigazione @@ -547,6 +548,8 @@ if (innerNode != null) _general.RemoveDuplicates = Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText)); } + else + return false; //--> impostazioni non caricate (sezione General non presente) XmlNodeList nodeList = navigatorNode.SelectNodes("Items/Item"); foreach (XmlNode node in nodeList) //Iterazione per memorizzazione elementi di navigazione { @@ -587,9 +590,12 @@ } _items.Add(navItem); //--> aggiunta elemento di navigazione } + return (_items.Count > 0); //--> impostazioni caricate (almeno un elemento di navigazione configurato) } + else + return false; //--> impostazioni non caricate (sezione Navigator non presente) } - public void SaveConfig(XmlTextWriter xmlSettings) //Salvataggio configurazione + public void SaveConfig(ref XmlTextWriter xmlSettings) //Salvataggio configurazione { xmlSettings.WriteStartElement("Navigator"); xmlSettings.WriteStartElement("General"); @@ -896,7 +902,8 @@ } if (_items.Count > 0) { - _navigator.LoadConfig(xmlFile); //--> caricamento configurazione Skin Navigator + if (!_navigator.LoadConfig(ref xmlFile) && Log != null) //--> caricamento configurazione Skin Navigator + Log(this, new LogEventArgs(LogEventArgs.LogLevels.Debug, "No Skin Navigator settings found loading configuration.")); return true; //--> lettura configurazione effettuata } else @@ -956,7 +963,7 @@ xmlSettings.WriteEndElement(); xmlSettings.WriteEndElement(); - _navigator.SaveConfig(xmlSettings); //--> salvataggio configurazione Skin Navigator + _navigator.SaveConfig(ref xmlSettings); //--> salvataggio configurazione Skin Navigator xmlSettings.Flush(); xmlSettings.Close(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-05-19 09:47:24
|
Revision: 4808 http://sourceforge.net/p/mp-plugins/code/4808 Author: nicsergio Date: 2014-05-19 09:47:21 +0000 (Mon, 19 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-18 19:03:47 UTC (rev 4807) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-19 09:47:21 UTC (rev 4808) @@ -494,21 +494,32 @@ #region Dati private GeneralSettings _general; //Impostazioni generali private BindingList<Item> _items; //Lista (con associazione dati) elementi di navigazione - private readonly LogEventHandler Log; #endregion #region Costruttore - public SkinNavigator() : this(null) { } //Costruttore classe SkinNavigator (senza delegato per log) - public SkinNavigator(LogEventHandler LogHandler) //Costruttore classe SkinNavigator + public SkinNavigator() //Costruttore classe SkinNavigator { _general = new GeneralSettings(); //--> istanziazione impostazioni generali _items = new BindingList<Item>(); //--> istanziazione lista elementi di navigazione - Log = LogHandler; //--> assegnazione eventuale delegato per operazioni di log } #endregion #region Metodi Pubblici - //public bool LoadConfig() { return LoadConfig(string.Empty); } //Caricamento configurazione predefinita + public bool LoadDefaults() //Caricamento impostazioni predefinita + { + try + { + XmlDocument xmlFile = new XmlDocument(); + using (Stream defaultConfig = Assembly.GetExecutingAssembly().GetManifestResourceStream("ProcessPlugins.ShortCuter.Resources.XmlFiles.DefaultConfig.xml")) + { + xmlFile.Load(defaultConfig); //Configurazione predefinita --> lettura file xml incapsulato + } + LoadConfig(xmlFile); + } + catch {} + + return true; + } public void LoadConfig(XmlDocument xmlFile) //Caricamento configurazione { _items.Clear(); //--> pulizia lista elementi di navigazione @@ -619,7 +630,8 @@ xmlSettings.WriteEndElement(); xmlSettings.WriteEndElement(); } - public WindowLink Go() //Gestione finestra di dialogo e navigazione alla destinazione selezionata + public WindowLink Go() { return Go(null); } //Gestione finestra di dialogo e navigazione alla destinazione selezionata (senza delegato per log) + public WindowLink Go(LogEventHandler Log) //Gestione finestra di dialogo e navigazione alla destinazione selezionata { if (Log != null) Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "Request Skin Navigator dialog menu")); @@ -703,7 +715,7 @@ SettingsFile = settingsFile; //--> percorso & nome file delle impostazioni _general = new GeneralSettings(); //--> istanziazione impostazioni generali _items = new BindingList<ShortCut>(); //--> istanziazione lista shortcuts - _navigator = new SkinNavigator(Log); //--> istanziazione Skin Navigator + _navigator = new SkinNavigator(); //--> istanziazione Skin Navigator _initialized = false; //--> reset classe inizializzata lastDestination = new WindowLink(); //--> istanziazione ultima destinazione attivata dal plugin @@ -976,7 +988,7 @@ if (sc != null) //Se combinazione di tasti corrispondente a Skin Navigator { sc.Play(); //--> eventuale effetto sonoro - lastDestination.GetData(Navigator.Go()); //--> gestione navigazione alla destinazione selezionata (ed eventuale memorizzazione) + lastDestination.GetData(Navigator.Go(Log)); //--> gestione navigazione alla destinazione selezionata (ed eventuale memorizzazione) } else //Shortcuts normali if (scList.Count == 1) //Shortcut a destinazione singola This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-05-18 19:03:51
|
Revision: 4807 http://sourceforge.net/p/mp-plugins/code/4807 Author: nicsergio Date: 2014-05-18 19:03:47 +0000 (Sun, 18 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultConfig.xml trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Removed Paths: ------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultNavigatorConfig.xml Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultConfig.xml =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultConfig.xml 2014-05-18 16:40:08 UTC (rev 4806) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultConfig.xml 2014-05-18 19:03:47 UTC (rev 4807) @@ -182,4 +182,56 @@ <SoundEffect>click.wav</SoundEffect> </Item> </Items> + <Navigator> + <General> + <MenuHeader>Skin Navigator</MenuHeader> + <ShowSeparator>1</ShowSeparator> + <Separator>--------------------------------</Separator> + <ShowNumbers>1</ShowNumbers> + <RemoveDuplicates>1</RemoveDuplicates> + </General> + <Items> + <Item> + <Caption>Always</Caption> + <Windows /> + <Destinations> + <Destination> + <Caption>Basic Home</Caption> + <WindowID>35</WindowID> + <LoadParameter /> + <Force>0</Force> + </Destination> + <Destination> + <Caption>Movies</Caption> + <WindowID>96742</WindowID> + <LoadParameter /> + <Force>0</Force> + </Destination> + </Destinations> + </Item> + <Item> + <Caption>Music</Caption> + <Windows> + <Window> + <Caption>TV</Caption> + <WindowID>1</WindowID> + </Window> + </Windows> + <Destinations> + <Destination> + <Caption>Music</Caption> + <WindowID>502</WindowID> + <LoadParameter /> + <Force>0</Force> + </Destination> + <Destination> + <Caption>Movies</Caption> + <WindowID>96742</WindowID> + <LoadParameter /> + <Force>0</Force> + </Destination> + </Destinations> + </Item> + </Items> + </Navigator> </ShortCuter> \ No newline at end of file Deleted: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultNavigatorConfig.xml =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultNavigatorConfig.xml 2014-05-18 16:40:08 UTC (rev 4806) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultNavigatorConfig.xml 2014-05-18 19:03:47 UTC (rev 4807) @@ -1,53 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Navigator> - <General> - <MenuHeader>Skin Navigator</MenuHeader> - <ShowSeparator>1</ShowSeparator> - <Separator>--------------------------------</Separator> - <ShowNumbers>1</ShowNumbers> - <RemoveDuplicates>1</RemoveDuplicates> - </General> - <Items> - <Item> - <Caption>Always</Caption> - <Windows /> - <Destinations> - <Destination> - <Caption>Basic Home</Caption> - <WindowID>35</WindowID> - <LoadParameter /> - <Force>0</Force> - </Destination> - <Destination> - <Caption>Movies</Caption> - <WindowID>96742</WindowID> - <LoadParameter /> - <Force>0</Force> - </Destination> - </Destinations> - </Item> - <Item> - <Caption>Music</Caption> - <Windows> - <Window> - <Caption>TV</Caption> - <WindowID>1</WindowID> - </Window> - </Windows> - <Destinations> - <Destination> - <Caption>Music</Caption> - <WindowID>502</WindowID> - <LoadParameter /> - <Force>0</Force> - </Destination> - <Destination> - <Caption>Movies</Caption> - <WindowID>96742</WindowID> - <LoadParameter /> - <Force>0</Force> - </Destination> - </Destinations> - </Item> - </Items> -</Navigator> \ No newline at end of file Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2014-05-18 16:40:08 UTC (rev 4806) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2014-05-18 19:03:47 UTC (rev 4807) @@ -183,9 +183,6 @@ <Content Include="ExternalResources\Dialogs.dll" /> <Content Include="Resources\Images\SkinNav.png" /> <Content Include="Resources\Images\SkinNavAdd.png" /> - <EmbeddedResource Include="Resources\XmlFiles\DefaultNavigatorConfig.xml"> - <SubType>Designer</SubType> - </EmbeddedResource> <Content Include="..\Common\Resources\Images\ArrowDown.png"> <Link>Resources\Images\ArrowDown.png</Link> </Content> Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-18 16:40:08 UTC (rev 4806) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-18 19:03:47 UTC (rev 4807) @@ -508,35 +508,18 @@ #endregion #region Metodi Pubblici - public bool LoadConfig() { return LoadConfig(string.Empty); } //Caricamento configurazione predefinita - public bool LoadConfig(string settingsFile) //Caricamento configurazione + //public bool LoadConfig() { return LoadConfig(string.Empty); } //Caricamento configurazione predefinita + public void LoadConfig(XmlDocument xmlFile) //Caricamento configurazione { _items.Clear(); //--> pulizia lista elementi di navigazione - string nodeHeader; - FileStream userConfig = null; - try + + XmlNode innerNode; + XmlNode navigatorNode = xmlFile.DocumentElement.SelectSingleNode("/ShortCuter/Navigator"); + if (navigatorNode != null) //Se presenti impostazioni di navigazione { - XmlDocument xmlFile = new XmlDocument(); - if (settingsFile.Length > 0) + XmlNode generalNode = navigatorNode.SelectSingleNode("General"); + if (generalNode != null) //Se presenti impostazioni generali { - userConfig = new FileStream(settingsFile, FileMode.Open, FileAccess.Read); - xmlFile.Load(userConfig); //Lettura file xml delle ultime impostazioni - userConfig.Close(); //--> chiusura file - nodeHeader = "/ShortCuter/Navigator/"; - } - else - { - using (Stream defaultConfig = Assembly.GetExecutingAssembly().GetManifestResourceStream("ProcessPlugins.ShortCuter.Resources.XmlFiles.DefaultNavigatorConfig.xml")) - { - xmlFile.Load(defaultConfig); //Configurazione predefinita --> lettura file xml incapsulato - } - nodeHeader = "/Navigator/"; - } - - XmlNode innerNode; - XmlNode generalNode = xmlFile.DocumentElement.SelectSingleNode(nodeHeader + "General"); - if (generalNode != null) //Se presente sezione "General" - { innerNode = generalNode.SelectSingleNode("MenuHeader"); if (innerNode != null) _general.MenuHeader = innerNode.InnerText; @@ -553,23 +536,7 @@ if (innerNode != null) _general.RemoveDuplicates = Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText)); } - else - { - if (settingsFile.Length > 0) - { - if (Log != null) //Se impostazioni non trovate --> si carica la configurazione predefinita - Log(this, new LogEventArgs(LogEventArgs.LogLevels.Debug, "Navigator settings not found: default config will be loaded..")); - return LoadConfig(); //--> caricamento configurazione predefinita - } - else - { - if (Log != null) //Se impostazioni non trovate nella configurazione predefinita - Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "Navigator settings not found loading DefaultNavigatorConfig.xml.")); - return false; - } - } - - XmlNodeList nodeList = xmlFile.DocumentElement.SelectNodes(nodeHeader + "Items/Item"); + XmlNodeList nodeList = navigatorNode.SelectNodes("Items/Item"); foreach (XmlNode node in nodeList) //Iterazione per memorizzazione elementi di navigazione { Item navItem = new Item(); @@ -586,7 +553,7 @@ innerNode = wndNode.SelectSingleNode("WindowID"); if (innerNode != null) wnd.WindowID = Convert.ToInt32(innerNode.InnerText); - navItem.Windows.Add(wnd); //--> + navItem.Windows.Add(wnd); //--> aggiunta finestra di abilitazione } XmlNodeList dstList = node.SelectNodes("Destinations/Destination"); foreach (XmlNode dstNode in dstList) //Iterazione per memorizzazione destinazioni @@ -605,33 +572,53 @@ if (innerNode != null) dst.Force = Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText)); if (dst.IsValid) - navItem.Destinations.Add(dst); + navItem.Destinations.Add(dst); //--> aggiunta destinazione } _items.Add(navItem); //--> aggiunta elemento di navigazione } - - - if (_items.Count > 0) - return true; //--> lettura configurazione effettuata - else - { - if (defaultSettings && Log != null) //Se nessun shortcut trovato nella configurazione predefinita: emissione messaggio - Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "No shortcuts found loading DefaultConfig.xml.")); - return false; - } } - catch (Exception e) - { - if (defaultSettings && Log != null) //Se lettura configurazione predefinita fallita: emissione messaggio di errore - Log(this, new LogEventArgs(LogEventArgs.LogLevels.Error, "Error loading DefaultConfig.xml.", e)); - return false; - } - finally - { - if (userConfig != null) - userConfig.Close(); //--> eventuale chiusura oggetto FileStream - } } + public void SaveConfig(XmlTextWriter xmlSettings) //Salvataggio configurazione + { + xmlSettings.WriteStartElement("Navigator"); + xmlSettings.WriteStartElement("General"); + xmlSettings.WriteElementString("MenuHeader", _general.MenuHeader); + xmlSettings.WriteElementString("ShowSeparator", Convert.ToInt16(_general.ShowSeparator).ToString()); + xmlSettings.WriteElementString("Separator", _general.Separator); + xmlSettings.WriteElementString("ShowNumbers", Convert.ToInt16(_general.ShowNumbers).ToString()); + xmlSettings.WriteElementString("RemoveDuplicates", Convert.ToInt16(_general.RemoveDuplicates).ToString()); + xmlSettings.WriteEndElement(); + + xmlSettings.WriteStartElement("Items"); + foreach (Item navItem in _items) //Iterazione per salvataggio elementi di navigazione + { + xmlSettings.WriteStartElement("Item"); + xmlSettings.WriteElementString("Caption", navItem.Caption); + xmlSettings.WriteStartElement("Windows"); + foreach (Item.Window wnd in navItem.Windows) //Iterazione per salvataggio finestre di abilitazione + { + xmlSettings.WriteStartElement("Window"); + xmlSettings.WriteElementString("Caption", wnd.Caption); + xmlSettings.WriteElementString("WindowID", wnd.WindowID.ToString()); + xmlSettings.WriteEndElement(); + } + xmlSettings.WriteEndElement(); + xmlSettings.WriteStartElement("Destinations"); + foreach (Item.Destination dst in navItem.Destinations) //Iterazione per salvataggio destinazioni + { + xmlSettings.WriteStartElement("Destination"); + xmlSettings.WriteElementString("Caption", dst.Caption); + xmlSettings.WriteElementString("WindowID", dst.WindowID.ToString()); + xmlSettings.WriteElementString("LoadParameter", dst.LoadParameter); + xmlSettings.WriteElementString("Force", Convert.ToInt16(dst.Force).ToString()); + xmlSettings.WriteEndElement(); + } + xmlSettings.WriteEndElement(); + xmlSettings.WriteEndElement(); + } + xmlSettings.WriteEndElement(); + xmlSettings.WriteEndElement(); + } public WindowLink Go() //Gestione finestra di dialogo e navigazione alla destinazione selezionata { if (Log != null) @@ -897,7 +884,7 @@ } if (_items.Count > 0) { - _navigator.LoadConfig(defaultSettings ? null : SettingsFile); //--> caricamento configurazione Skin Navigator + _navigator.LoadConfig(xmlFile); //--> caricamento configurazione Skin Navigator return true; //--> lettura configurazione effettuata } else @@ -957,6 +944,8 @@ xmlSettings.WriteEndElement(); xmlSettings.WriteEndElement(); + _navigator.SaveConfig(xmlSettings); //--> salvataggio configurazione Skin Navigator + xmlSettings.Flush(); xmlSettings.Close(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-05-18 16:40:14
|
Revision: 4806 http://sourceforge.net/p/mp-plugins/code/4806 Author: nicsergio Date: 2014-05-18 16:40:08 +0000 (Sun, 18 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultNavigatorConfig.xml trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultNavigatorConfig.xml =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultNavigatorConfig.xml 2014-05-16 13:19:01 UTC (rev 4805) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultNavigatorConfig.xml 2014-05-18 16:40:08 UTC (rev 4806) @@ -3,8 +3,7 @@ <General> <MenuHeader>Skin Navigator</MenuHeader> <ShowSeparator>1</ShowSeparator> - <Separator>1</Separator> - <ShowSeparator>--------------------------------</ShowSeparator> + <Separator>--------------------------------</Separator> <ShowNumbers>1</ShowNumbers> <RemoveDuplicates>1</RemoveDuplicates> </General> Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-16 13:19:01 UTC (rev 4805) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-18 16:40:08 UTC (rev 4806) @@ -461,9 +461,9 @@ #endregion #region Proprietà - public new bool IsValid { get { return (base.IsValid && !base.IsNavigator); } } - private new bool IsNavigator { get { return false; } } - public bool Force { get { return this._force; } set { this._force = value; } } + public new bool IsValid { get { return (base.IsValid && !base.IsNavigator); } } + public new bool IsNavigator { get { return false; } } + public bool Force { get { return this._force; } set { this._force = value; } } #endregion } #endregion @@ -508,97 +508,109 @@ #endregion #region Metodi Pubblici + public bool LoadConfig() { return LoadConfig(string.Empty); } //Caricamento configurazione predefinita public bool LoadConfig(string settingsFile) //Caricamento configurazione { _items.Clear(); //--> pulizia lista elementi di navigazione + string nodeHeader; FileStream userConfig = null; try { XmlDocument xmlFile = new XmlDocument(); - if (settingsFile.Length>0) + if (settingsFile.Length > 0) { userConfig = new FileStream(settingsFile, FileMode.Open, FileAccess.Read); xmlFile.Load(userConfig); //Lettura file xml delle ultime impostazioni userConfig.Close(); //--> chiusura file + nodeHeader = "/ShortCuter/Navigator/"; } else + { using (Stream defaultConfig = Assembly.GetExecutingAssembly().GetManifestResourceStream("ProcessPlugins.ShortCuter.Resources.XmlFiles.DefaultNavigatorConfig.xml")) { xmlFile.Load(defaultConfig); //Configurazione predefinita --> lettura file xml incapsulato } + nodeHeader = "/Navigator/"; + } - XmlNode innerNode; - XmlNode generalNode = xmlFile.DocumentElement.SelectSingleNode("/ShortCuter/Navigator/General"); + XmlNode generalNode = xmlFile.DocumentElement.SelectSingleNode(nodeHeader + "General"); if (generalNode != null) //Se presente sezione "General" { - innerNode = generalNode.SelectSingleNode("ForcingCapsLock"); + innerNode = generalNode.SelectSingleNode("MenuHeader"); if (innerNode != null) - _general.ForcingCapsLock = (LockKeys.LockKeyActions)Enum.Parse(typeof(LockKeys.LockKeyActions), innerNode.InnerText); - else + _general.MenuHeader = innerNode.InnerText; + innerNode = generalNode.SelectSingleNode("ShowSeparator"); + if (innerNode != null) + _general.ShowSeparator = Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText)); + innerNode = generalNode.SelectSingleNode("Separator"); + if (innerNode != null) + _general.Separator = innerNode.InnerText; + innerNode = generalNode.SelectSingleNode("ShowNumbers"); + if (innerNode != null) + _general.ShowNumbers = Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText)); + innerNode = generalNode.SelectSingleNode("RemoveDuplicates"); + if (innerNode != null) + _general.RemoveDuplicates = Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText)); + } + else + { + if (settingsFile.Length > 0) { - innerNode = generalNode.SelectSingleNode("ResetCapsLock"); //Necessario per compatibilità con file di configurazione V2.0.5 - if (innerNode != null && Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText))) - _general.ForcingCapsLock = LockKeys.LockKeyActions.Off; + if (Log != null) //Se impostazioni non trovate --> si carica la configurazione predefinita + Log(this, new LogEventArgs(LogEventArgs.LogLevels.Debug, "Navigator settings not found: default config will be loaded..")); + return LoadConfig(); //--> caricamento configurazione predefinita } - innerNode = generalNode.SelectSingleNode("ForcingNumLock"); - if (innerNode != null) - _general.ForcingNumLock = (LockKeys.LockKeyActions)Enum.Parse(typeof(LockKeys.LockKeyActions), innerNode.InnerText); else { - innerNode = generalNode.SelectSingleNode("ResetNumLock"); //Necessario per compatibilità con file di configurazione V2.0.5 - if (innerNode != null && Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText))) - _general.ForcingNumLock = LockKeys.LockKeyActions.Off; + if (Log != null) //Se impostazioni non trovate nella configurazione predefinita + Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "Navigator settings not found loading DefaultNavigatorConfig.xml.")); + return false; } } - else - return false; //--> altrimenti configurazione non presente - XmlNodeList nodeList = xmlFile.DocumentElement.SelectNodes("/ShortCuter/Items/Item"); - foreach (XmlNode node in nodeList) //Iterazione per memorizzazione impostazioni shortcuts + + XmlNodeList nodeList = xmlFile.DocumentElement.SelectNodes(nodeHeader + "Items/Item"); + foreach (XmlNode node in nodeList) //Iterazione per memorizzazione elementi di navigazione { - ShortCut sc = new ShortCut(); + Item navItem = new Item(); innerNode = node.SelectSingleNode("Caption"); if (innerNode != null) - sc.Caption = innerNode.InnerText; - innerNode = node.SelectSingleNode("Key"); - if (innerNode != null) - sc.Key = innerNode.InnerText; - innerNode = node.SelectSingleNode("Ctrl"); - if (innerNode != null) - sc.Ctrl = Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText)); - innerNode = node.SelectSingleNode("Alt"); - if (innerNode != null) - sc.Alt = Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText)); - innerNode = node.SelectSingleNode("Shift"); - if (innerNode != null) - sc.Shift = Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText)); - innerNode = node.SelectSingleNode("WindowID"); - if (innerNode != null) - sc.WindowID = Convert.ToInt32(innerNode.InnerText); - else + navItem.Caption = innerNode.InnerText; + XmlNodeList wndList = node.SelectNodes("Windows/Window"); + foreach (XmlNode wndNode in wndList) //Iterazione per memorizzazione finestre di abilitazione alle destinazioni { - innerNode = node.SelectSingleNode("Hyperlink"); //Necessario per compatibilità con file di configurazione V2.0.0 + Item.Window wnd = new Item.Window(); + innerNode = wndNode.SelectSingleNode("Caption"); if (innerNode != null) - sc.WindowID = Convert.ToInt32(innerNode.InnerText); + wnd.Caption = innerNode.InnerText; + innerNode = wndNode.SelectSingleNode("WindowID"); + if (innerNode != null) + wnd.WindowID = Convert.ToInt32(innerNode.InnerText); + navItem.Windows.Add(wnd); //--> } - innerNode = node.SelectSingleNode("LoadParameter"); - if (innerNode != null) - sc.LoadParameter = innerNode.InnerText; - else + XmlNodeList dstList = node.SelectNodes("Destinations/Destination"); + foreach (XmlNode dstNode in dstList) //Iterazione per memorizzazione destinazioni { - innerNode = node.SelectSingleNode("HyperlinkParameter"); //Necessario per compatibilità con file di configurazione V2.0.0 + Item.Destination dst = new Item.Destination(); + innerNode = dstNode.SelectSingleNode("Caption"); if (innerNode != null) - sc.LoadParameter = innerNode.InnerText; + dst.Caption = innerNode.InnerText; + innerNode = dstNode.SelectSingleNode("WindowID"); + if (innerNode != null) + dst.WindowID = Convert.ToInt32(innerNode.InnerText); + innerNode = dstNode.SelectSingleNode("LoadParameter"); + if (innerNode != null) + dst.LoadParameter = innerNode.InnerText; + innerNode = dstNode.SelectSingleNode("Force"); + if (innerNode != null) + dst.Force = Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText)); + if (dst.IsValid) + navItem.Destinations.Add(dst); } - innerNode = node.SelectSingleNode("Return"); - if (innerNode != null) - sc.Return = Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText)); - innerNode = node.SelectSingleNode("SoundEffect"); - if (innerNode != null) - sc.SoundEffect = innerNode.InnerText; - if (sc.IsValid) //Se shortcut valido - _items.Add(sc); //--> aggiunta dello shortcut nella lista + _items.Add(navItem); //--> aggiunta elemento di navigazione } + + if (_items.Count > 0) return true; //--> lettura configurazione effettuata else @@ -884,7 +896,10 @@ _items.Add(sc); //--> aggiunta dello shortcut nella lista } if (_items.Count > 0) + { + _navigator.LoadConfig(defaultSettings ? null : SettingsFile); //--> caricamento configurazione Skin Navigator return true; //--> lettura configurazione effettuata + } else { if (defaultSettings && Log != null) //Se nessun shortcut trovato nella configurazione predefinita: emissione messaggio This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-05-16 13:19:06
|
Revision: 4805 http://sourceforge.net/p/mp-plugins/code/4805 Author: nicsergio Date: 2014-05-16 13:19:01 +0000 (Fri, 16 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-12 14:52:42 UTC (rev 4804) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-16 13:19:01 UTC (rev 4805) @@ -508,8 +508,118 @@ #endregion #region Metodi Pubblici + public bool LoadConfig(string settingsFile) //Caricamento configurazione + { + _items.Clear(); //--> pulizia lista elementi di navigazione + FileStream userConfig = null; + try + { + XmlDocument xmlFile = new XmlDocument(); + if (settingsFile.Length>0) + { + userConfig = new FileStream(settingsFile, FileMode.Open, FileAccess.Read); + xmlFile.Load(userConfig); //Lettura file xml delle ultime impostazioni + userConfig.Close(); //--> chiusura file + } + else + using (Stream defaultConfig = Assembly.GetExecutingAssembly().GetManifestResourceStream("ProcessPlugins.ShortCuter.Resources.XmlFiles.DefaultNavigatorConfig.xml")) + { + xmlFile.Load(defaultConfig); //Configurazione predefinita --> lettura file xml incapsulato + } - + + XmlNode innerNode; + XmlNode generalNode = xmlFile.DocumentElement.SelectSingleNode("/ShortCuter/Navigator/General"); + if (generalNode != null) //Se presente sezione "General" + { + innerNode = generalNode.SelectSingleNode("ForcingCapsLock"); + if (innerNode != null) + _general.ForcingCapsLock = (LockKeys.LockKeyActions)Enum.Parse(typeof(LockKeys.LockKeyActions), innerNode.InnerText); + else + { + innerNode = generalNode.SelectSingleNode("ResetCapsLock"); //Necessario per compatibilità con file di configurazione V2.0.5 + if (innerNode != null && Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText))) + _general.ForcingCapsLock = LockKeys.LockKeyActions.Off; + } + innerNode = generalNode.SelectSingleNode("ForcingNumLock"); + if (innerNode != null) + _general.ForcingNumLock = (LockKeys.LockKeyActions)Enum.Parse(typeof(LockKeys.LockKeyActions), innerNode.InnerText); + else + { + innerNode = generalNode.SelectSingleNode("ResetNumLock"); //Necessario per compatibilità con file di configurazione V2.0.5 + if (innerNode != null && Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText))) + _general.ForcingNumLock = LockKeys.LockKeyActions.Off; + } + } + else + return false; //--> altrimenti configurazione non presente + XmlNodeList nodeList = xmlFile.DocumentElement.SelectNodes("/ShortCuter/Items/Item"); + foreach (XmlNode node in nodeList) //Iterazione per memorizzazione impostazioni shortcuts + { + ShortCut sc = new ShortCut(); + innerNode = node.SelectSingleNode("Caption"); + if (innerNode != null) + sc.Caption = innerNode.InnerText; + innerNode = node.SelectSingleNode("Key"); + if (innerNode != null) + sc.Key = innerNode.InnerText; + innerNode = node.SelectSingleNode("Ctrl"); + if (innerNode != null) + sc.Ctrl = Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText)); + innerNode = node.SelectSingleNode("Alt"); + if (innerNode != null) + sc.Alt = Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText)); + innerNode = node.SelectSingleNode("Shift"); + if (innerNode != null) + sc.Shift = Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText)); + innerNode = node.SelectSingleNode("WindowID"); + if (innerNode != null) + sc.WindowID = Convert.ToInt32(innerNode.InnerText); + else + { + innerNode = node.SelectSingleNode("Hyperlink"); //Necessario per compatibilità con file di configurazione V2.0.0 + if (innerNode != null) + sc.WindowID = Convert.ToInt32(innerNode.InnerText); + } + innerNode = node.SelectSingleNode("LoadParameter"); + if (innerNode != null) + sc.LoadParameter = innerNode.InnerText; + else + { + innerNode = node.SelectSingleNode("HyperlinkParameter"); //Necessario per compatibilità con file di configurazione V2.0.0 + if (innerNode != null) + sc.LoadParameter = innerNode.InnerText; + } + innerNode = node.SelectSingleNode("Return"); + if (innerNode != null) + sc.Return = Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText)); + innerNode = node.SelectSingleNode("SoundEffect"); + if (innerNode != null) + sc.SoundEffect = innerNode.InnerText; + if (sc.IsValid) //Se shortcut valido + _items.Add(sc); //--> aggiunta dello shortcut nella lista + } + if (_items.Count > 0) + return true; //--> lettura configurazione effettuata + else + { + if (defaultSettings && Log != null) //Se nessun shortcut trovato nella configurazione predefinita: emissione messaggio + Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "No shortcuts found loading DefaultConfig.xml.")); + return false; + } + } + catch (Exception e) + { + if (defaultSettings && Log != null) //Se lettura configurazione predefinita fallita: emissione messaggio di errore + Log(this, new LogEventArgs(LogEventArgs.LogLevels.Error, "Error loading DefaultConfig.xml.", e)); + return false; + } + finally + { + if (userConfig != null) + userConfig.Close(); //--> eventuale chiusura oggetto FileStream + } + } public WindowLink Go() //Gestione finestra di dialogo e navigazione alla destinazione selezionata { if (Log != null) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-05-12 14:52:45
|
Revision: 4804 http://sourceforge.net/p/mp-plugins/code/4804 Author: nicsergio Date: 2014-05-12 14:52:42 +0000 (Mon, 12 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-12 08:46:12 UTC (rev 4803) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-12 14:52:42 UTC (rev 4804) @@ -81,7 +81,7 @@ #endregion #region Metodi Pubblici - public bool Go() { return Go(null); } //Visualizzazione finestra del collegamento (senza log) + public bool Go() { return Go(null); } //Visualizzazione finestra del collegamento (senza delegato per log) public bool Go(LogEventHandler Log) //Visualizzazione finestra del collegamento { if (_caption.Length > 0 && Log != null) @@ -138,7 +138,7 @@ return false; //--> comando non completato } } - public bool GoPrevious() { return GoPrevious(null); } //Ritorno alla finestra precedente (senza log) + public bool GoPrevious() { return GoPrevious(null); } //Ritorno alla finestra precedente (senza delegato per log) public bool GoPrevious(LogEventHandler Log) //Ritorno alla finestra precedente { if (_caption.Length > 0 && Log != null) @@ -304,7 +304,7 @@ #endregion #region Metodi Pubblici - public bool Go() { return Go(null); } //Visualizzazione finestra del collegamento (senza log) + public bool Go() { return Go(null); } //Visualizzazione finestra del collegamento (senza delegato per log) public bool Go(LogEventHandler Log) //Visualizzazione finestra del collegamento { if (_caption.Length > 0 && Log != null) @@ -313,7 +313,7 @@ Play(); //--> eventuale effetto sonoro return _destination.Go(Log); //--> visualizzazione finestra di destinazione } - public bool GoPrevious() { return GoPrevious(null); } //Ritorno alla finestra precedente (senza log) + public bool GoPrevious() { return GoPrevious(null); } //Ritorno alla finestra precedente (senza delegato per log) public bool GoPrevious(LogEventHandler Log) //Ritorno alla finestra precedente { if (_caption.Length > 0 && Log != null) @@ -387,6 +387,35 @@ public class SkinNavigator //Sotto-classe di gestione Skin Navigator { #region Classi + public class GeneralSettings //Sotto-classe di gestione impostazioni generali Skin Navigator + { + #region Dati + private string _menuHeader; //Titolo menu di navigazione + private bool _showSeparator; //Visualizzazione separatore gruppi di destinazioni + private string _separator; //Eventuale separatore da visualizzare + private bool _showNumbers; //Visualizzazione numeri cossispondenti a voci menu (per accesso da telecomando) + private bool _removeDuplicates; //Rimozione destinazioni duplicate + #endregion + + #region Costruttore + public GeneralSettings() //Costruttore classe GeneralSettings + { + _menuHeader = "Skin Navigator"; //--> titolo menu di navigazione + _showSeparator = true; //--> visualizzazione separatore attiva + _separator = "-- -- -- -- -- --"; //--> separatore da visualizzare + _showNumbers = true; //--> visualizzazione numeri cossispondenti a voci menu + _removeDuplicates = true; //--> rimozione di destinazioni duplicate + } + #endregion + + #region Proprietà + public string MenuHeader { get { return this._menuHeader; } set { this._menuHeader = value; } } + public bool ShowSeparator { get { return this._showSeparator; } set { this._showSeparator = value; } } + public string Separator { get { return this._separator; } set { this._separator = value; } } + public bool ShowNumbers { get { return this._showNumbers; } set { this._showNumbers = value; } } + public bool RemoveDuplicates { get { return this._removeDuplicates; } set { this._removeDuplicates = value; } } + #endregion + } public class Item //Sotto-classe elemento per navigazione { #region Classi @@ -415,7 +444,7 @@ #endregion } public class Destination : WindowLink //Sotto-classe destinazione di navigazione - { + { #region Dati private bool _force; //Forzatura destinazione #endregion @@ -463,55 +492,25 @@ #endregion #region Dati - private string _menuHeader; //Titolo menu di navigazione - private bool _showSeparator; //Visualizzazione separatore gruppi di destinazioni - private string _separator; //Eventuale separatore da visualizzare - private bool _showNumbers; //Visualizzazione numeri cossispondenti a voci menu (per accesso da telecomando) - private bool _removeDuplicates; //Rimozione destinazioni duplicate + private GeneralSettings _general; //Impostazioni generali private BindingList<Item> _items; //Lista (con associazione dati) elementi di navigazione + private readonly LogEventHandler Log; #endregion #region Costruttore - public SkinNavigator() //Costruttore classe NavigatorSettings + public SkinNavigator() : this(null) { } //Costruttore classe SkinNavigator (senza delegato per log) + public SkinNavigator(LogEventHandler LogHandler) //Costruttore classe SkinNavigator { - _menuHeader = "Skin Navigator"; //--> titolo menu di navigazione - _showSeparator = true; //--> visualizzazione separatore attiva - _separator = "-- -- -- -- -- --"; //--> separatore da visualizzare - _removeDuplicates = true; //--> rimozione di destinazioni duplicate - _items = new BindingList<Item>(); //--> istanziazione lista elementi di navigazione - - - - Item iii1 = new Item(); - Item.Destination ddd1 = new Item.Destination(); - iii1.Caption = "www"; - ddd1.Caption = "Home"; - ddd1.WindowID = 35; - iii1.Destinations.Add(ddd1); - Item.Destination ddd2 = new Item.Destination(); - ddd2.Caption = "Movie"; - ddd2.WindowID =96742; - iii1.Destinations.Add(ddd2); - _items.Add(iii1); - - Item.Window www = new Item.Window(); - www.WindowID = 1; - Item iii2 = new Item(); - iii2.Caption = "www"; - iii2.Windows.Add(www); - Item.Destination ddd3 = new Item.Destination(); - ddd3.Caption = "Music"; - ddd3.WindowID = 501; - iii2.Destinations.Add(ddd3); - _items.Add(iii2); - - - + _general = new GeneralSettings(); //--> istanziazione impostazioni generali + _items = new BindingList<Item>(); //--> istanziazione lista elementi di navigazione + Log = LogHandler; //--> assegnazione eventuale delegato per operazioni di log } #endregion #region Metodi Pubblici - public WindowLink Go(LogEventHandler Log) //Gestione finestra di dialogo e navigazione alla destinazione selezionata + + + public WindowLink Go() //Gestione finestra di dialogo e navigazione alla destinazione selezionata { if (Log != null) Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "Request Skin Navigator dialog menu")); @@ -521,8 +520,8 @@ int actWindowID = (int)GUIWindowManager.ActiveWindow; //--> id finestra attuale GUIDialogMenu dlgMenu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); dlgMenu.Reset(); - dlgMenu.SetHeading(_menuHeader); //--> titolo menu - dlgMenu.ShowQuickNumbers = _showNumbers; + dlgMenu.SetHeading(_general.MenuHeader); //--> titolo menu + dlgMenu.ShowQuickNumbers = _general.ShowNumbers; //--> visualizzazione numeri voci List<WindowLink> dlgLinks = new List<WindowLink>(); //--> lista links corrispondenti agli elementi di menu foreach (Item item in _items) //Iterazione per valutazione elementi di navigazione impostati @@ -532,11 +531,11 @@ bool first = true; foreach (Item.Destination dst in item.Destinations) //Iterazione di aggiunta destinazioni { - if ((dlgLinks.Find(x => x.WindowID == dst.WindowID && x.LoadParameter == dst.LoadParameter) == null || !_removeDuplicates) && (dst.WindowID != actWindowID || dst.Force)) + if ((dlgLinks.Find(x => x.WindowID == dst.WindowID && x.LoadParameter == dst.LoadParameter) == null || !_general.RemoveDuplicates) && (dst.WindowID != actWindowID || dst.Force)) { //Controllo destinazione duplicata o corrispondente a finestra attuale - if (_showSeparator && first && dlgLinks.Count > 0) //Eventuale inserzione separatore destinazioni + if (_general.ShowSeparator && first && dlgLinks.Count > 0) //Eventuale inserzione separatore destinazioni { - dlgMenu.Add(_separator); + dlgMenu.Add(_general.Separator); dlgLinks.Add(null); } dlgMenu.Add(dst.Caption); //--> aggiunta voce di menu @@ -574,11 +573,7 @@ #endregion #region Proprietà - public string MenuHeader { get { return this._menuHeader; } set { this._menuHeader = value; } } - public bool ShowSeparator { get { return this._showSeparator; } set { this._showSeparator = value; } } - public string Separator { get { return this._separator; } set { this._separator = value; } } - public bool ShowNumbers { get { return this._showNumbers; } set { this._showNumbers = value; } } - public bool RemoveDuplicates { get { return this._removeDuplicates; } set { this._removeDuplicates = value; } } + public GeneralSettings General { get { return this._general; } } public BindingList<Item> Items { get { return this._items; } } #endregion } @@ -599,7 +594,7 @@ SettingsFile = settingsFile; //--> percorso & nome file delle impostazioni _general = new GeneralSettings(); //--> istanziazione impostazioni generali _items = new BindingList<ShortCut>(); //--> istanziazione lista shortcuts - _navigator = new SkinNavigator(); //--> istanziazione Skin Navigator + _navigator = new SkinNavigator(Log); //--> istanziazione Skin Navigator _initialized = false; //--> reset classe inizializzata lastDestination = new WindowLink(); //--> istanziazione ultima destinazione attivata dal plugin @@ -867,7 +862,7 @@ if (sc != null) //Se combinazione di tasti corrispondente a Skin Navigator { sc.Play(); //--> eventuale effetto sonoro - lastDestination.GetData(Navigator.Go(Log)); //--> gestione navigazione alla destinazione selezionata (ed eventuale memorizzazione) + lastDestination.GetData(Navigator.Go()); //--> gestione navigazione alla destinazione selezionata (ed eventuale memorizzazione) } else //Shortcuts normali if (scList.Count == 1) //Shortcut a destinazione singola This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-05-12 08:46:14
|
Revision: 4803 http://sourceforge.net/p/mp-plugins/code/4803 Author: nicsergio Date: 2014-05-12 08:46:12 +0000 (Mon, 12 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Added Paths: ----------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultNavigatorConfig.xml Added: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultNavigatorConfig.xml =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultNavigatorConfig.xml (rev 0) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Resources/XmlFiles/DefaultNavigatorConfig.xml 2014-05-12 08:46:12 UTC (rev 4803) @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="utf-8"?> +<Navigator> + <General> + <MenuHeader>Skin Navigator</MenuHeader> + <ShowSeparator>1</ShowSeparator> + <Separator>1</Separator> + <ShowSeparator>--------------------------------</ShowSeparator> + <ShowNumbers>1</ShowNumbers> + <RemoveDuplicates>1</RemoveDuplicates> + </General> + <Items> + <Item> + <Caption>Always</Caption> + <Windows /> + <Destinations> + <Destination> + <Caption>Basic Home</Caption> + <WindowID>35</WindowID> + <LoadParameter /> + <Force>0</Force> + </Destination> + <Destination> + <Caption>Movies</Caption> + <WindowID>96742</WindowID> + <LoadParameter /> + <Force>0</Force> + </Destination> + </Destinations> + </Item> + <Item> + <Caption>Music</Caption> + <Windows> + <Window> + <Caption>TV</Caption> + <WindowID>1</WindowID> + </Window> + </Windows> + <Destinations> + <Destination> + <Caption>Music</Caption> + <WindowID>502</WindowID> + <LoadParameter /> + <Force>0</Force> + </Destination> + <Destination> + <Caption>Movies</Caption> + <WindowID>96742</WindowID> + <LoadParameter /> + <Force>0</Force> + </Destination> + </Destinations> + </Item> + </Items> +</Navigator> \ No newline at end of file Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2014-05-11 12:58:31 UTC (rev 4802) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2014-05-12 08:46:12 UTC (rev 4803) @@ -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> @@ -143,6 +143,9 @@ <Generator>ResXFileCodeGenerator</Generator> <LastGenOutput>Resources.Designer.cs</LastGenOutput> </EmbeddedResource> + <EmbeddedResource Include="Resources\XmlFiles\DefaultConfig.xml"> + <SubType>Designer</SubType> + </EmbeddedResource> <EmbeddedResource Include="ShortCuterConfig.resx"> <DependentUpon>ShortCuterConfig.cs</DependentUpon> </EmbeddedResource> @@ -180,7 +183,7 @@ <Content Include="ExternalResources\Dialogs.dll" /> <Content Include="Resources\Images\SkinNav.png" /> <Content Include="Resources\Images\SkinNavAdd.png" /> - <EmbeddedResource Include="Resources\XmlFiles\DefaultConfig.xml"> + <EmbeddedResource Include="Resources\XmlFiles\DefaultNavigatorConfig.xml"> <SubType>Designer</SubType> </EmbeddedResource> <Content Include="..\Common\Resources\Images\ArrowDown.png"> Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-11 12:58:31 UTC (rev 4802) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-12 08:46:12 UTC (rev 4803) @@ -7,11 +7,11 @@ using System.Text; using System.Windows.Forms; using System.Xml; +using MediaPortal.Dialogs; using MediaPortal.GUI.Library; using MediaPortal.Player; using MediaPortal.Profile; using MediaPortal.Util; -using MediaPortal.Dialogs; namespace ProcessPlugins.ShortCuter { @@ -466,6 +466,7 @@ private string _menuHeader; //Titolo menu di navigazione private bool _showSeparator; //Visualizzazione separatore gruppi di destinazioni private string _separator; //Eventuale separatore da visualizzare + private bool _showNumbers; //Visualizzazione numeri cossispondenti a voci menu (per accesso da telecomando) private bool _removeDuplicates; //Rimozione destinazioni duplicate private BindingList<Item> _items; //Lista (con associazione dati) elementi di navigazione #endregion @@ -521,7 +522,7 @@ GUIDialogMenu dlgMenu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); dlgMenu.Reset(); dlgMenu.SetHeading(_menuHeader); //--> titolo menu - dlgMenu.ShowQuickNumbers = false; + dlgMenu.ShowQuickNumbers = _showNumbers; List<WindowLink> dlgLinks = new List<WindowLink>(); //--> lista links corrispondenti agli elementi di menu foreach (Item item in _items) //Iterazione per valutazione elementi di navigazione impostati @@ -576,6 +577,7 @@ public string MenuHeader { get { return this._menuHeader; } set { this._menuHeader = value; } } public bool ShowSeparator { get { return this._showSeparator; } set { this._showSeparator = value; } } public string Separator { get { return this._separator; } set { this._separator = value; } } + public bool ShowNumbers { get { return this._showNumbers; } set { this._showNumbers = value; } } public bool RemoveDuplicates { get { return this._removeDuplicates; } set { this._removeDuplicates = value; } } public BindingList<Item> Items { get { return this._items; } } #endregion @@ -601,7 +603,6 @@ _initialized = false; //--> reset classe inizializzata lastDestination = new WindowLink(); //--> istanziazione ultima destinazione attivata dal plugin - lastDestination.Caption = "Last destination"; //--> titolo ultima destinazione lastDestination.Reset(); //--> reset ultima destinazione attivata dal plugin } #endregion This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-05-11 12:58:34
|
Revision: 4802 http://sourceforge.net/p/mp-plugins/code/4802 Author: nicsergio Date: 2014-05-11 12:58:31 +0000 (Sun, 11 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-09 22:39:13 UTC (rev 4801) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-11 12:58:31 UTC (rev 4802) @@ -159,12 +159,22 @@ } public WindowLink Clone() //Clonazione collegamento { - WindowLink lnk = new WindowLink(); + WindowLink lnk = new WindowLink(); lnk.Caption = _caption; lnk.WindowID = _windowID; lnk.LoadParameter = _loadParameter; return lnk; } + public WindowLink GetData(WindowLink lnk) //Copiatura dati da un'altro collegamento + { + if (lnk != null) + { + _caption = lnk.Caption; + _windowID = lnk.WindowID; + _loadParameter = lnk.LoadParameter; + } + return this; + } public void Reset() //Reset destinazione (invalidazione) { _windowID = InvalidID; //--> invalidazione Id finestra @@ -315,16 +325,15 @@ public void Play() { Play(false); } //Manda effetto sonoro dello shortcut public ShortCut Clone() //Clonazione shortcut { - ShortCut sc = new ShortCut(); - sc.Caption = _caption; - sc.Key = _keys.Key; - sc.Ctrl = _keys.Ctrl; - sc.Alt = _keys.Alt; - sc.Shift = _keys.Shift; - sc.WindowID = _destination.WindowID; - sc.LoadParameter = _destination.LoadParameter; - sc.Return = _return; - sc.SoundEffect = _soundEffect; + ShortCut sc = new ShortCut(); + sc.Caption = _caption; + sc.Key = _keys.Key; + sc.Ctrl = _keys.Ctrl; + sc.Alt = _keys.Alt; + sc.Shift = _keys.Shift; + sc._destination = _destination.Clone(); + sc.Return = _return; + sc.SoundEffect = _soundEffect; return sc; } public override string ToString() //Override metodo ToString per stampare le proprietà dello shortcut @@ -338,17 +347,18 @@ #endregion #region Proprietà - public bool IsValid { get { return this._destination.IsValid && this._keys.IsValid; } } - public bool IsNavigator { get { return this._destination.IsNavigator; } } - public string Caption { get { return this._caption; } set { this._caption = value; this.NotifyPropertyChanged("Caption"); } } - public string Key { get { return this._keys.Key; } set { this._keys.Key = value; this.NotifyPropertyChanged("Key"); } } - public bool Ctrl { get { return this._keys.Ctrl; } set { this._keys.Ctrl = value; this.NotifyPropertyChanged("Ctrl"); } } - public bool Alt { get { return this._keys.Alt; } set { this._keys.Alt = value; this.NotifyPropertyChanged("Alt"); } } - public bool Shift { get { return this._keys.Shift; } set { this._keys.Shift = value; this.NotifyPropertyChanged("Shift"); } } - public int WindowID { get { return this._destination.WindowID; } set { this._destination.WindowID = value; this.NotifyPropertyChanged("WindowID"); } } - public string LoadParameter { get { return this._destination.LoadParameter; } set { this._destination.LoadParameter = value; this.NotifyPropertyChanged("LoadParameter"); } } - public bool Return { get { return this._return; } set { this._return = value; this.NotifyPropertyChanged("Return"); } } - public string SoundEffect { get { return this._soundEffect; } set { this._soundEffect = value; this.NotifyPropertyChanged("SoundEffect"); } } + public bool IsValid { get { return this._destination.IsValid && this._keys.IsValid; } } + public bool IsNavigator { get { return this._destination.IsNavigator; } } + public string Caption { get { return this._caption; } set { this._caption = value; this.NotifyPropertyChanged("Caption"); } } + public string Key { get { return this._keys.Key; } set { this._keys.Key = value; this.NotifyPropertyChanged("Key"); } } + public bool Ctrl { get { return this._keys.Ctrl; } set { this._keys.Ctrl = value; this.NotifyPropertyChanged("Ctrl"); } } + public bool Alt { get { return this._keys.Alt; } set { this._keys.Alt = value; this.NotifyPropertyChanged("Alt"); } } + public bool Shift { get { return this._keys.Shift; } set { this._keys.Shift = value; this.NotifyPropertyChanged("Shift"); } } + public int WindowID { get { return this._destination.WindowID; } set { this._destination.WindowID = value; this.NotifyPropertyChanged("WindowID"); } } + public string LoadParameter { get { return this._destination.LoadParameter; } set { this._destination.LoadParameter = value; this.NotifyPropertyChanged("LoadParameter"); } } + public bool Return { get { return this._return; } set { this._return = value; this.NotifyPropertyChanged("Return"); } } + public string SoundEffect { get { return this._soundEffect; } set { this._soundEffect = value; this.NotifyPropertyChanged("SoundEffect"); } } + public WindowLink Destination { get { return this._destination.Clone(); } } #endregion } internal class ShortCuts //Classe di gestione degli shortcuts configurati @@ -422,7 +432,9 @@ #endregion #region Proprietà - public bool Force { get { return this._force; } set { this._force = value; } } + public new bool IsValid { get { return (base.IsValid && !base.IsNavigator); } } + private new bool IsNavigator { get { return false; } } + public bool Force { get { return this._force; } set { this._force = value; } } #endregion } #endregion @@ -527,12 +539,7 @@ dlgLinks.Add(null); } dlgMenu.Add(dst.Caption); //--> aggiunta voce di menu - - WindowLink lnk = new WindowLink(); - lnk.WindowID = dst.WindowID; - lnk.Caption = dst.Caption; - lnk.LoadParameter = dst.LoadParameter; - dlgLinks.Add(lnk); //--> aggiunta destinazione corrispondente + dlgLinks.Add(new WindowLink().GetData(dst)); //--> aggiunta destinazione corrispondente (classe WindowLink) first = false; } } @@ -859,12 +866,7 @@ if (sc != null) //Se combinazione di tasti corrispondente a Skin Navigator { sc.Play(); //--> eventuale effetto sonoro - WindowLink dst = Navigator.Go(Log); //--> gestione navigazione alla destinazione selezionata - if (dst != null) //Se attivata correttamente una destinazione - { - lastDestination.WindowID = dst.WindowID; //--> memorizzazione id finestra - lastDestination.LoadParameter = dst.LoadParameter; //--> memorizzazione parametri di caricamento utilizzati - } + lastDestination.GetData(Navigator.Go(Log)); //--> gestione navigazione alla destinazione selezionata (ed eventuale memorizzazione) } else //Shortcuts normali if (scList.Count == 1) //Shortcut a destinazione singola @@ -873,10 +875,7 @@ scList[0].GoPrevious(Log); //--> visualizzazione finestra precedente else if (scList[0].Go(Log)) //--> visualizzazione finestra di destinazione shortcut - { - lastDestination.WindowID = scList[0].WindowID; //--> memorizzazione id finestra - lastDestination.LoadParameter = scList[0].LoadParameter; //--> memorizzazione parametri di caricamento utilizzati - } + lastDestination.GetData(scList[0].Destination); //--> aggiornamento ultima destinazione } else //Shortcut a destinazione multipla (ciclico) { @@ -890,10 +889,7 @@ } } if (scList[scIndex].Go(Log)) //--> visualizzazione finestra di destinazione shortcut - { - lastDestination.WindowID = scList[scIndex].WindowID; //--> memorizzazione id finestra - lastDestination.LoadParameter = scList[scIndex].LoadParameter; //--> memorizzazione parametri di caricamento utilizzati - } + lastDestination.GetData(scList[0].Destination); //--> aggiornamento ultima destinazione } } else //Combinazione di tasti non corrispondente a nessuno shortcut This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-05-09 22:39:16
|
Revision: 4801 http://sourceforge.net/p/mp-plugins/code/4801 Author: nicsergio Date: 2014-05-09 22:39:13 +0000 (Fri, 09 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs 2014-05-09 15:07:50 UTC (rev 4800) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs 2014-05-09 22:39:13 UTC (rev 4801) @@ -17,7 +17,7 @@ #region Costruttore static ShortCuter() //Costruttore classe ShortCuter { - LogPrefix = Tools.MyAssembly.Title + " - "; //Header per log su file (titolo assembly) + LogPrefix = Tools.MyAssembly.Title + ": "; //Header per log su file (titolo assembly) } #endregion Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-09 15:07:50 UTC (rev 4800) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-09 22:39:13 UTC (rev 4801) @@ -282,6 +282,15 @@ if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(name)); //--> pubblicazione evento } + private void Play(bool back) //Manda effetto sonoro (da specificare eventuale ritorno a finestra precedente) + { + try + { + if (_soundEffect.Length > 0 && !g_Player.Playing) + Utils.PlaySound(back ? "back.wav" : _soundEffect, false, true); //--> eventuale effetto sonoro + } + catch { } + } #endregion #region Metodi Pubblici @@ -291,13 +300,7 @@ if (_caption.Length > 0 && Log != null) Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "Go to shortcut destination, " + this.ToString())); - try - { - if (_soundEffect.Length > 0 && !g_Player.Playing) - Utils.PlaySound(_soundEffect, false, true); //--> eventuale effetto sonoro - } - catch { } - + Play(); //--> eventuale effetto sonoro return _destination.Go(Log); //--> visualizzazione finestra di destinazione } public bool GoPrevious() { return GoPrevious(null); } //Ritorno alla finestra precedente (senza log) @@ -306,15 +309,10 @@ if (_caption.Length > 0 && Log != null) Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "Go to previous window")); - try - { - if (_soundEffect.Length > 0 && !g_Player.Playing) - Utils.PlaySound("back.wav", false, true); //--> eventuale effetto sonoro - } - catch { } - + Play(true); //--> eventuale effetto sonoro return _destination.GoPrevious(Log); //--> visualizzazione finestra precedente } + public void Play() { Play(false); } //Manda effetto sonoro dello shortcut public ShortCut Clone() //Clonazione shortcut { ShortCut sc = new ShortCut(); @@ -353,92 +351,249 @@ public string SoundEffect { get { return this._soundEffect; } set { this._soundEffect = value; this.NotifyPropertyChanged("SoundEffect"); } } #endregion } - - internal class Window //Classe finestra di MediaPortal + internal class ShortCuts //Classe di gestione degli shortcuts configurati { - #region Dati - private string _caption; //Titolo finestra - private int _windowID; //Id finestra - private string _xmlFile; //Nome del file xml corrispondente - #endregion + #region Classi + public class GeneralSettings //Sotto-classe di gestione impostazioni generali + { + #region Dati + private LockKeys.LockKeyActions _forcingCapsLock; //Tipologia di forzatura Caps-Lock all'avvio + private LockKeys.LockKeyActions _forcingNumLock; //Tipologia di forzatura Num-Lock all'avvio + #endregion - #region Costruttore - public Window() //Costruttore classe Window + #region Costruttore + public GeneralSettings() //Costruttore classe GeneralSettings + { + _forcingCapsLock = LockKeys.LockKeyActions.None; //--> default: nessuna modifica stato Caps-Lock + _forcingNumLock = LockKeys.LockKeyActions.None; //--> default: nessuna modifica stato Num-Lock + } + #endregion + + #region Proprietà + public LockKeys.LockKeyActions ForcingCapsLock { get { return this._forcingCapsLock; } set { this._forcingCapsLock = value; } } + public LockKeys.LockKeyActions ForcingNumLock { get { return this._forcingNumLock; } set { this._forcingNumLock = value; } } + #endregion + } + public class SkinNavigator //Sotto-classe di gestione Skin Navigator { - _caption = ""; //--> inizializzazione titolo - _windowID = 0; //--> inizializzazione Id finestra - _xmlFile = ""; //--> inizializzazione nome file xml - } - #endregion + #region Classi + public class Item //Sotto-classe elemento per navigazione + { + #region Classi + public class Window //Sotto-classe finestra di abilitazione alla navigazione + { + #region Dati + private string _caption; //Titolo finestra + private int _windowID; //Id finestra + #endregion - #region Metodi Pubblici - public override string ToString() { return (_caption); } //Override metodo ToString per riempire classi ListControl - #endregion + #region Costruttore + public Window() //Costruttore classe Window + { + _caption = ""; //--> inizializzazione titolo + _windowID = 0; //--> inizializzazione Id finestra + } + #endregion - #region Proprietà - public string Caption { get { return this._caption; } set { this._caption = value; } } - public int WindowID { get { return this._windowID; } set { this._windowID = value; } } - public string XmlFile { get { return this._xmlFile; } set { this._xmlFile = value; } } - #endregion - } - internal class NavItem //Classe elemento per navigazione - { - #region Dati - private string _caption; //Titolo link - private BindingList<Window> _windows = new BindingList<Window>(); - private BindingList<WindowLink> _destinations = new BindingList<WindowLink>(); - #endregion + #region Metodi Pubblici + public override string ToString() { return (_caption); } //Override metodo ToString per riempire classi ListControl + #endregion - #region Costruttore - public NavItem() //Costruttore classe Window - { - _caption = "Navigator Group"; //--> inizializzazione titolo - } - #endregion + #region Proprietà + public string Caption { get { return this._caption; } set { this._caption = value; } } + public int WindowID { get { return this._windowID; } set { this._windowID = value; } } + #endregion + } + public class Destination : WindowLink //Sotto-classe destinazione di navigazione + { + #region Dati + private bool _force; //Forzatura destinazione + #endregion - #region Proprietà - public string Caption { get { return this._caption; } set { this._caption = value; } } - public BindingList<Window> Windows { get { return this._windows; } } - public BindingList<WindowLink> Destinations { get { return this._destinations; } } - #endregion - } + #region Costruttore + public Destination() : base() //Costruttore classe Destination + { + _force = false; //--> inizializzazione forzatura destinazione + } + #endregion - internal class ShortCuts //Classe di gestione degli shortcuts configurati - { - #region Strutture - - public struct GeneralSettings //Struttura impostazioni generali - { - public LockKeys.LockKeyActions ForcingCapsLock; //Tipologia di forzatura Caps-Lock all'avvio - public LockKeys.LockKeyActions ForcingNumLock; //Tipologia di forzatura Num-Lock all'avvio + #region Metodi Pubblici + public override string ToString() { return (base.Caption); } //Override metodo ToString per riempire classi ListControl + #endregion + + #region Proprietà + public bool Force { get { return this._force; } set { this._force = value; } } + #endregion + } + #endregion + + #region Dati + private string _caption; //Titolo elemento di navigazione + private BindingList<Window> _windows; //Lista (con associazione dati) delle finestre di abilitazione alle destinazioni + private BindingList<Destination> _destinations; //Lista (con associazione dati) delle destinazioni + #endregion + + #region Costruttore + public Item() //Costruttore classe Item + { + _caption = "Navigator Group"; //--> inizializzazione titolo + _windows = new BindingList<Window>(); //--> istanziazione finestre di abilitazione alle destinazioni + _destinations = new BindingList<Destination>(); //--> istanziazione destinazioni + } + #endregion + + #region Proprietà + public string Caption { get { return this._caption; } set { this._caption = value; } } + public BindingList<Window> Windows { get { return this._windows; } } + public BindingList<Destination> Destinations { get { return this._destinations; } } + #endregion + } + #endregion + + #region Dati + private string _menuHeader; //Titolo menu di navigazione + private bool _showSeparator; //Visualizzazione separatore gruppi di destinazioni + private string _separator; //Eventuale separatore da visualizzare + private bool _removeDuplicates; //Rimozione destinazioni duplicate + private BindingList<Item> _items; //Lista (con associazione dati) elementi di navigazione + #endregion + + #region Costruttore + public SkinNavigator() //Costruttore classe NavigatorSettings + { + _menuHeader = "Skin Navigator"; //--> titolo menu di navigazione + _showSeparator = true; //--> visualizzazione separatore attiva + _separator = "-- -- -- -- -- --"; //--> separatore da visualizzare + _removeDuplicates = true; //--> rimozione di destinazioni duplicate + _items = new BindingList<Item>(); //--> istanziazione lista elementi di navigazione + + + + Item iii1 = new Item(); + Item.Destination ddd1 = new Item.Destination(); + iii1.Caption = "www"; + ddd1.Caption = "Home"; + ddd1.WindowID = 35; + iii1.Destinations.Add(ddd1); + Item.Destination ddd2 = new Item.Destination(); + ddd2.Caption = "Movie"; + ddd2.WindowID =96742; + iii1.Destinations.Add(ddd2); + _items.Add(iii1); + + Item.Window www = new Item.Window(); + www.WindowID = 1; + Item iii2 = new Item(); + iii2.Caption = "www"; + iii2.Windows.Add(www); + Item.Destination ddd3 = new Item.Destination(); + ddd3.Caption = "Music"; + ddd3.WindowID = 501; + iii2.Destinations.Add(ddd3); + _items.Add(iii2); + + + + } + #endregion + + #region Metodi Pubblici + public WindowLink Go(LogEventHandler Log) //Gestione finestra di dialogo e navigazione alla destinazione selezionata + { + if (Log != null) + Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "Request Skin Navigator dialog menu")); + + try + { + int actWindowID = (int)GUIWindowManager.ActiveWindow; //--> id finestra attuale + GUIDialogMenu dlgMenu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); + dlgMenu.Reset(); + dlgMenu.SetHeading(_menuHeader); //--> titolo menu + dlgMenu.ShowQuickNumbers = false; + + List<WindowLink> dlgLinks = new List<WindowLink>(); //--> lista links corrispondenti agli elementi di menu + foreach (Item item in _items) //Iterazione per valutazione elementi di navigazione impostati + { + if (item.Windows.Count == 0 || item.Windows.ToList().Find(x => x.WindowID == actWindowID) != null) + { //Controllo se finestra attuale contenuta nel gruppo di finestre di abilitazione destinazioni + bool first = true; + foreach (Item.Destination dst in item.Destinations) //Iterazione di aggiunta destinazioni + { + if ((dlgLinks.Find(x => x.WindowID == dst.WindowID && x.LoadParameter == dst.LoadParameter) == null || !_removeDuplicates) && (dst.WindowID != actWindowID || dst.Force)) + { //Controllo destinazione duplicata o corrispondente a finestra attuale + if (_showSeparator && first && dlgLinks.Count > 0) //Eventuale inserzione separatore destinazioni + { + dlgMenu.Add(_separator); + dlgLinks.Add(null); + } + dlgMenu.Add(dst.Caption); //--> aggiunta voce di menu + + WindowLink lnk = new WindowLink(); + lnk.WindowID = dst.WindowID; + lnk.Caption = dst.Caption; + lnk.LoadParameter = dst.LoadParameter; + dlgLinks.Add(lnk); //--> aggiunta destinazione corrispondente + first = false; + } + } + } + } + + if (dlgLinks.Count > 0) //Se selezionabile almeno una destinazione + { + dlgMenu.DoModal(actWindowID); //--> visualizzazione menu + if (dlgMenu.SelectedLabel >= 0 && dlgMenu.SelectedLabel < dlgLinks.Count && dlgLinks[dlgMenu.SelectedLabel] != null) + { + if (dlgLinks[dlgMenu.SelectedLabel].Go(Log)) //--> attivazione destinazione selezionata + return dlgLinks[dlgMenu.SelectedLabel]; //--> ritorno destinazione attivata + } + else + if (Log != null) + Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "No links selected from Skin Navigator dialog menu, WindowID=" + actWindowID)); + } + else + if (Log != null) + Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "No links found for Skin Navigator, WindowID=" + actWindowID)); + return null; + } + catch (Exception e) + { + if (Log != null) + Log(this, new LogEventArgs(LogEventArgs.LogLevels.Error, "Error opening Skin Navigator dialog menu", e)); + return null; + } + } + #endregion + + #region Proprietà + public string MenuHeader { get { return this._menuHeader; } set { this._menuHeader = value; } } + public bool ShowSeparator { get { return this._showSeparator; } set { this._showSeparator = value; } } + public string Separator { get { return this._separator; } set { this._separator = value; } } + public bool RemoveDuplicates { get { return this._removeDuplicates; } set { this._removeDuplicates = value; } } + public BindingList<Item> Items { get { return this._items; } } + #endregion } - public struct NavigatorSettings - { - public string Header ; //Tipologia di forzatura Caps-Lock all'avvio - public bool ShowSeparator; //Tipologia di forzatura Num-Lock all'avvio - public string Separator; - public bool RemoveDuplicates; - } #endregion #region Dati private readonly string SettingsFile; //File di salvataggio impostazioni - private GeneralSettings _general = new GeneralSettings(); //Impostazioni generali plugin - private BindingList<ShortCut> _items = new BindingList<ShortCut>(); //Lista (con associazione dati) degli shortcuts configurati - private BindingList<NavItem> _navItems = new BindingList<NavItem>(); - private bool _initialized; //Classe inizializzata - - private WindowLink lastDestination = new WindowLink(); //Dati ultima destinazione attivata dal plugin - + private GeneralSettings _general; //Impostazioni generali + private BindingList<ShortCut> _items; //Lista (con associazione dati) degli shortcuts configurati + private SkinNavigator _navigator; //Skin Navigator + private bool _initialized; //Classe inizializzata + private WindowLink lastDestination; //Dati ultima destinazione attivata #endregion #region Costruttore public ShortCuts(string settingsFile) //Costruttore classe ShortCuts { SettingsFile = settingsFile; //--> percorso & nome file delle impostazioni - _general.ForcingCapsLock = LockKeys.LockKeyActions.None; //--> default: nessuna modifica stato Caps-Lock - _general.ForcingNumLock = LockKeys.LockKeyActions.None; //--> default: nessuna modifica stato Num-Lock + _general = new GeneralSettings(); //--> istanziazione impostazioni generali + _items = new BindingList<ShortCut>(); //--> istanziazione lista shortcuts + _navigator = new SkinNavigator(); //--> istanziazione Skin Navigator _initialized = false; //--> reset classe inizializzata + + lastDestination = new WindowLink(); //--> istanziazione ultima destinazione attivata dal plugin lastDestination.Caption = "Last destination"; //--> titolo ultima destinazione lastDestination.Reset(); //--> reset ultima destinazione attivata dal plugin } @@ -507,62 +662,6 @@ else return false; //--> finestra attuale non corrispondente a destinazione shortcut } - private void Navigation() //Gestione finestra di dialogo e navigazione alla destinazione selezionata - { - if (Log != null) - Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "Request Skin Navigator dialog menu")); - - try - { - int actWindowID = (int)GUIWindowManager.ActiveWindow; - GUIDialogMenu dlgMenu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); - dlgMenu.Reset(); - dlgMenu.SetHeading("Skin Navigator"); - dlgMenu.ShowQuickNumbers = false; - - List<WindowLink> dlgLinks = new List<WindowLink>(); - foreach (NavItem item in _navItems) //Iterazione per memorizzazione impostazioni shortcuts - { - if ((item.Windows.First(x => x.WindowID == actWindowID)) != null || item.Windows.Count == 0) - { - bool first = true; - foreach (WindowLink link in item.Destinations) //Iterazione per memorizzazione impostazioni shortcuts - { - if (first && dlgLinks.Count > 0) - { - dlgMenu.Add("---- ----"); - dlgLinks.Add(null); - first = false; - } - dlgMenu.Add(link.Caption); - dlgLinks.Add(link); - } - } - } - - if (dlgLinks.Count > 0) - { - dlgMenu.DoModal(actWindowID); - if (dlgMenu.SelectedLabel >= 0 && dlgMenu.SelectedLabel < dlgLinks.Count) - if (dlgLinks[dlgMenu.SelectedLabel].Go(Log)) - { - lastDestination.WindowID = dlgLinks[dlgMenu.SelectedLabel].WindowID; - lastDestination.LoadParameter = dlgLinks[dlgMenu.SelectedLabel].LoadParameter; - } - else - if (Log != null) - Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "No links selected from Skin Navigator dialog menu, ID = " + actWindowID)); - } - else - if (Log != null) - Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "No links found for Skin Navigator, window ID = " + actWindowID)); - } - catch (Exception e) - { - if (Log != null) - Log(this, new LogEventArgs(LogEventArgs.LogLevels.Error, "Error opening Skin Navigator dialog menu", e)); - } - } #endregion #region Metodi Pubblici @@ -755,10 +854,21 @@ { List<ShortCut> scList = GetShortCutsGroup(k); //--> raccolta lista shortcut associati alla combinazione di tasti attuale if (scList != null && scList.Count > 0) //Se trovato almeno uno shortcut - if (scList.Find(x => x.IsNavigator) != null) //Se combinazione di tasti corrispondente a Skin Navigator - Navigation(); //--> gestione navigazione alla destinazione selezionata + { + ShortCut sc = scList.Find(x => x.IsNavigator); //Ricerca eventuali corrispondenze a Skin Navigator + if (sc != null) //Se combinazione di tasti corrispondente a Skin Navigator + { + sc.Play(); //--> eventuale effetto sonoro + WindowLink dst = Navigator.Go(Log); //--> gestione navigazione alla destinazione selezionata + if (dst != null) //Se attivata correttamente una destinazione + { + lastDestination.WindowID = dst.WindowID; //--> memorizzazione id finestra + lastDestination.LoadParameter = dst.LoadParameter; //--> memorizzazione parametri di caricamento utilizzati + } + } else //Shortcuts normali if (scList.Count == 1) //Shortcut a destinazione singola + { if (scList[0].Return && AlreadyAtDestination(scList[0])) //Se impostato flag di ritorno e finestra attuale corrispondente a destinazione scList[0].GoPrevious(Log); //--> visualizzazione finestra precedente else @@ -767,6 +877,7 @@ lastDestination.WindowID = scList[0].WindowID; //--> memorizzazione id finestra lastDestination.LoadParameter = scList[0].LoadParameter; //--> memorizzazione parametri di caricamento utilizzati } + } else //Shortcut a destinazione multipla (ciclico) { int scIndex = 0; @@ -784,6 +895,7 @@ lastDestination.LoadParameter = scList[scIndex].LoadParameter; //--> memorizzazione parametri di caricamento utilizzati } } + } else //Combinazione di tasti non corrispondente a nessuno shortcut if (Log != null) Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "Key not mapped: " + k.ToString())); @@ -801,13 +913,10 @@ #endregion #region Proprietà - public bool Initialized { get { return this._initialized; } } - - public GeneralSettings General { get { return this._general; } set { this._general = value; } } - - //public LockKeys.LockKeyActions GeneralForcingCapsLock { get { return this._general.ForcingCapsLock; } set { this._general.ForcingCapsLock = value; } } - //public LockKeys.LockKeyActions GeneralForcingNumLock { get { return this._general.ForcingNumLock; } set { this._general.ForcingNumLock = value; } } - public BindingList<ShortCut> Items { get { return this._items; } } + public bool Initialized { get { return this._initialized; } } + public GeneralSettings General { get { return this._general; } } + public BindingList<ShortCut> Items { get { return this._items; } } + public SkinNavigator Navigator { get { return this._navigator; } } #endregion } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-05-09 15:07:53
|
Revision: 4800 http://sourceforge.net/p/mp-plugins/code/4800 Author: nicsergio Date: 2014-05-09 15:07:50 +0000 (Fri, 09 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs 2014-05-08 15:04:15 UTC (rev 4799) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs 2014-05-09 15:07:50 UTC (rev 4800) @@ -30,10 +30,10 @@ myShortCuts = new ShortCuts(settingsFile); //Creazione classe per gestione shorcuts myShortCuts.Log += new LogEventHandler(myShortCuts_Log); //--> sottoscrizione evento di log shortuts - if (LockKeys.ChangeCapsLock(myShortCuts.GeneralForcingCapsLock)) - MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "CapsLock " + ((myShortCuts.GeneralForcingCapsLock == LockKeys.LockKeyActions.Off) ? "deactivated" : "activated"))); - if (LockKeys.ChangeNumLock(myShortCuts.GeneralForcingNumLock)) - MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "NumLock " + ((myShortCuts.GeneralForcingNumLock == LockKeys.LockKeyActions.Off) ? "deactivated" : "activated"))); + if (LockKeys.ChangeCapsLock(myShortCuts.General.ForcingCapsLock)) + MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "CapsLock " + ((myShortCuts.General.ForcingCapsLock == LockKeys.LockKeyActions.Off) ? "deactivated" : "activated"))); + if (LockKeys.ChangeNumLock(myShortCuts.General.ForcingNumLock)) + MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "NumLock " + ((myShortCuts.General.ForcingNumLock == LockKeys.LockKeyActions.Off) ? "deactivated" : "activated"))); if (myShortCuts.Initialize()) //Inizializzazione & lettura impostazioni shorcuts { Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs 2014-05-08 15:04:15 UTC (rev 4799) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs 2014-05-09 15:07:50 UTC (rev 4800) @@ -33,9 +33,9 @@ FormatShortCutsGrid(); capsLockComboBox.DataSource = Enum.GetNames(typeof(LockKeys.LockKeyActions)); - capsLockComboBox.SelectedItem = Enum.GetName(typeof(LockKeys.LockKeyActions), myShortCuts.GeneralForcingCapsLock); + capsLockComboBox.SelectedItem = Enum.GetName(typeof(LockKeys.LockKeyActions), myShortCuts.General.ForcingCapsLock); numLockComboBox.DataSource = Enum.GetNames(typeof(LockKeys.LockKeyActions)); - numLockComboBox.SelectedItem = Enum.GetName(typeof(LockKeys.LockKeyActions), myShortCuts.GeneralForcingNumLock); + numLockComboBox.SelectedItem = Enum.GetName(typeof(LockKeys.LockKeyActions), myShortCuts.General.ForcingNumLock); toolTip.SetToolTip(skinItems, "Double click to set the link's parameter to shortcut"); toolTip.SetToolTip(rowAddButton, "Add shortcut to list"); @@ -230,8 +230,8 @@ } private bool Save() //Salvataggio configurazione plugin { - myShortCuts.GeneralForcingCapsLock = (LockKeys.LockKeyActions)Enum.Parse(typeof(LockKeys.LockKeyActions), capsLockComboBox.SelectedItem.ToString()); - myShortCuts.GeneralForcingNumLock = (LockKeys.LockKeyActions)Enum.Parse(typeof(LockKeys.LockKeyActions), numLockComboBox.SelectedItem.ToString()); + myShortCuts.General.ForcingCapsLock = (LockKeys.LockKeyActions)Enum.Parse(typeof(LockKeys.LockKeyActions), capsLockComboBox.SelectedItem.ToString()); + myShortCuts.General.ForcingNumLock = (LockKeys.LockKeyActions)Enum.Parse(typeof(LockKeys.LockKeyActions), numLockComboBox.SelectedItem.ToString()); return myShortCuts.SaveConfig(); } #endregion Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-08 15:04:15 UTC (rev 4799) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-09 15:07:50 UTC (rev 4800) @@ -21,7 +21,7 @@ { #region Dati private LogLevels _logLevel; //Livello di log - private string _logMessage; //Messaggio di log + private string _logMessage; //Messaggio di log private Exception _logException; //Eventuale eccezione public enum LogLevels //Tipologie di livelli di log @@ -43,8 +43,8 @@ #endregion #region Proprietà - public LogLevels LogLevel { get { return this._logLevel; } } - public string LogMessage { get { return this._logMessage; } } + public LogLevels LogLevel { get { return this._logLevel; } } + public string LogMessage { get { return this._logMessage; } } public Exception LogException { get { return this._logException; } } #endregion } @@ -160,8 +160,8 @@ public WindowLink Clone() //Clonazione collegamento { WindowLink lnk = new WindowLink(); - lnk.Caption = _caption; - lnk.WindowID = _windowID; + lnk.Caption = _caption; + lnk.WindowID = _windowID; lnk.LoadParameter = _loadParameter; return lnk; } @@ -177,10 +177,10 @@ #endregion #region Proprietà - public bool IsValid { get { return (this._windowID > InvalidID || this.IsNavigator); } } - public bool IsNavigator { get { return (this._windowID == NavigatorID); } } - public string Caption { get { return this._caption; } set { this._caption = value; } } - public int WindowID { get { return this._windowID; } set { this._windowID = value; } } + public bool IsValid { get { return (this._windowID > InvalidID || this.IsNavigator); } } + public bool IsNavigator { get { return (this._windowID == NavigatorID); } } + public string Caption { get { return this._caption; } set { this._caption = value; } } + public int WindowID { get { return this._windowID; } set { this._windowID = value; } } public string LoadParameter { get { return this._loadParameter; } set { this._loadParameter = value; } } #endregion } @@ -188,9 +188,9 @@ { #region Dati private string _key; //Tasto (stringa corrispondente a KeyCode) - private bool _ctrl; //Utilizzo del modificatore "Ctrl" - combinazione di tasti - private bool _alt; //Utilizzo del modificatore "Alt" - combinazione di tasti - private bool _shift; //Utilizzo del modificatore "Shift" - combinazione di tasti + private bool _ctrl; //Utilizzo del modificatore "Ctrl" - combinazione di tasti + private bool _alt; //Utilizzo del modificatore "Alt" - combinazione di tasti + private bool _shift; //Utilizzo del modificatore "Shift" - combinazione di tasti private static readonly List<Keys> ModifierKeys = new List<Keys>(); //Lista dei tasti modificatori #endregion @@ -210,16 +210,16 @@ } public KeyCombination() //Costruttore classe KeyCombination { - _key = "A"; //--> inizializzazione tasto - _ctrl = true; //--> inizializzazione utilizzo del modificatore "Ctrl" - _alt = false; //--> inizializzazione utilizzo del modificatore "Alt" + _key = "A"; //--> inizializzazione tasto + _ctrl = true; //--> inizializzazione utilizzo del modificatore "Ctrl" + _alt = false; //--> inizializzazione utilizzo del modificatore "Alt" _shift = true; //--> inizializzazione utilizzo del modificatore "Shift" } public KeyCombination(KeyEventArgs k) //Costruttore classe KeyCombination da evento di pressione tasto { - _key = k.KeyCode.ToString(); //--> assegnazione tasto - _ctrl = k.Control; //--> utilizzo del modificatore "Ctrl" - _alt = k.Alt; //--> utilizzo del modificatore "Alt" + _key = k.KeyCode.ToString(); //--> assegnazione tasto + _ctrl = k.Control; //--> utilizzo del modificatore "Ctrl" + _alt = k.Alt; //--> utilizzo del modificatore "Alt" _shift = k.Shift; //--> utilizzo del modificatore "Shift" } #endregion @@ -247,32 +247,32 @@ return (key != Keys.None && !ModifierKeys.Contains(key)); //--> verifica se la stringa corrisponde ad un tasto e che il tasto non sia un modificatore } } - public string Key { get { return this._key; } set { this._key = value; } } - public bool Ctrl { get { return this._ctrl; } set { this._ctrl = value; } } - public bool Alt { get { return this._alt; } set { this._alt = value; } } + public string Key { get { return this._key; } set { this._key = value; } } + public bool Ctrl { get { return this._ctrl; } set { this._ctrl = value; } } + public bool Alt { get { return this._alt; } set { this._alt = value; } } public bool Shift { get { return this._shift; } set { this._shift = value; } } #endregion } internal class ShortCut : INotifyPropertyChanged //Classe shortcut (scorciatoia da tastiera) con notifica variazione proprietà per binding su GridView { #region Dati - private string _caption; //Titolo link + private string _caption; //Titolo link private KeyCombination _keys; //Combinazione di tasti per attivazione shortcut - private WindowLink _destination; //Destinazione dello shortcut - private bool _return; //Ritorno a finestra precedente se si è già a destinazione - private string _soundEffect; //File relativo all'eventuale effetto sonoro + private WindowLink _destination; //Destinazione dello shortcut + private bool _return; //Ritorno a finestra precedente se si è già a destinazione + private string _soundEffect; //File relativo all'eventuale effetto sonoro #endregion #region Costruttore public ShortCut() : this(false) { } //Costruttore classe ShortCut (senza argomenti) public ShortCut(bool skinNavigator) //Costruttore classe ShortCut { - _caption = (skinNavigator ? "Skin Navigator" : "ShortCut"); //--> inizializzazione titolo - _keys = new KeyCombination(); //--> istanziazione classe KeyCombination - _destination = new WindowLink(skinNavigator); //--> istanziazione classe WindowLink + _caption = (skinNavigator ? "Skin Navigator" : "ShortCut"); //--> inizializzazione titolo + _keys = new KeyCombination(); //--> istanziazione classe KeyCombination + _destination = new WindowLink(skinNavigator); //--> istanziazione classe WindowLink _destination.Caption = ""; //--> reset caption destinazione (gestita caption shortcut) - _return = false; //--> inizializzazione ritorno a finestra precedente se si è già a destinazione - _soundEffect = "click.wav"; //--> inizializzazione effetto sonoro + _return = false; //--> inizializzazione ritorno a finestra precedente se si è già a destinazione + _soundEffect = "click.wav"; //--> inizializzazione effetto sonoro } #endregion @@ -340,17 +340,17 @@ #endregion #region Proprietà - public bool IsValid { get { return this._destination.IsValid && this._keys.IsValid; } } - public bool IsNavigator { get { return this._destination.IsNavigator; } } - public string Caption { get { return this._caption; } set { this._caption = value; this.NotifyPropertyChanged("Caption"); } } - public string Key { get { return this._keys.Key; } set { this._keys.Key = value; this.NotifyPropertyChanged("Key"); } } - public bool Ctrl { get { return this._keys.Ctrl; } set { this._keys.Ctrl = value; this.NotifyPropertyChanged("Ctrl"); } } - public bool Alt { get { return this._keys.Alt; } set { this._keys.Alt = value; this.NotifyPropertyChanged("Alt"); } } - public bool Shift { get { return this._keys.Shift; } set { this._keys.Shift = value; this.NotifyPropertyChanged("Shift"); } } - public int WindowID { get { return this._destination.WindowID; } set { this._destination.WindowID = value; this.NotifyPropertyChanged("WindowID"); } } + public bool IsValid { get { return this._destination.IsValid && this._keys.IsValid; } } + public bool IsNavigator { get { return this._destination.IsNavigator; } } + public string Caption { get { return this._caption; } set { this._caption = value; this.NotifyPropertyChanged("Caption"); } } + public string Key { get { return this._keys.Key; } set { this._keys.Key = value; this.NotifyPropertyChanged("Key"); } } + public bool Ctrl { get { return this._keys.Ctrl; } set { this._keys.Ctrl = value; this.NotifyPropertyChanged("Ctrl"); } } + public bool Alt { get { return this._keys.Alt; } set { this._keys.Alt = value; this.NotifyPropertyChanged("Alt"); } } + public bool Shift { get { return this._keys.Shift; } set { this._keys.Shift = value; this.NotifyPropertyChanged("Shift"); } } + public int WindowID { get { return this._destination.WindowID; } set { this._destination.WindowID = value; this.NotifyPropertyChanged("WindowID"); } } public string LoadParameter { get { return this._destination.LoadParameter; } set { this._destination.LoadParameter = value; this.NotifyPropertyChanged("LoadParameter"); } } - public bool Return { get { return this._return; } set { this._return = value; this.NotifyPropertyChanged("Return"); } } - public string SoundEffect { get { return this._soundEffect; } set { this._soundEffect = value; this.NotifyPropertyChanged("SoundEffect"); } } + public bool Return { get { return this._return; } set { this._return = value; this.NotifyPropertyChanged("Return"); } } + public string SoundEffect { get { return this._soundEffect; } set { this._soundEffect = value; this.NotifyPropertyChanged("SoundEffect"); } } #endregion } @@ -381,7 +381,7 @@ public string XmlFile { get { return this._xmlFile; } set { this._xmlFile = value; } } #endregion } - internal class NavItem //Classe elemento per navigazione + internal class NavItem //Classe elemento per navigazione { #region Dati private string _caption; //Titolo link @@ -406,31 +406,40 @@ internal class ShortCuts //Classe di gestione degli shortcuts configurati { #region Strutture - private struct GeneralSettings //Struttura impostazioni generali + + public struct GeneralSettings //Struttura impostazioni generali { public LockKeys.LockKeyActions ForcingCapsLock; //Tipologia di forzatura Caps-Lock all'avvio public LockKeys.LockKeyActions ForcingNumLock; //Tipologia di forzatura Num-Lock all'avvio } + public struct NavigatorSettings + { + public string Header ; //Tipologia di forzatura Caps-Lock all'avvio + public bool ShowSeparator; //Tipologia di forzatura Num-Lock all'avvio + public string Separator; + public bool RemoveDuplicates; + } #endregion #region Dati - private readonly string SettingsFile; //File di salvataggio impostazioni - private GeneralSettings _general = new GeneralSettings(); //Impostazioni generali plugin - private BindingList<ShortCut> _items = new BindingList<ShortCut>(); //Lista (con associazione dati) degli shortcuts configurati - private BindingList<NavItem> _navItems = new BindingList<NavItem>(); - private bool _initialized; //Classe inizializzata + private readonly string SettingsFile; //File di salvataggio impostazioni + private GeneralSettings _general = new GeneralSettings(); //Impostazioni generali plugin + private BindingList<ShortCut> _items = new BindingList<ShortCut>(); //Lista (con associazione dati) degli shortcuts configurati + private BindingList<NavItem> _navItems = new BindingList<NavItem>(); + private bool _initialized; //Classe inizializzata - private WindowLink lastDestination = new WindowLink(); //Dati ultima destinazione attivata dal plugin + private WindowLink lastDestination = new WindowLink(); //Dati ultima destinazione attivata dal plugin + #endregion #region Costruttore public ShortCuts(string settingsFile) //Costruttore classe ShortCuts { - SettingsFile = settingsFile; //--> percorso & nome file delle impostazioni + SettingsFile = settingsFile; //--> percorso & nome file delle impostazioni _general.ForcingCapsLock = LockKeys.LockKeyActions.None; //--> default: nessuna modifica stato Caps-Lock - _general.ForcingNumLock = LockKeys.LockKeyActions.None; //--> default: nessuna modifica stato Num-Lock - _initialized = false; //--> reset classe inizializzata - lastDestination.Caption = "Last destination"; //--> titolo ultima destinazione + _general.ForcingNumLock = LockKeys.LockKeyActions.None; //--> default: nessuna modifica stato Num-Lock + _initialized = false; //--> reset classe inizializzata + lastDestination.Caption = "Last destination"; //--> titolo ultima destinazione lastDestination.Reset(); //--> reset ultima destinazione attivata dal plugin } #endregion @@ -441,25 +450,25 @@ using (Settings confReader = new Settings(SettingsFile)) { const string sectionName = "ShortCuterForm"; - const string capPrefix = "Titel"; - const string keyPrefix = "Key"; - const string widPrefix = "ID"; + const string capPrefix = "Titel"; + const string keyPrefix = "Key"; + const string widPrefix = "ID"; if (!confReader.HasSection<string>(sectionName)) return false; //--> se sezione non presente: il file non corrisponde - bool ctrl = confReader.GetValueAsBool(sectionName, "ModCtrl", false); //--> utilizzo del modificatore ctrl per tutti gli shortcut + bool ctrl = confReader.GetValueAsBool(sectionName, "ModCtrl", false); //--> utilizzo del modificatore ctrl per tutti gli shortcut bool shift = confReader.GetValueAsBool(sectionName, "ModShift", false); //--> utilizzo del modificatore shift per tutti gli shortcut for (int i = 1; i <= 20; i++) //Iterazione di lettura shortcut { ShortCut sc = new ShortCut(); - sc.Caption = confReader.GetValueAsString(sectionName, capPrefix + string.Format("{0:00}", i), ""); - sc.Key = confReader.GetValueAsString(sectionName, keyPrefix + string.Format("{0:00}", i), "").ToUpper(); - sc.WindowID = confReader.GetValueAsInt(sectionName, widPrefix + string.Format("{0:00}", i), -1); - sc.Ctrl = ctrl; - sc.Alt = false; - sc.Shift = shift; + sc.Caption = confReader.GetValueAsString(sectionName, capPrefix + string.Format("{0:00}", i), ""); + sc.Key = confReader.GetValueAsString(sectionName, keyPrefix + string.Format("{0:00}", i), "").ToUpper(); + sc.WindowID = confReader.GetValueAsInt(sectionName, widPrefix + string.Format("{0:00}", i), -1); + sc.Ctrl = ctrl; + sc.Alt = false; + sc.Shift = shift; if (sc.IsValid) //Se shortcut valido _items.Add(sc); //--> aggiunta dello shortcut nella lista } @@ -512,12 +521,12 @@ dlgMenu.ShowQuickNumbers = false; List<WindowLink> dlgLinks = new List<WindowLink>(); - foreach (NavItem item in _navItems) //Iterazione per memorizzazione impostazioni shortcuts + foreach (NavItem item in _navItems) //Iterazione per memorizzazione impostazioni shortcuts { if ((item.Windows.First(x => x.WindowID == actWindowID)) != null || item.Windows.Count == 0) { bool first = true; - foreach (WindowLink link in item.Destinations) //Iterazione per memorizzazione impostazioni shortcuts + foreach (WindowLink link in item.Destinations) //Iterazione per memorizzazione impostazioni shortcuts { if (first && dlgLinks.Count > 0) { @@ -537,7 +546,7 @@ if (dlgMenu.SelectedLabel >= 0 && dlgMenu.SelectedLabel < dlgLinks.Count) if (dlgLinks[dlgMenu.SelectedLabel].Go(Log)) { - lastDestination.WindowID = dlgLinks[dlgMenu.SelectedLabel].WindowID; + lastDestination.WindowID = dlgLinks[dlgMenu.SelectedLabel].WindowID; lastDestination.LoadParameter = dlgLinks[dlgMenu.SelectedLabel].LoadParameter; } else @@ -559,7 +568,7 @@ #region Metodi Pubblici public bool Initialize() //Inizializzazione { - _initialized = LoadConfig(false); //--> caricamento configurazione (standard) shortcuts + _initialized = LoadConfig(false); //--> caricamento configurazione (standard) shortcuts if (!_initialized) { if (Log != null) @@ -602,7 +611,7 @@ _general.ForcingCapsLock = (LockKeys.LockKeyActions)Enum.Parse(typeof(LockKeys.LockKeyActions), innerNode.InnerText); else { - innerNode = generalNode.SelectSingleNode("ResetCapsLock"); //Necessario per compatibilità con file di configurazione V2.0.5.0 + innerNode = generalNode.SelectSingleNode("ResetCapsLock"); //Necessario per compatibilità con file di configurazione V2.0.5 if (innerNode != null && Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText))) _general.ForcingCapsLock = LockKeys.LockKeyActions.Off; } @@ -611,7 +620,7 @@ _general.ForcingNumLock = (LockKeys.LockKeyActions)Enum.Parse(typeof(LockKeys.LockKeyActions), innerNode.InnerText); else { - innerNode = generalNode.SelectSingleNode("ResetNumLock"); //Necessario per compatibilità con file di configurazione V2.0.5.0 + innerNode = generalNode.SelectSingleNode("ResetNumLock"); //Necessario per compatibilità con file di configurazione V2.0.5 if (innerNode != null && Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText))) _general.ForcingNumLock = LockKeys.LockKeyActions.Off; } @@ -640,7 +649,7 @@ sc.WindowID = Convert.ToInt32(innerNode.InnerText); else { - innerNode = node.SelectSingleNode("Hyperlink"); //Necessario per compatibilità con file di configurazione V2.0.0.0 + innerNode = node.SelectSingleNode("Hyperlink"); //Necessario per compatibilità con file di configurazione V2.0.0 if (innerNode != null) sc.WindowID = Convert.ToInt32(innerNode.InnerText); } @@ -649,7 +658,7 @@ sc.LoadParameter = innerNode.InnerText; else { - innerNode = node.SelectSingleNode("HyperlinkParameter"); //Necessario per compatibilità con file di configurazione V2.0.0.0 + innerNode = node.SelectSingleNode("HyperlinkParameter"); //Necessario per compatibilità con file di configurazione V2.0.0 if (innerNode != null) sc.LoadParameter = innerNode.InnerText; } @@ -673,7 +682,7 @@ } catch (Exception e) { - if (defaultSettings && Log != null) //Se lettura configurazione predefinita fallita: emissione messaggio di errore + if (defaultSettings && Log != null) //Se lettura configurazione predefinita fallita: emissione messaggio di errore Log(this, new LogEventArgs(LogEventArgs.LogLevels.Error, "Error loading DefaultConfig.xml.", e)); return false; } @@ -699,27 +708,27 @@ xmlSettings.WriteStartDocument(); xmlSettings.WriteStartElement("ShortCuter"); - xmlSettings.WriteStartElement("General"); - xmlSettings.WriteElementString("ForcingCapsLock", _general.ForcingCapsLock.ToString()); - xmlSettings.WriteElementString("ForcingNumLock", _general.ForcingNumLock.ToString()); - xmlSettings.WriteEndElement(); - xmlSettings.WriteStartElement("Items"); - foreach (ShortCut sc in _items) //Iterazione per salvataggio sortcuts - { - xmlSettings.WriteStartElement("Item"); - xmlSettings.WriteElementString("Caption", sc.Caption); - xmlSettings.WriteElementString("Key", sc.Key); - xmlSettings.WriteElementString("Ctrl", Convert.ToInt16(sc.Ctrl).ToString()); - xmlSettings.WriteElementString("Alt", Convert.ToInt16(sc.Alt).ToString()); - xmlSettings.WriteElementString("Shift", Convert.ToInt16(sc.Shift).ToString()); - xmlSettings.WriteElementString("WindowID", sc.WindowID.ToString()); - xmlSettings.WriteElementString("LoadParameter", sc.LoadParameter); - xmlSettings.WriteElementString("Return", Convert.ToInt16(sc.Return).ToString()); - xmlSettings.WriteElementString("SoundEffect", sc.SoundEffect); + xmlSettings.WriteStartElement("General"); + xmlSettings.WriteElementString("ForcingCapsLock", _general.ForcingCapsLock.ToString()); + xmlSettings.WriteElementString("ForcingNumLock", _general.ForcingNumLock.ToString()); xmlSettings.WriteEndElement(); - } + xmlSettings.WriteStartElement("Items"); + foreach (ShortCut sc in _items) //Iterazione per salvataggio sortcuts + { + xmlSettings.WriteStartElement("Item"); + xmlSettings.WriteElementString("Caption", sc.Caption); + xmlSettings.WriteElementString("Key", sc.Key); + xmlSettings.WriteElementString("Ctrl", Convert.ToInt16(sc.Ctrl).ToString()); + xmlSettings.WriteElementString("Alt", Convert.ToInt16(sc.Alt).ToString()); + xmlSettings.WriteElementString("Shift", Convert.ToInt16(sc.Shift).ToString()); + xmlSettings.WriteElementString("WindowID", sc.WindowID.ToString()); + xmlSettings.WriteElementString("LoadParameter", sc.LoadParameter); + xmlSettings.WriteElementString("Return", Convert.ToInt16(sc.Return).ToString()); + xmlSettings.WriteElementString("SoundEffect", sc.SoundEffect); + xmlSettings.WriteEndElement(); + } + xmlSettings.WriteEndElement(); xmlSettings.WriteEndElement(); - xmlSettings.WriteEndElement(); xmlSettings.Flush(); xmlSettings.Close(); @@ -746,7 +755,6 @@ { List<ShortCut> scList = GetShortCutsGroup(k); //--> raccolta lista shortcut associati alla combinazione di tasti attuale if (scList != null && scList.Count > 0) //Se trovato almeno uno shortcut - { if (scList.Find(x => x.IsNavigator) != null) //Se combinazione di tasti corrispondente a Skin Navigator Navigation(); //--> gestione navigazione alla destinazione selezionata else //Shortcuts normali @@ -776,7 +784,6 @@ lastDestination.LoadParameter = scList[scIndex].LoadParameter; //--> memorizzazione parametri di caricamento utilizzati } } - } else //Combinazione di tasti non corrispondente a nessuno shortcut if (Log != null) Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "Key not mapped: " + k.ToString())); @@ -794,10 +801,13 @@ #endregion #region Proprietà - public bool Initialized { get { return this._initialized; } } - public LockKeys.LockKeyActions GeneralForcingCapsLock { get { return this._general.ForcingCapsLock; } set { this._general.ForcingCapsLock = value; } } - public LockKeys.LockKeyActions GeneralForcingNumLock { get { return this._general.ForcingNumLock; } set { this._general.ForcingNumLock = value; } } - public BindingList<ShortCut> Items { get { return this._items; } } + public bool Initialized { get { return this._initialized; } } + + public GeneralSettings General { get { return this._general; } set { this._general = value; } } + + //public LockKeys.LockKeyActions GeneralForcingCapsLock { get { return this._general.ForcingCapsLock; } set { this._general.ForcingCapsLock = value; } } + //public LockKeys.LockKeyActions GeneralForcingNumLock { get { return this._general.ForcingNumLock; } set { this._general.ForcingNumLock = value; } } + public BindingList<ShortCut> Items { get { return this._items; } } #endregion } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-05-08 15:04:19
|
Revision: 4799 http://sourceforge.net/p/mp-plugins/code/4799 Author: nicsergio Date: 2014-05-08 15:04:15 +0000 (Thu, 08 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-07 19:58:53 UTC (rev 4798) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-08 15:04:15 UTC (rev 4799) @@ -21,7 +21,7 @@ { #region Dati private LogLevels _logLevel; //Livello di log - private string _logMessage; //Messaggio di log + private string _logMessage; //Messaggio di log private Exception _logException; //Eventuale eccezione public enum LogLevels //Tipologie di livelli di log @@ -43,8 +43,8 @@ #endregion #region Proprietà - public LogLevels LogLevel { get { return this._logLevel; } } - public string LogMessage { get { return this._logMessage; } } + public LogLevels LogLevel { get { return this._logLevel; } } + public string LogMessage { get { return this._logMessage; } } public Exception LogException { get { return this._logException; } } #endregion } @@ -68,13 +68,13 @@ { if (skinNavigator) //Se richiesta destinazione corrispondente a Skin Navigator { - _caption = "Skin Navigator"; //--> titolo Skin Navigator - _windowID = NavigatorID; //--> Id finestra virtuale per attivazione Skin Navigator + _caption = "Skin Navigator"; //--> titolo Skin Navigator + _windowID = NavigatorID; //--> Id finestra virtuale per attivazione Skin Navigator } else { - _caption = "Link"; //--> inizializzazione titolo - _windowID = 0; //--> inizializzazione Id finestra + _caption = "Link"; //--> inizializzazione titolo + _windowID = 0; //--> inizializzazione Id finestra } _loadParameter = ""; //--> inizializzazione parametri di caricamento per visualizzazione } @@ -86,7 +86,7 @@ { if (_caption.Length > 0 && Log != null) Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "Go to link destination, " + this.ToString())); - + try { GUIGraphicsContext.ResetLastActivity(); @@ -112,7 +112,7 @@ break; } else - break; + break; } if (loadParameterChange && Log != null) Log(this, new LogEventArgs(LogEventArgs.LogLevels.Debug, "GUIProperties replaced, LoadParameter=[" + loadParameter + "]")); @@ -133,7 +133,7 @@ } catch (Exception e) { - if (Log != null) + if (Log != null) Log(this, new LogEventArgs(LogEventArgs.LogLevels.Error, "Error going to window", e)); return false; //--> comando non completato } @@ -160,8 +160,8 @@ public WindowLink Clone() //Clonazione collegamento { WindowLink lnk = new WindowLink(); - lnk.Caption = _caption; - lnk.WindowID = _windowID; + lnk.Caption = _caption; + lnk.WindowID = _windowID; lnk.LoadParameter = _loadParameter; return lnk; } @@ -177,20 +177,20 @@ #endregion #region Proprietà - public bool IsValid { get { return (this._windowID > InvalidID || this.IsNavigator) ; } } - public bool IsNavigator { get { return (this._windowID == NavigatorID); } } - public string Caption { get { return this._caption; } set { this._caption = value; } } - public int WindowID { get { return this._windowID; } set { this._windowID = value; } } - public string LoadParameter { get { return this._loadParameter; } set { this._loadParameter = value; } } - #endregion + public bool IsValid { get { return (this._windowID > InvalidID || this.IsNavigator); } } + public bool IsNavigator { get { return (this._windowID == NavigatorID); } } + public string Caption { get { return this._caption; } set { this._caption = value; } } + public int WindowID { get { return this._windowID; } set { this._windowID = value; } } + public string LoadParameter { get { return this._loadParameter; } set { this._loadParameter = value; } } + #endregion } internal class KeyCombination //Classe combinazione di tasti { #region Dati private string _key; //Tasto (stringa corrispondente a KeyCode) - private bool _ctrl; //Utilizzo del modificatore "Ctrl" - combinazione di tasti - private bool _alt; //Utilizzo del modificatore "Alt" - combinazione di tasti - private bool _shift; //Utilizzo del modificatore "Shift" - combinazione di tasti + private bool _ctrl; //Utilizzo del modificatore "Ctrl" - combinazione di tasti + private bool _alt; //Utilizzo del modificatore "Alt" - combinazione di tasti + private bool _shift; //Utilizzo del modificatore "Shift" - combinazione di tasti private static readonly List<Keys> ModifierKeys = new List<Keys>(); //Lista dei tasti modificatori #endregion @@ -210,20 +210,20 @@ } public KeyCombination() //Costruttore classe KeyCombination { - _key = "A"; //--> inizializzazione tasto - _ctrl = true; //--> inizializzazione utilizzo del modificatore "Ctrl" - _alt = false; //--> inizializzazione utilizzo del modificatore "Alt" + _key = "A"; //--> inizializzazione tasto + _ctrl = true; //--> inizializzazione utilizzo del modificatore "Ctrl" + _alt = false; //--> inizializzazione utilizzo del modificatore "Alt" _shift = true; //--> inizializzazione utilizzo del modificatore "Shift" } public KeyCombination(KeyEventArgs k) //Costruttore classe KeyCombination da evento di pressione tasto { - _key = k.KeyCode.ToString(); //--> assegnazione tasto - _ctrl = k.Control; //--> utilizzo del modificatore "Ctrl" - _alt = k.Alt; //--> utilizzo del modificatore "Alt" + _key = k.KeyCode.ToString(); //--> assegnazione tasto + _ctrl = k.Control; //--> utilizzo del modificatore "Ctrl" + _alt = k.Alt; //--> utilizzo del modificatore "Alt" _shift = k.Shift; //--> utilizzo del modificatore "Shift" } #endregion - + #region Metodi Pubblici public static bool IsModifier(Keys key) //Verifica se un tasto corrisponde ad un modificatore { @@ -237,7 +237,7 @@ #region Proprietà public bool IsValid - { + { get { KeysConverter kc = new KeysConverter(); @@ -247,32 +247,32 @@ return (key != Keys.None && !ModifierKeys.Contains(key)); //--> verifica se la stringa corrisponde ad un tasto e che il tasto non sia un modificatore } } - public string Key { get { return this._key; } set { this._key = value; } } - public bool Ctrl { get { return this._ctrl; } set { this._ctrl = value; } } - public bool Alt { get { return this._alt; } set { this._alt = value; } } + public string Key { get { return this._key; } set { this._key = value; } } + public bool Ctrl { get { return this._ctrl; } set { this._ctrl = value; } } + public bool Alt { get { return this._alt; } set { this._alt = value; } } public bool Shift { get { return this._shift; } set { this._shift = value; } } - #endregion + #endregion } internal class ShortCut : INotifyPropertyChanged //Classe shortcut (scorciatoia da tastiera) con notifica variazione proprietà per binding su GridView { #region Dati - private string _caption; //Titolo link + private string _caption; //Titolo link private KeyCombination _keys; //Combinazione di tasti per attivazione shortcut - private WindowLink _destination; //Destinazione dello shortcut - private bool _return; //Ritorno a finestra precedente se si è già a destinazione - private string _soundEffect; //File relativo all'eventuale effetto sonoro + private WindowLink _destination; //Destinazione dello shortcut + private bool _return; //Ritorno a finestra precedente se si è già a destinazione + private string _soundEffect; //File relativo all'eventuale effetto sonoro #endregion #region Costruttore public ShortCut() : this(false) { } //Costruttore classe ShortCut (senza argomenti) public ShortCut(bool skinNavigator) //Costruttore classe ShortCut { - _caption = (skinNavigator ? "Skin Navigator" : "ShortCut"); //--> inizializzazione titolo - _keys = new KeyCombination(); //--> istanziazione classe KeyCombination - _destination = new WindowLink(skinNavigator); //--> istanziazione classe WindowLink + _caption = (skinNavigator ? "Skin Navigator" : "ShortCut"); //--> inizializzazione titolo + _keys = new KeyCombination(); //--> istanziazione classe KeyCombination + _destination = new WindowLink(skinNavigator); //--> istanziazione classe WindowLink _destination.Caption = ""; //--> reset caption destinazione (gestita caption shortcut) - _return = false; //--> inizializzazione ritorno a finestra precedente se si è già a destinazione - _soundEffect = "click.wav"; //--> inizializzazione effetto sonoro + _return = false; //--> inizializzazione ritorno a finestra precedente se si è già a destinazione + _soundEffect = "click.wav"; //--> inizializzazione effetto sonoro } #endregion @@ -290,13 +290,13 @@ { if (_caption.Length > 0 && Log != null) Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "Go to shortcut destination, " + this.ToString())); - + try { if (_soundEffect.Length > 0 && !g_Player.Playing) Utils.PlaySound(_soundEffect, false, true); //--> eventuale effetto sonoro } - catch { } + catch { } return _destination.Go(Log); //--> visualizzazione finestra di destinazione } @@ -311,22 +311,22 @@ if (_soundEffect.Length > 0 && !g_Player.Playing) Utils.PlaySound("back.wav", false, true); //--> eventuale effetto sonoro } - catch { } + catch { } return _destination.GoPrevious(Log); //--> visualizzazione finestra precedente } public ShortCut Clone() //Clonazione shortcut { ShortCut sc = new ShortCut(); - sc.Caption = _caption; - sc.Key = _keys.Key; - sc.Ctrl = _keys.Ctrl; - sc.Alt = _keys.Alt; - sc.Shift = _keys.Shift; - sc.WindowID = _destination.WindowID; + sc.Caption = _caption; + sc.Key = _keys.Key; + sc.Ctrl = _keys.Ctrl; + sc.Alt = _keys.Alt; + sc.Shift = _keys.Shift; + sc.WindowID = _destination.WindowID; sc.LoadParameter = _destination.LoadParameter; - sc.Return = _return; - sc.SoundEffect = _soundEffect; + sc.Return = _return; + sc.SoundEffect = _soundEffect; return sc; } public override string ToString() //Override metodo ToString per stampare le proprietà dello shortcut @@ -340,17 +340,17 @@ #endregion #region Proprietà - public bool IsValid { get { return this._destination.IsValid && this._keys.IsValid; } } - public bool IsNavigator { get { return this._destination.IsNavigator; } } - public string Caption { get { return this._caption; } set { this._caption = value; this.NotifyPropertyChanged("Caption"); } } - public string Key { get { return this._keys.Key; } set { this._keys.Key = value; this.NotifyPropertyChanged("Key"); } } - public bool Ctrl { get { return this._keys.Ctrl; } set { this._keys.Ctrl = value; this.NotifyPropertyChanged("Ctrl"); } } - public bool Alt { get { return this._keys.Alt; } set { this._keys.Alt = value; this.NotifyPropertyChanged("Alt"); } } - public bool Shift { get { return this._keys.Shift; } set { this._keys.Shift = value; this.NotifyPropertyChanged("Shift"); } } - public int WindowID { get { return this._destination.WindowID; } set { this._destination.WindowID = value; this.NotifyPropertyChanged("WindowID"); } } + public bool IsValid { get { return this._destination.IsValid && this._keys.IsValid; } } + public bool IsNavigator { get { return this._destination.IsNavigator; } } + public string Caption { get { return this._caption; } set { this._caption = value; this.NotifyPropertyChanged("Caption"); } } + public string Key { get { return this._keys.Key; } set { this._keys.Key = value; this.NotifyPropertyChanged("Key"); } } + public bool Ctrl { get { return this._keys.Ctrl; } set { this._keys.Ctrl = value; this.NotifyPropertyChanged("Ctrl"); } } + public bool Alt { get { return this._keys.Alt; } set { this._keys.Alt = value; this.NotifyPropertyChanged("Alt"); } } + public bool Shift { get { return this._keys.Shift; } set { this._keys.Shift = value; this.NotifyPropertyChanged("Shift"); } } + public int WindowID { get { return this._destination.WindowID; } set { this._destination.WindowID = value; this.NotifyPropertyChanged("WindowID"); } } public string LoadParameter { get { return this._destination.LoadParameter; } set { this._destination.LoadParameter = value; this.NotifyPropertyChanged("LoadParameter"); } } - public bool Return { get { return this._return; } set { this._return = value; this.NotifyPropertyChanged("Return"); } } - public string SoundEffect { get { return this._soundEffect; } set { this._soundEffect = value; this.NotifyPropertyChanged("SoundEffect"); } } + public bool Return { get { return this._return; } set { this._return = value; this.NotifyPropertyChanged("Return"); } } + public string SoundEffect { get { return this._soundEffect; } set { this._soundEffect = value; this.NotifyPropertyChanged("SoundEffect"); } } #endregion } @@ -358,41 +358,41 @@ { #region Dati private string _caption; //Titolo finestra - private int _windowID; //Id finestra + private int _windowID; //Id finestra private string _xmlFile; //Nome del file xml corrispondente #endregion #region Costruttore public Window() //Costruttore classe Window { - _caption = ""; //--> inizializzazione titolo + _caption = ""; //--> inizializzazione titolo _windowID = 0; //--> inizializzazione Id finestra - _xmlFile = ""; //--> inizializzazione nome file xml + _xmlFile = ""; //--> inizializzazione nome file xml } #endregion #region Metodi Pubblici public override string ToString() { return (_caption); } //Override metodo ToString per riempire classi ListControl #endregion - + #region Proprietà - public string Caption { get { return this._caption; } set { this._caption = value; } } - public int WindowID { get { return this._windowID; } set { this._windowID = value; } } - public string XmlFile { get { return this._xmlFile; } set { this._xmlFile = value; } } - #endregion + public string Caption { get { return this._caption; } set { this._caption = value; } } + public int WindowID { get { return this._windowID; } set { this._windowID = value; } } + public string XmlFile { get { return this._xmlFile; } set { this._xmlFile = value; } } + #endregion } internal class NavItem //Classe elemento per navigazione { #region Dati - private string _caption; //Titolo link - private BindingList<Window> _windows = new BindingList<Window>(); + private string _caption; //Titolo link + private BindingList<Window> _windows = new BindingList<Window>(); private BindingList<WindowLink> _destinations = new BindingList<WindowLink>(); #endregion #region Costruttore public NavItem() //Costruttore classe Window { - _caption = "Navigator Group"; //--> inizializzazione titolo + _caption = "Navigator Group"; //--> inizializzazione titolo } #endregion @@ -414,52 +414,52 @@ #endregion #region Dati - private readonly string SettingsFile; //File di salvataggio impostazioni - private GeneralSettings _general = new GeneralSettings(); //Impostazioni generali plugin - private BindingList<ShortCut> _items = new BindingList<ShortCut>(); //Lista (con associazione dati) degli shortcuts configurati - private BindingList<NavItem> _navItems = new BindingList<NavItem>(); - private bool _initialized; //Classe inizializzata + private readonly string SettingsFile; //File di salvataggio impostazioni + private GeneralSettings _general = new GeneralSettings(); //Impostazioni generali plugin + private BindingList<ShortCut> _items = new BindingList<ShortCut>(); //Lista (con associazione dati) degli shortcuts configurati + private BindingList<NavItem> _navItems = new BindingList<NavItem>(); + private bool _initialized; //Classe inizializzata - private WindowLink lastDestination = new WindowLink(); //Dati ultima destinazione attivata dal plugin + private WindowLink lastDestination = new WindowLink(); //Dati ultima destinazione attivata dal plugin #endregion #region Costruttore public ShortCuts(string settingsFile) //Costruttore classe ShortCuts { - SettingsFile = settingsFile; //--> percorso & nome file delle impostazioni + SettingsFile = settingsFile; //--> percorso & nome file delle impostazioni _general.ForcingCapsLock = LockKeys.LockKeyActions.None; //--> default: nessuna modifica stato Caps-Lock - _general.ForcingNumLock = LockKeys.LockKeyActions.None; //--> default: nessuna modifica stato Num-Lock - _initialized = false; //--> reset classe inizializzata - lastDestination.Caption = "Last destination"; //--> titolo ultima destinazione + _general.ForcingNumLock = LockKeys.LockKeyActions.None; //--> default: nessuna modifica stato Num-Lock + _initialized = false; //--> reset classe inizializzata + lastDestination.Caption = "Last destination"; //--> titolo ultima destinazione lastDestination.Reset(); //--> reset ultima destinazione attivata dal plugin } #endregion - + #region Metodi Privati private bool LoadDeprecatedConfig() //Caricamento configurazione obsoleta { using (Settings confReader = new Settings(SettingsFile)) { const string sectionName = "ShortCuterForm"; - const string capPrefix = "Titel"; - const string keyPrefix = "Key"; - const string widPrefix = "ID"; + const string capPrefix = "Titel"; + const string keyPrefix = "Key"; + const string widPrefix = "ID"; if (!confReader.HasSection<string>(sectionName)) return false; //--> se sezione non presente: il file non corrisponde - bool ctrl = confReader.GetValueAsBool(sectionName, "ModCtrl", false); //--> utilizzo del modificatore ctrl per tutti gli shortcut + bool ctrl = confReader.GetValueAsBool(sectionName, "ModCtrl", false); //--> utilizzo del modificatore ctrl per tutti gli shortcut bool shift = confReader.GetValueAsBool(sectionName, "ModShift", false); //--> utilizzo del modificatore shift per tutti gli shortcut for (int i = 1; i <= 20; i++) //Iterazione di lettura shortcut { ShortCut sc = new ShortCut(); - sc.Caption = confReader.GetValueAsString(sectionName, capPrefix + string.Format("{0:00}", i), ""); - sc.Key = confReader.GetValueAsString(sectionName, keyPrefix + string.Format("{0:00}", i), "").ToUpper(); - sc.WindowID = confReader.GetValueAsInt(sectionName, widPrefix + string.Format("{0:00}", i), -1); - sc.Ctrl = ctrl; - sc.Alt = false; - sc.Shift = shift; + sc.Caption = confReader.GetValueAsString(sectionName, capPrefix + string.Format("{0:00}", i), ""); + sc.Key = confReader.GetValueAsString(sectionName, keyPrefix + string.Format("{0:00}", i), "").ToUpper(); + sc.WindowID = confReader.GetValueAsInt(sectionName, widPrefix + string.Format("{0:00}", i), -1); + sc.Ctrl = ctrl; + sc.Alt = false; + sc.Shift = shift; if (sc.IsValid) //Se shortcut valido _items.Add(sc); //--> aggiunta dello shortcut nella lista } @@ -468,7 +468,7 @@ } private List<ShortCut> GetShortCutsGroup(KeyCombination k) //Raccolta lista shortcut associati alla combinazione di tasti { - return _items.ToList().FindAll(x => x.Key == k.Key && x.Ctrl == k.Ctrl && x.Alt == k.Alt && x.Shift == k.Shift); + return _items.ToList().FindAll(x => x.Key == k.Key && x.Ctrl == k.Ctrl && x.Alt == k.Alt && x.Shift == k.Shift); } private bool AlreadyAtDestination(ShortCut sc) //Verifica se finestra attuale corrispondente a destinazione shortcut { @@ -498,7 +498,7 @@ else return false; //--> finestra attuale non corrispondente a destinazione shortcut } - private bool Navigation() + private void Navigation() //Gestione finestra di dialogo e navigazione alla destinazione selezionata { if (Log != null) Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "Request Skin Navigator dialog menu")); @@ -535,34 +535,31 @@ { dlgMenu.DoModal(actWindowID); if (dlgMenu.SelectedLabel >= 0 && dlgMenu.SelectedLabel < dlgLinks.Count) - return dlgLinks[dlgMenu.SelectedLabel].Go(Log); - else - { - if (Log != null) - Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "No links selected from Skin Navigator dialog menu, ID = " + actWindowID)); - return false; - } + if (dlgLinks[dlgMenu.SelectedLabel].Go(Log)) + { + lastDestination.WindowID = dlgLinks[dlgMenu.SelectedLabel].WindowID; + lastDestination.LoadParameter = dlgLinks[dlgMenu.SelectedLabel].LoadParameter; + } + else + if (Log != null) + Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "No links selected from Skin Navigator dialog menu, ID = " + actWindowID)); } else - { if (Log != null) Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "No links found for Skin Navigator, window ID = " + actWindowID)); - return false; - } } catch (Exception e) { if (Log != null) Log(this, new LogEventArgs(LogEventArgs.LogLevels.Error, "Error opening Skin Navigator dialog menu", e)); - return false; } } #endregion #region Metodi Pubblici public bool Initialize() //Inizializzazione - { - _initialized = LoadConfig(false); //--> caricamento configurazione (standard) shortcuts + { + _initialized = LoadConfig(false); //--> caricamento configurazione (standard) shortcuts if (!_initialized) { if (Log != null) @@ -576,7 +573,7 @@ } } return _initialized; - } + } public bool LoadConfig(bool defaultSettings) //Caricamento configurazione { _items.Clear(); //--> pulizia lista shortcuts @@ -617,7 +614,7 @@ innerNode = generalNode.SelectSingleNode("ResetNumLock"); //Necessario per compatibilità con file di configurazione V2.0.5.0 if (innerNode != null && Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText))) _general.ForcingNumLock = LockKeys.LockKeyActions.Off; - } + } } XmlNodeList nodeList = xmlFile.DocumentElement.SelectNodes("/ShortCuter/Items/Item"); foreach (XmlNode node in nodeList) //Iterazione per memorizzazione impostazioni shortcuts @@ -702,27 +699,27 @@ xmlSettings.WriteStartDocument(); xmlSettings.WriteStartElement("ShortCuter"); - xmlSettings.WriteStartElement("General"); - xmlSettings.WriteElementString("ForcingCapsLock", _general.ForcingCapsLock.ToString()); - xmlSettings.WriteElementString("ForcingNumLock", _general.ForcingNumLock.ToString()); + xmlSettings.WriteStartElement("General"); + xmlSettings.WriteElementString("ForcingCapsLock", _general.ForcingCapsLock.ToString()); + xmlSettings.WriteElementString("ForcingNumLock", _general.ForcingNumLock.ToString()); + xmlSettings.WriteEndElement(); + xmlSettings.WriteStartElement("Items"); + foreach (ShortCut sc in _items) //Iterazione per salvataggio sortcuts + { + xmlSettings.WriteStartElement("Item"); + xmlSettings.WriteElementString("Caption", sc.Caption); + xmlSettings.WriteElementString("Key", sc.Key); + xmlSettings.WriteElementString("Ctrl", Convert.ToInt16(sc.Ctrl).ToString()); + xmlSettings.WriteElementString("Alt", Convert.ToInt16(sc.Alt).ToString()); + xmlSettings.WriteElementString("Shift", Convert.ToInt16(sc.Shift).ToString()); + xmlSettings.WriteElementString("WindowID", sc.WindowID.ToString()); + xmlSettings.WriteElementString("LoadParameter", sc.LoadParameter); + xmlSettings.WriteElementString("Return", Convert.ToInt16(sc.Return).ToString()); + xmlSettings.WriteElementString("SoundEffect", sc.SoundEffect); xmlSettings.WriteEndElement(); - xmlSettings.WriteStartElement("Items"); - foreach (ShortCut sc in _items) //Iterazione per salvataggio sortcuts - { - xmlSettings.WriteStartElement("Item"); - xmlSettings.WriteElementString("Caption", sc.Caption); - xmlSettings.WriteElementString("Key", sc.Key); - xmlSettings.WriteElementString("Ctrl", Convert.ToInt16(sc.Ctrl).ToString()); - xmlSettings.WriteElementString("Alt", Convert.ToInt16(sc.Alt).ToString()); - xmlSettings.WriteElementString("Shift", Convert.ToInt16(sc.Shift).ToString()); - xmlSettings.WriteElementString("WindowID", sc.WindowID.ToString()); - xmlSettings.WriteElementString("LoadParameter", sc.LoadParameter); - xmlSettings.WriteElementString("Return", Convert.ToInt16(sc.Return).ToString()); - xmlSettings.WriteElementString("SoundEffect", sc.SoundEffect); - xmlSettings.WriteEndElement(); - } - xmlSettings.WriteEndElement(); + } xmlSettings.WriteEndElement(); + xmlSettings.WriteEndElement(); xmlSettings.Flush(); xmlSettings.Close(); @@ -735,7 +732,7 @@ } finally { - if (xmlSettings != null) + if (xmlSettings != null) xmlSettings.Close(); //--> eventuale chiusura oggetto XmlWriter } if (Log != null) @@ -751,63 +748,9 @@ if (scList != null && scList.Count > 0) //Se trovato almeno uno shortcut { if (scList.Find(x => x.IsNavigator) != null) //Se combinazione di tasti corrispondente a Skin Navigator - { - if (Log != null) - Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "Request Skin Navigator dialog menu")); - - try - { - int actWindowID = (int)GUIWindowManager.ActiveWindow; - GUIDialogMenu dlgMenu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); - dlgMenu.Reset(); - dlgMenu.SetHeading("Skin Navigator"); - dlgMenu.ShowQuickNumbers = false; - - List<WindowLink> dlgLinks = new List<WindowLink>(); - foreach (NavItem item in _navItems) //Iterazione per memorizzazione impostazioni shortcuts - { - if ((item.Windows.First(x => x.WindowID == actWindowID)) != null || item.Windows.Count == 0) - { - bool first = true; - foreach (WindowLink link in item.Destinations) //Iterazione per memorizzazione impostazioni shortcuts - { - if (first && dlgLinks.Count > 0) - { - dlgMenu.Add("---- ----"); - dlgLinks.Add(null); - first = false; - } - dlgMenu.Add(link.Caption); - dlgLinks.Add(link); - } - } - } - - if (dlgLinks.Count > 0) - { - dlgMenu.DoModal(actWindowID); - if (dlgMenu.SelectedLabel >= 0 && dlgMenu.SelectedLabel < dlgLinks.Count) - dlgLinks[dlgMenu.SelectedLabel].Go(Log); - else - if (Log != null) - Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "No links selected from Skin Navigator dialog menu, ID = " + actWindowID)); - } - else - if (Log != null) - Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "No links found for Skin Navigator, window ID = " + actWindowID)); - } - catch (Exception e) - { - if (Log != null) - Log(this, new LogEventArgs(LogEventArgs.LogLevels.Error, "Error opening Skin Navigator dialog menu", e)); - } - - - } + Navigation(); //--> gestione navigazione alla destinazione selezionata else //Shortcuts normali - { if (scList.Count == 1) //Shortcut a destinazione singola - { if (scList[0].Return && AlreadyAtDestination(scList[0])) //Se impostato flag di ritorno e finestra attuale corrispondente a destinazione scList[0].GoPrevious(Log); //--> visualizzazione finestra precedente else @@ -816,7 +759,6 @@ lastDestination.WindowID = scList[0].WindowID; //--> memorizzazione id finestra lastDestination.LoadParameter = scList[0].LoadParameter; //--> memorizzazione parametri di caricamento utilizzati } - } else //Shortcut a destinazione multipla (ciclico) { int scIndex = 0; @@ -834,7 +776,6 @@ lastDestination.LoadParameter = scList[scIndex].LoadParameter; //--> memorizzazione parametri di caricamento utilizzati } } - } } else //Combinazione di tasti non corrispondente a nessuno shortcut if (Log != null) @@ -853,10 +794,10 @@ #endregion #region Proprietà - public bool Initialized { get { return this._initialized; } } - public LockKeys.LockKeyActions GeneralForcingCapsLock { get { return this._general.ForcingCapsLock; } set { this._general.ForcingCapsLock = value; } } - public LockKeys.LockKeyActions GeneralForcingNumLock { get { return this._general.ForcingNumLock; } set { this._general.ForcingNumLock = value; } } - public BindingList<ShortCut> Items { get { return this._items; } } + public bool Initialized { get { return this._initialized; } } + public LockKeys.LockKeyActions GeneralForcingCapsLock { get { return this._general.ForcingCapsLock; } set { this._general.ForcingCapsLock = value; } } + public LockKeys.LockKeyActions GeneralForcingNumLock { get { return this._general.ForcingNumLock; } set { this._general.ForcingNumLock = value; } } + public BindingList<ShortCut> Items { get { return this._items; } } #endregion - } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-05-07 19:58:56
|
Revision: 4798 http://sourceforge.net/p/mp-plugins/code/4798 Author: nicsergio Date: 2014-05-07 19:58:53 +0000 (Wed, 07 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/Common/VersionInfo.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Modified: trunk/plugins/ShortCuter&SkinEditor/Source/Common/VersionInfo.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/Common/VersionInfo.cs 2014-05-06 21:54:35 UTC (rev 4797) +++ trunk/plugins/ShortCuter&SkinEditor/Source/Common/VersionInfo.cs 2014-05-07 19:58:53 UTC (rev 4798) @@ -4,7 +4,6 @@ using System.Drawing.Drawing2D; using System.Windows.Forms; - namespace My.Common { internal partial class VersionInfo : Form //Form di visualizzazione informazioni sulla versione Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-06 21:54:35 UTC (rev 4797) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-07 19:58:53 UTC (rev 4798) @@ -498,19 +498,65 @@ else return false; //--> finestra attuale non corrispondente a destinazione shortcut } - private void UpdateLastDestination(ShortCut sc) + private bool Navigation() { - lastDestination.WindowID = sc.WindowID; //--> memorizzazione id finestra - lastDestination.LoadParameter = sc.LoadParameter; //--> memorizzazione parametri di caricamento utilizzati - } + if (Log != null) + Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "Request Skin Navigator dialog menu")); + try + { + int actWindowID = (int)GUIWindowManager.ActiveWindow; + GUIDialogMenu dlgMenu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); + dlgMenu.Reset(); + dlgMenu.SetHeading("Skin Navigator"); + dlgMenu.ShowQuickNumbers = false; - private void UpdateLastDestination(WindowLink lnk) - { - lastDestination.WindowID = lnk.WindowID; //--> memorizzazione id finestra - lastDestination.LoadParameter = lnk.LoadParameter; //--> memorizzazione parametri di caricamento utilizzati + List<WindowLink> dlgLinks = new List<WindowLink>(); + foreach (NavItem item in _navItems) //Iterazione per memorizzazione impostazioni shortcuts + { + if ((item.Windows.First(x => x.WindowID == actWindowID)) != null || item.Windows.Count == 0) + { + bool first = true; + foreach (WindowLink link in item.Destinations) //Iterazione per memorizzazione impostazioni shortcuts + { + if (first && dlgLinks.Count > 0) + { + dlgMenu.Add("---- ----"); + dlgLinks.Add(null); + first = false; + } + dlgMenu.Add(link.Caption); + dlgLinks.Add(link); + } + } + } + + if (dlgLinks.Count > 0) + { + dlgMenu.DoModal(actWindowID); + if (dlgMenu.SelectedLabel >= 0 && dlgMenu.SelectedLabel < dlgLinks.Count) + return dlgLinks[dlgMenu.SelectedLabel].Go(Log); + else + { + if (Log != null) + Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "No links selected from Skin Navigator dialog menu, ID = " + actWindowID)); + return false; + } + } + else + { + if (Log != null) + Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "No links found for Skin Navigator, window ID = " + actWindowID)); + return false; + } + } + catch (Exception e) + { + if (Log != null) + Log(this, new LogEventArgs(LogEventArgs.LogLevels.Error, "Error opening Skin Navigator dialog menu", e)); + return false; + } } - #endregion #region Metodi Pubblici @@ -766,7 +812,10 @@ scList[0].GoPrevious(Log); //--> visualizzazione finestra precedente else if (scList[0].Go(Log)) //--> visualizzazione finestra di destinazione shortcut - lastDestination.Get(scList[0].); //--> memorizzazione destinazione + { + lastDestination.WindowID = scList[0].WindowID; //--> memorizzazione id finestra + lastDestination.LoadParameter = scList[0].LoadParameter; //--> memorizzazione parametri di caricamento utilizzati + } } else //Shortcut a destinazione multipla (ciclico) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-05-06 21:54:38
|
Revision: 4797 http://sourceforge.net/p/mp-plugins/code/4797 Author: nicsergio Date: 2014-05-06 21:54:35 +0000 (Tue, 06 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Properties/AssemblyInfo.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Properties/AssemblyInfo.cs 2014-05-04 20:12:54 UTC (rev 4796) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Properties/AssemblyInfo.cs 2014-05-06 21:54:35 UTC (rev 4797) @@ -33,8 +33,8 @@ // È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build // utilizzando l'asterisco (*) come descritto di seguito: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.0.6.0")] -[assembly: AssemblyFileVersion("2.0.6.0")] +[assembly: AssemblyVersion("2.1.0.0")] +[assembly: AssemblyFileVersion("2.1.0.0")] //Importante per la compatibilità con MediaPortal [assembly: CompatibleVersion("1.1.6.27644")] \ No newline at end of file Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2014-05-04 20:12:54 UTC (rev 4796) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2014-05-06 21:54:35 UTC (rev 4797) @@ -6,7 +6,7 @@ <ProductVersion>8.0.30703</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{20CEBE32-A39E-4A61-B2BD-90BF16E2AEE8}</ProjectGuid> - <OutputType>WinExe</OutputType> + <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>ProcessPlugins.ShortCuter</RootNamespace> <AssemblyName>ShortCuter</AssemblyName> Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs 2014-05-04 20:12:54 UTC (rev 4796) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs 2014-05-06 21:54:35 UTC (rev 4797) @@ -47,8 +47,8 @@ toolTip.SetToolTip(resetButton, "Reset actual settings and load the default configuration"); toolTip.SetToolTip(saveButton, "Save actual settings"); toolTip.SetToolTip(updateButton, "Save actual setting and close the application"); - toolTip.SetToolTip(capsLockComboBox, "Set forcing for Caps-Lock when Mediaportal starts (OFF is recommended)"); - toolTip.SetToolTip(numLockComboBox, "Set forcing for Num-Lock when Mediaportal starts"); + toolTip.SetToolTip(capsLockComboBox, "Set forcing for Caps-Lock when MediaPortal starts (OFF is recommended)"); + toolTip.SetToolTip(numLockComboBox, "Set forcing for Num-Lock when MediaPortal starts"); toolTip.SetToolTip(skinNavConfigButton, "Configure Skin Navigator"); toolTip.SetToolTip(infoPictureBox, "Version information"); @@ -108,7 +108,7 @@ windowIdColumn.Width = 70; windowIdColumn.MaxInputLength = 10; windowIdColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; - windowIdColumn.ToolTipText = "MediaPorta window ID for the shortcut's destination"; + windowIdColumn.ToolTipText = "MediaPortal window ID for the shortcut's destination"; DataGridViewTextBoxColumn loadParameterColumn = new DataGridViewTextBoxColumn(); loadParameterColumn.DataPropertyName = "LoadParameter"; @@ -390,8 +390,7 @@ myShortCuts.Items.Add(sc); shortCutsDataGridView.CurrentCell = shortCutsDataGridView[0, shortCutsDataGridView.RowCount - 1]; shortCutsDataGridView.Rows[shortCutsDataGridView.RowCount - 1].Selected = true; - skinNavAddButton.Enabled = false; - } + } private void rowUpButton_Click(object sender, EventArgs e) { MoveItemList(true); Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-04 20:12:54 UTC (rev 4796) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-06 21:54:35 UTC (rev 4797) @@ -157,6 +157,14 @@ return false; //--> comando non completato } } + public WindowLink Clone() //Clonazione collegamento + { + WindowLink lnk = new WindowLink(); + lnk.Caption = _caption; + lnk.WindowID = _windowID; + lnk.LoadParameter = _loadParameter; + return lnk; + } public void Reset() //Reset destinazione (invalidazione) { _windowID = InvalidID; //--> invalidazione Id finestra @@ -245,7 +253,7 @@ public bool Shift { get { return this._shift; } set { this._shift = value; } } #endregion } - internal class ShortCut : INotifyPropertyChanged //Classe shortcut (scorciatoia da tastiera) con notifica variazione proprietà + internal class ShortCut : INotifyPropertyChanged //Classe shortcut (scorciatoia da tastiera) con notifica variazione proprietà per binding su GridView { #region Dati private string _caption; //Titolo link @@ -345,6 +353,7 @@ public string SoundEffect { get { return this._soundEffect; } set { this._soundEffect = value; this.NotifyPropertyChanged("SoundEffect"); } } #endregion } + internal class Window //Classe finestra di MediaPortal { #region Dati @@ -372,7 +381,7 @@ public string XmlFile { get { return this._xmlFile; } set { this._xmlFile = value; } } #endregion } - internal class NavigatorItem //Classe elemento per navigazione + internal class NavItem //Classe elemento per navigazione { #region Dati private string _caption; //Titolo link @@ -381,13 +390,17 @@ #endregion #region Costruttore - public NavigatorItem() //Costruttore classe Window + public NavItem() //Costruttore classe Window { _caption = "Navigator Group"; //--> inizializzazione titolo } #endregion - + #region Proprietà + public string Caption { get { return this._caption; } set { this._caption = value; } } + public BindingList<Window> Windows { get { return this._windows; } } + public BindingList<WindowLink> Destinations { get { return this._destinations; } } + #endregion } internal class ShortCuts //Classe di gestione degli shortcuts configurati @@ -403,7 +416,8 @@ #region Dati private readonly string SettingsFile; //File di salvataggio impostazioni private GeneralSettings _general = new GeneralSettings(); //Impostazioni generali plugin - private BindingList<ShortCut> _items = new BindingList<ShortCut>(); //Lista (con associazione dati) degli shortcuts configurati + private BindingList<ShortCut> _items = new BindingList<ShortCut>(); //Lista (con associazione dati) degli shortcuts configurati + private BindingList<NavItem> _navItems = new BindingList<NavItem>(); private bool _initialized; //Classe inizializzata private WindowLink lastDestination = new WindowLink(); //Dati ultima destinazione attivata dal plugin @@ -484,6 +498,19 @@ else return false; //--> finestra attuale non corrispondente a destinazione shortcut } + private void UpdateLastDestination(ShortCut sc) + { + lastDestination.WindowID = sc.WindowID; //--> memorizzazione id finestra + lastDestination.LoadParameter = sc.LoadParameter; //--> memorizzazione parametri di caricamento utilizzati + } + + + private void UpdateLastDestination(WindowLink lnk) + { + lastDestination.WindowID = lnk.WindowID; //--> memorizzazione id finestra + lastDestination.LoadParameter = lnk.LoadParameter; //--> memorizzazione parametri di caricamento utilizzati + } + #endregion #region Metodi Pubblici @@ -679,19 +706,57 @@ { if (scList.Find(x => x.IsNavigator) != null) //Se combinazione di tasti corrispondente a Skin Navigator { - + if (Log != null) + Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "Request Skin Navigator dialog menu")); + + try + { + int actWindowID = (int)GUIWindowManager.ActiveWindow; + GUIDialogMenu dlgMenu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); + dlgMenu.Reset(); + dlgMenu.SetHeading("Skin Navigator"); + dlgMenu.ShowQuickNumbers = false; + + List<WindowLink> dlgLinks = new List<WindowLink>(); + foreach (NavItem item in _navItems) //Iterazione per memorizzazione impostazioni shortcuts + { + if ((item.Windows.First(x => x.WindowID == actWindowID)) != null || item.Windows.Count == 0) + { + bool first = true; + foreach (WindowLink link in item.Destinations) //Iterazione per memorizzazione impostazioni shortcuts + { + if (first && dlgLinks.Count > 0) + { + dlgMenu.Add("---- ----"); + dlgLinks.Add(null); + first = false; + } + dlgMenu.Add(link.Caption); + dlgLinks.Add(link); + } + } + } + + if (dlgLinks.Count > 0) + { + dlgMenu.DoModal(actWindowID); + if (dlgMenu.SelectedLabel >= 0 && dlgMenu.SelectedLabel < dlgLinks.Count) + dlgLinks[dlgMenu.SelectedLabel].Go(Log); + else + if (Log != null) + Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "No links selected from Skin Navigator dialog menu, ID = " + actWindowID)); + } + else + if (Log != null) + Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "No links found for Skin Navigator, window ID = " + actWindowID)); + } + catch (Exception e) + { + if (Log != null) + Log(this, new LogEventArgs(LogEventArgs.LogLevels.Error, "Error opening Skin Navigator dialog menu", e)); + } - GUIDialogMenu dlgMenu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); - dlgMenu.Reset(); - dlgMenu.SetHeading("Skin Navigator"); - dlgMenu.ShowQuickNumbers = false; - dlgMenu.Add("tega"); - dlgMenu.Add("nanda"); - - dlgMenu.DoModal((int)GUIWindowManager.ActiveWindow); - //if (dlgMenu.SelectedLabel >= 0) - } else //Shortcuts normali { @@ -701,10 +766,7 @@ scList[0].GoPrevious(Log); //--> visualizzazione finestra precedente else if (scList[0].Go(Log)) //--> visualizzazione finestra di destinazione shortcut - { - lastDestination.WindowID = scList[0].WindowID; //--> memorizzazione id finestra - lastDestination.LoadParameter = scList[0].LoadParameter; //--> memorizzazione parametri di caricamento utilizzati - } + lastDestination.Get(scList[0].); //--> memorizzazione destinazione } else //Shortcut a destinazione multipla (ciclico) { @@ -730,7 +792,7 @@ Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "Key not mapped: " + k.ToString())); } } - public void WindowChanged(int windowID) //Evento di finestra attiva modificata + public void WindowChanged(int windowID) //Evento di finestra attiva modificata (richiamato dall'esterno) { if (lastDestination.WindowID != windowID) //Se attivata una finestra non corrispondente all'ultima destinazione della classe lastDestination.Reset(); //--> invalidazione parametri memorizzati relativi all'ultima destinazione This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-05-04 20:12:58
|
Revision: 4796 http://sourceforge.net/p/mp-plugins/code/4796 Author: nicsergio Date: 2014-05-04 20:12:54 +0000 (Sun, 04 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-04 16:34:28 UTC (rev 4795) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-04 20:12:54 UTC (rev 4796) @@ -69,12 +69,12 @@ if (skinNavigator) //Se richiesta destinazione corrispondente a Skin Navigator { _caption = "Skin Navigator"; //--> titolo Skin Navigator - _windowID = NavigatorID; //--> window ID virtuale per attivazione Skin Navigator + _windowID = NavigatorID; //--> Id finestra virtuale per attivazione Skin Navigator } else { _caption = "Link"; //--> inizializzazione titolo - _windowID = 0; //--> inizializzazione window ID + _windowID = 0; //--> inizializzazione Id finestra } _loadParameter = ""; //--> inizializzazione parametri di caricamento per visualizzazione } @@ -159,7 +159,7 @@ } public void Reset() //Reset destinazione (invalidazione) { - _windowID = InvalidID; //--> invalidazione window ID + _windowID = InvalidID; //--> invalidazione Id finestra _loadParameter = ""; //--> reset parametri di caricamento } public override string ToString() //Override metodo ToString per stampare le proprietà del link @@ -345,6 +345,51 @@ public string SoundEffect { get { return this._soundEffect; } set { this._soundEffect = value; this.NotifyPropertyChanged("SoundEffect"); } } #endregion } + internal class Window //Classe finestra di MediaPortal + { + #region Dati + private string _caption; //Titolo finestra + private int _windowID; //Id finestra + private string _xmlFile; //Nome del file xml corrispondente + #endregion + + #region Costruttore + public Window() //Costruttore classe Window + { + _caption = ""; //--> inizializzazione titolo + _windowID = 0; //--> inizializzazione Id finestra + _xmlFile = ""; //--> inizializzazione nome file xml + } + #endregion + + #region Metodi Pubblici + public override string ToString() { return (_caption); } //Override metodo ToString per riempire classi ListControl + #endregion + + #region Proprietà + public string Caption { get { return this._caption; } set { this._caption = value; } } + public int WindowID { get { return this._windowID; } set { this._windowID = value; } } + public string XmlFile { get { return this._xmlFile; } set { this._xmlFile = value; } } + #endregion + } + internal class NavigatorItem //Classe elemento per navigazione + { + #region Dati + private string _caption; //Titolo link + private BindingList<Window> _windows = new BindingList<Window>(); + private BindingList<WindowLink> _destinations = new BindingList<WindowLink>(); + #endregion + + #region Costruttore + public NavigatorItem() //Costruttore classe Window + { + _caption = "Navigator Group"; //--> inizializzazione titolo + } + #endregion + + + } + internal class ShortCuts //Classe di gestione degli shortcuts configurati { #region Strutture This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-05-04 16:34:32
|
Revision: 4795 http://sourceforge.net/p/mp-plugins/code/4795 Author: nicsergio Date: 2014-05-04 16:34:28 +0000 (Sun, 04 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Common.Utils.dll trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Core.dll trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Utils.dll trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Added Paths: ----------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Dialogs.dll Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Common.Utils.dll =================================================================== (Binary files differ) Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Core.dll =================================================================== (Binary files differ) Added: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Dialogs.dll =================================================================== (Binary files differ) Index: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Dialogs.dll =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Dialogs.dll 2014-05-03 19:44:02 UTC (rev 4794) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Dialogs.dll 2014-05-04 16:34:28 UTC (rev 4795) Property changes on: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Dialogs.dll ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ExternalResources/Utils.dll =================================================================== (Binary files differ) Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs 2014-05-03 19:44:02 UTC (rev 4794) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs 2014-05-04 16:34:28 UTC (rev 4795) @@ -26,14 +26,15 @@ { MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "Plugin started")); + string settingsFile = Config.GetFile(Config.Dir.Config, Tools.MyAssembly.Name + ".xml"); + myShortCuts = new ShortCuts(settingsFile); //Creazione classe per gestione shorcuts + myShortCuts.Log += new LogEventHandler(myShortCuts_Log); //--> sottoscrizione evento di log shortuts + if (LockKeys.ChangeCapsLock(myShortCuts.GeneralForcingCapsLock)) MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "CapsLock " + ((myShortCuts.GeneralForcingCapsLock == LockKeys.LockKeyActions.Off) ? "deactivated" : "activated"))); if (LockKeys.ChangeNumLock(myShortCuts.GeneralForcingNumLock)) - MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "NumLock " + ((myShortCuts.GeneralForcingNumLock == LockKeys.LockKeyActions.Off) ? "deactivated" : "activated"))); - - string settingsFile = Config.GetFile(Config.Dir.Config, Tools.MyAssembly.Name + ".xml"); - myShortCuts = new ShortCuts(settingsFile); //Creazione classe per gestione shorcuts - myShortCuts.Log += new LogEventHandler(myShortCuts_Log); //--> sottoscrizione evento di log shortuts + MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "NumLock " + ((myShortCuts.GeneralForcingNumLock == LockKeys.LockKeyActions.Off) ? "deactivated" : "activated"))); + if (myShortCuts.Initialize()) //Inizializzazione & lettura impostazioni shorcuts { try Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2014-05-03 19:44:02 UTC (rev 4794) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2014-05-04 16:34:28 UTC (rev 4795) @@ -52,6 +52,10 @@ <SpecificVersion>False</SpecificVersion> <HintPath>ExternalResources\Core.dll</HintPath> </Reference> + <Reference Include="Dialogs, Version=1.3.0.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>ExternalResources\Dialogs.dll</HintPath> + </Reference> <Reference Include="System" /> <Reference Include="System.Core" /> <Reference Include="System.Deployment" /> @@ -173,6 +177,7 @@ </BootstrapperPackage> </ItemGroup> <ItemGroup> + <Content Include="ExternalResources\Dialogs.dll" /> <Content Include="Resources\Images\SkinNav.png" /> <Content Include="Resources\Images\SkinNavAdd.png" /> <EmbeddedResource Include="Resources\XmlFiles\DefaultConfig.xml"> Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs 2014-05-03 19:44:02 UTC (rev 4794) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs 2014-05-04 16:34:28 UTC (rev 4795) @@ -311,12 +311,17 @@ } void idTextBox_KeyPress(object sender, KeyPressEventArgs e) { - if (!(char.IsDigit(e.KeyChar))) //Filtro per input numerico per la cella WindowID + if ((int)shortCutsDataGridView.CurrentCell.Value <= 0) //Se WindowID negativo (possibile solo con Skin Navigator) + e.Handled = true; //--> carattere inputato da ignorare + else { - Keys key = (Keys)e.KeyChar; - if (!(key == Keys.Back || key == Keys.Delete)) + if (!(char.IsDigit(e.KeyChar))) //Filtro per input numerico per la cella WindowID { - e.Handled = true; //--> carattere inputato da ignorare + Keys key = (Keys)e.KeyChar; + if (!(key == Keys.Back || key == Keys.Delete)) + { + e.Handled = true; //--> carattere inputato da ignorare + } } } } @@ -381,7 +386,11 @@ } private void skinNavAddButton_Click(object sender, EventArgs e) { - + ShortCut sc = new ShortCut(true); + myShortCuts.Items.Add(sc); + shortCutsDataGridView.CurrentCell = shortCutsDataGridView[0, shortCutsDataGridView.RowCount - 1]; + shortCutsDataGridView.Rows[shortCutsDataGridView.RowCount - 1].Selected = true; + skinNavAddButton.Enabled = false; } private void rowUpButton_Click(object sender, EventArgs e) { Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-03 19:44:02 UTC (rev 4794) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-04 16:34:28 UTC (rev 4795) @@ -11,6 +11,7 @@ using MediaPortal.Player; using MediaPortal.Profile; using MediaPortal.Util; +using MediaPortal.Dialogs; namespace ProcessPlugins.ShortCuter { @@ -168,7 +169,7 @@ #endregion #region Proprietà - public bool IsValid { get { return (this._windowID > InvalidID) ; } } + public bool IsValid { get { return (this._windowID > InvalidID || this.IsNavigator) ; } } public bool IsNavigator { get { return (this._windowID == NavigatorID); } } public string Caption { get { return this._caption; } set { this._caption = value; } } public int WindowID { get { return this._windowID; } set { this._windowID = value; } } @@ -255,11 +256,12 @@ #endregion #region Costruttore - public ShortCut() //Costruttore classe ShortCut + public ShortCut() : this(false) { } //Costruttore classe ShortCut (senza argomenti) + public ShortCut(bool skinNavigator) //Costruttore classe ShortCut { - _caption = "ShortCut"; //--> inizializzazione titolo + _caption = (skinNavigator ? "Skin Navigator" : "ShortCut"); //--> inizializzazione titolo _keys = new KeyCombination(); //--> istanziazione classe KeyCombination - _destination = new WindowLink(); //--> istanziazione classe WindowLink + _destination = new WindowLink(skinNavigator); //--> istanziazione classe WindowLink _destination.Caption = ""; //--> reset caption destinazione (gestita caption shortcut) _return = false; //--> inizializzazione ritorno a finestra precedente se si è già a destinazione _soundEffect = "click.wav"; //--> inizializzazione effetto sonoro @@ -330,7 +332,8 @@ #endregion #region Proprietà - public bool IsValid { get { return this._keys.IsValid && _destination.IsValid; } } + public bool IsValid { get { return this._destination.IsValid && this._keys.IsValid; } } + public bool IsNavigator { get { return this._destination.IsNavigator; } } public string Caption { get { return this._caption; } set { this._caption = value; this.NotifyPropertyChanged("Caption"); } } public string Key { get { return this._keys.Key; } set { this._keys.Key = value; this.NotifyPropertyChanged("Key"); } } public bool Ctrl { get { return this._keys.Ctrl; } set { this._keys.Ctrl = value; this.NotifyPropertyChanged("Ctrl"); } } @@ -629,33 +632,52 @@ List<ShortCut> scList = GetShortCutsGroup(k); //--> raccolta lista shortcut associati alla combinazione di tasti attuale if (scList != null && scList.Count > 0) //Se trovato almeno uno shortcut { - if (scList.Count == 1) //Shortcut a destinazione singola + if (scList.Find(x => x.IsNavigator) != null) //Se combinazione di tasti corrispondente a Skin Navigator { - if (scList[0].Return && AlreadyAtDestination(scList[0])) //Se impostato flag di ritorno e finestra attuale corrispondente a destinazione - scList[0].GoPrevious(Log); //--> visualizzazione finestra precedente - else - if (scList[0].Go(Log)) //--> visualizzazione finestra di destinazione shortcut - { - lastDestination.WindowID = scList[0].WindowID; //--> memorizzazione id finestra - lastDestination.LoadParameter = scList[0].LoadParameter; //--> memorizzazione parametri di caricamento utilizzati - } + + + GUIDialogMenu dlgMenu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); + dlgMenu.Reset(); + dlgMenu.SetHeading("Skin Navigator"); + dlgMenu.ShowQuickNumbers = false; + + dlgMenu.Add("tega"); + dlgMenu.Add("nanda"); + + dlgMenu.DoModal((int)GUIWindowManager.ActiveWindow); + //if (dlgMenu.SelectedLabel >= 0) + } - else //Shortcut a destinazione multipla (ciclico) + else //Shortcuts normali { - int scIndex = 0; - for (int i = 0; i < scList.Count; i++) //Iterazione di verifica se la finestra attuale corrisponde ad una delle destinazioni + if (scList.Count == 1) //Shortcut a destinazione singola { - if (AlreadyAtDestination(scList[i])) + if (scList[0].Return && AlreadyAtDestination(scList[0])) //Se impostato flag di ritorno e finestra attuale corrispondente a destinazione + scList[0].GoPrevious(Log); //--> visualizzazione finestra precedente + else + if (scList[0].Go(Log)) //--> visualizzazione finestra di destinazione shortcut + { + lastDestination.WindowID = scList[0].WindowID; //--> memorizzazione id finestra + lastDestination.LoadParameter = scList[0].LoadParameter; //--> memorizzazione parametri di caricamento utilizzati + } + } + else //Shortcut a destinazione multipla (ciclico) + { + int scIndex = 0; + for (int i = 0; i < scList.Count; i++) //Iterazione di verifica se la finestra attuale corrisponde ad una delle destinazioni { - scIndex = (i + 1) % scList.Count; //--> impostazione indice shortcut successivo - break; + if (AlreadyAtDestination(scList[i])) + { + scIndex = (i + 1) % scList.Count; //--> impostazione indice shortcut successivo + break; + } } + if (scList[scIndex].Go(Log)) //--> visualizzazione finestra di destinazione shortcut + { + lastDestination.WindowID = scList[scIndex].WindowID; //--> memorizzazione id finestra + lastDestination.LoadParameter = scList[scIndex].LoadParameter; //--> memorizzazione parametri di caricamento utilizzati + } } - if (scList[scIndex].Go(Log)) //--> visualizzazione finestra di destinazione shortcut - { - lastDestination.WindowID = scList[scIndex].WindowID; //--> memorizzazione id finestra - lastDestination.LoadParameter = scList[scIndex].LoadParameter; //--> memorizzazione parametri di caricamento utilizzati - } } } else //Combinazione di tasti non corrispondente a nessuno shortcut This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-05-03 19:44:07
|
Revision: 4794 http://sourceforge.net/p/mp-plugins/code/4794 Author: nicsergio Date: 2014-05-03 19:44:02 +0000 (Sat, 03 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/SkinNavigatorConfig.Designer.cs Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs 2014-05-03 17:38:29 UTC (rev 4793) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs 2014-05-03 19:44:02 UTC (rev 4794) @@ -1,11 +1,7 @@ using System; -using System.Collections.Generic; -using System.Linq; using System.Windows.Forms; using MediaPortal.Configuration; using MediaPortal.GUI.Library; -using MediaPortal.Util; -using MediaPortal.Player; //using Action = MediaPortal.GUI.Library.Action; using My.Common; @@ -28,12 +24,12 @@ #region Implementazione IPlugin public void Start() //Avvio del plugin { - MpLog(false, "Plugin started"); + MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "Plugin started")); if (LockKeys.ChangeCapsLock(myShortCuts.GeneralForcingCapsLock)) - MpLog(false, "CapsLock " + ((myShortCuts.GeneralForcingCapsLock == LockKeys.LockKeyActions.Off) ? "deactivated" : "activated")); + MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "CapsLock " + ((myShortCuts.GeneralForcingCapsLock == LockKeys.LockKeyActions.Off) ? "deactivated" : "activated"))); if (LockKeys.ChangeNumLock(myShortCuts.GeneralForcingNumLock)) - MpLog(false, "NumLock " + ((myShortCuts.GeneralForcingNumLock == LockKeys.LockKeyActions.Off) ? "deactivated" : "activated")); + MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "NumLock " + ((myShortCuts.GeneralForcingNumLock == LockKeys.LockKeyActions.Off) ? "deactivated" : "activated"))); string settingsFile = Config.GetFile(Config.Dir.Config, Tools.MyAssembly.Name + ".xml"); myShortCuts = new ShortCuts(settingsFile); //Creazione classe per gestione shorcuts @@ -45,9 +41,9 @@ RawInputHook rawInput = new RawInputHook(GUIGraphicsContext.form.Handle); //--> creazione hook mediante RawInput rawInput.KeyDown += new KeyEventHandler(rawInput_KeyDown); //--> sottoscrizione evento KeyDown } - catch + catch (Exception e) { - MpLog(true, "Error creating raw input hook"); + MpLog(new LogEventArgs(LogEventArgs.LogLevels.Error, "Error creating raw input hook", e)); } try @@ -55,36 +51,39 @@ //Sottoscrizione evento di attivazione finestra di MediaPortal GUIWindowManager.OnActivateWindow += new GUIWindowManager.WindowActivationHandler(GUIWindowManager_OnActivateWindow); } - catch + catch (Exception e) { - MpLog(true, "Error subscription ActivateWindow event"); + MpLog(new LogEventArgs(LogEventArgs.LogLevels.Error, "Error subscription ActivateWindow event", e)); } } else - MpLog(true, "Error loading configuration"); + MpLog(new LogEventArgs(LogEventArgs.LogLevels.Error, "Error loading configuration")); } public void Stop() //Terminazione del plugin { - MpLog(false, "Plugin stopped"); + MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "Plugin stopped")); } #endregion - #region Metodi Pubblici - public static void MpLog(bool errorLog, string description) //Registrazione evento su log di MediaPortal (senza passare l'eccezione) + #region Metodi Privati + private void MpLog(LogEventArgs e) //Registrazione evento su log di MediaPortal { - MpLog(errorLog, description, null); - } - public static void MpLog(bool errorLog, string description, Exception e) //Registrazione evento su log di MediaPortal - { - description = LogPrefix + description; - if (errorLog) + string message = LogPrefix + e.LogMessage; + + switch (e.LogLevel) { - if (e != null) - description += " [" + e.Message + " (" + e.StackTrace + ")]"; - Log.Error(description); //--> log errore + case LogEventArgs.LogLevels.Error: + if (e.LogException != null) + message += " [" + e.LogException.Message + " (" + e.LogException.StackTrace + ")]"; + Log.Error(message); //--> log errore + break; + case LogEventArgs.LogLevels.Info: + Log.Info(message); //--> log messaggio informativo + break; + case LogEventArgs.LogLevels.Debug: + Log.Debug(message); //--> log informazione per debug + break; } - else - Log.Info(description); //--> log messaggio informativo } #endregion @@ -97,20 +96,9 @@ { myShortCuts.WindowChanged(windowID); //--> pubblicazione a gestore shortcuts } - private void myShortCuts_Log(object sender, LogEventArgs e) + private void myShortCuts_Log(object sender, LogEventArgs e) //Evento di log gestore shortcuts { - switch (e.LogLevel) - { - case LogEventArgs.LogLevels.Error: - if (e.LogException != null) - Tools.ErrorMessage(e.LogMessage, e.LogException.Message); //--> emissione finestra di errore (con descrizione errore) - else - Tools.ErrorMessage(e.LogMessage); //--> emissione finestra di errore - break; - case LogEventArgs.LogLevels.Info: - Tools.InfoMessage(e.LogMessage); //--> emissione finestra informativa - break; - } + MpLog(e); //--> log } #endregion } Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-03 17:38:29 UTC (rev 4793) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-03 19:44:02 UTC (rev 4794) @@ -1,23 +1,22 @@ using System; using System.Collections.Generic; using System.ComponentModel; -using MediaPortal.GUI.Library; using System.IO; using System.Linq; using System.Reflection; using System.Text; using System.Windows.Forms; using System.Xml; +using MediaPortal.GUI.Library; +using MediaPortal.Player; using MediaPortal.Profile; using MediaPortal.Util; -using MediaPortal.Player; -using My.Common; namespace ProcessPlugins.ShortCuter { #region Delegati/Classi - public delegate void LogEventHandler(object sender, LogEventArgs e); //Delegato per evento di log - public class LogEventArgs : EventArgs //Argomenti per evento di log + internal delegate void LogEventHandler(object sender, LogEventArgs e); //Delegato per evento di log + internal class LogEventArgs : EventArgs //Argomenti per evento di log { #region Dati private LogLevels _logLevel; //Livello di log @@ -57,15 +56,25 @@ private int _windowID; //Id finestra per visualizzazione in MediaPortal private string _loadParameter; //Eventuali parametri di caricamento per visualizzazione (sotto-categorie, ecc.) - private const int TrailersPluginControlID = 11899; //Id controllo per attivazione plugin Trailers - private const int InvalidID = -1; //Id finestra invalido + private const int InvalidID = -1; //Id finestra invalido + private const int NavigatorID = -999; //Id per attivazione Skin Navigator + private const int TrailersControlID = 11899; //Id controllo per attivazione plugin Trailers #endregion #region Costruttore - public WindowLink() //Costruttore classe WindowLink + public WindowLink() : this(false) { } //Costruttore classe WindowLink (senza argomenti) + public WindowLink(bool skinNavigator) //Costruttore classe WindowLink { - _caption = "Link"; //--> inizializzazione titolo - _windowID = 0; //--> inizializzazione window ID + if (skinNavigator) //Se richiesta destinazione corrispondente a Skin Navigator + { + _caption = "Skin Navigator"; //--> titolo Skin Navigator + _windowID = NavigatorID; //--> window ID virtuale per attivazione Skin Navigator + } + else + { + _caption = "Link"; //--> inizializzazione titolo + _windowID = 0; //--> inizializzazione window ID + } _loadParameter = ""; //--> inizializzazione parametri di caricamento per visualizzazione } #endregion @@ -112,8 +121,8 @@ else //Richiamo schermata senza parametri di caricamento { GUIMessage msg; - if (_windowID == TrailersPluginControlID) //Se richiesta di attivazione plugin Trailers - msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_CLICKED, 0, TrailersPluginControlID, TrailersPluginControlID, 0, 0, null); + if (_windowID == TrailersControlID) //Se richiesta di attivazione plugin Trailers + msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_CLICKED, 0, TrailersControlID, TrailersControlID, 0, 0, null); else //Caso normale di attivazione finesta MediaPortal msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, _windowID, 0, null); @@ -159,13 +168,8 @@ #endregion #region Proprietà - public bool IsValid - { - get - { - return (this._windowID >= 0); //L'ID della finestra di MediaPortal deve essere valido - } - } + public bool IsValid { get { return (this._windowID > InvalidID) ; } } + public bool IsNavigator { get { return (this._windowID == NavigatorID); } } public string Caption { get { return this._caption; } set { this._caption = value; } } public int WindowID { get { return this._windowID; } set { this._windowID = value; } } public string LoadParameter { get { return this._loadParameter; } set { this._loadParameter = value; } } Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/SkinNavigatorConfig.Designer.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/SkinNavigatorConfig.Designer.cs 2014-05-03 17:38:29 UTC (rev 4793) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/SkinNavigatorConfig.Designer.cs 2014-05-03 19:44:02 UTC (rev 4794) @@ -52,7 +52,7 @@ this.MaximizeBox = false; this.Name = "SkinNavigatorConfig"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "SkinNavigatorConfig"; + this.Text = "Skin Navigator Configuration"; this.ResumeLayout(false); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-05-03 17:38:34
|
Revision: 4793 http://sourceforge.net/p/mp-plugins/code/4793 Author: nicsergio Date: 2014-05-03 17:38:29 +0000 (Sat, 03 May 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/Common/Skin.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Modified: trunk/plugins/ShortCuter&SkinEditor/Source/Common/Skin.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/Common/Skin.cs 2014-05-01 10:43:45 UTC (rev 4792) +++ trunk/plugins/ShortCuter&SkinEditor/Source/Common/Skin.cs 2014-05-03 17:38:29 UTC (rev 4793) @@ -8,199 +8,199 @@ namespace My.Common { internal class MediaPortalSkin //Classe per gestione elementare skin di MediaPortal + { + #region Dati + protected readonly string Name; //Nome della skin + protected struct Folders //Struttura di memorizzazione cartelle { - #region Dati - protected readonly string Name; //Nome della skin - protected struct Folders //Struttura di memorizzazione cartelle - { - public string Skin; //Percorso della skin - public string Cache; //Percorso cache della skin - public string Media; //Percorso file multimediali della skin - public string Animations; //Percorso per animazioni (multi-image) della skin - public string Icons; //Eventuale percorso icone di menu della skin - public string Sounds; //Percorso effetti sonori - } - public class SkinFile //Classe file della skin (con ID) - { - public string Name = ""; //Nome del file - public int Id = 0; //WindowID del file (link da MediaPortal) - public override string ToString() { return Name; } //Override metodo ToString per riempire classi ListControl - } - public class SkinLink //Classe link per la skin - { - public string Context = ""; //Eventuale testo aggiuntivo ("guarda"-"ascolta"-ecc.) - public string Caption = ""; //Titolo - public string XmlFile = ""; //Nome del file xml della skin - public int WindowID = 0; //Id finestra per visualizzazione in MediaPortal - public string LoadParameter = ""; //Eventuali parametri aggiuntivi per visualizzazione (sotto-categorie, ecc.) - public string BackgroundImage = ""; //File immagine di background - public string BackgroundFolder = ""; //Cartella per multi-image di background - public string FanartHandler = ""; //Tipologia di fanart per background - public string Overlay = ""; //Eventuale riquadro visualizzato in sovrapposizione all'immagine di background - public string IconList = ""; //Eventuale icona per rappresentazione in lista/treeview - public bool IsFather = false; //Il link è un nodo padre (visualizzazione a treeview) - public override string ToString() { return Caption; } //Override metodo ToString per riempire classi ListControl - } - protected Folders _paths = new Folders(); //Percorsi - protected List<SkinFile> _skinFiles = new List<SkinFile>(); //Lista file della skin (con ID) - protected List<SkinLink> _skinLinks = new List<SkinLink>(); //Lista link predefiniti per la skin - protected bool _initialized; //Classe inizializzata - #endregion + public string Skin; //Percorso della skin + public string Cache; //Percorso cache della skin + public string Media; //Percorso file multimediali della skin + public string Animations; //Percorso per animazioni (multi-image) della skin + public string Icons; //Eventuale percorso icone di menu della skin + public string Sounds; //Percorso effetti sonori + } + public class SkinFile //Classe file della skin (con ID) + { + public string Name = ""; //Nome del file + public int Id = 0; //WindowID del file (link da MediaPortal) + public override string ToString() { return Name; } //Override metodo ToString per riempire classi ListControl + } + public class SkinLink //Classe link per la skin + { + public string Context = ""; //Eventuale testo aggiuntivo ("guarda"-"ascolta"-ecc.) + public string Caption = ""; //Titolo + public string XmlFile = ""; //Nome del file xml della skin + public int WindowID = 0; //Id finestra per visualizzazione in MediaPortal + public string LoadParameter = ""; //Eventuali parametri aggiuntivi per visualizzazione (sotto-categorie, ecc.) + public string BackgroundImage = ""; //File immagine di background + public string BackgroundFolder = ""; //Cartella per multi-image di background + public string FanartHandler = ""; //Tipologia di fanart per background + public string Overlay = ""; //Eventuale riquadro visualizzato in sovrapposizione all'immagine di background + public string IconList = ""; //Eventuale icona per rappresentazione in lista/treeview + public bool IsFather = false; //Il link è un nodo padre (visualizzazione a treeview) + public override string ToString() { return Caption; } //Override metodo ToString per riempire classi ListControl + } + protected Folders _paths = new Folders(); //Percorsi + protected List<SkinFile> _skinFiles = new List<SkinFile>(); //Lista file della skin (con ID) + protected List<SkinLink> _skinLinks = new List<SkinLink>(); //Lista link predefiniti per la skin + protected bool _initialized; //Classe inizializzata + #endregion - #region Costruttore - public MediaPortalSkin(string skinName, string skinsPath, string cachesPath, bool onlyMenuItems) - { //Costruttore - Name = skinName; //--> nome della skin - _paths.Skin = skinsPath + Name + @"\"; //--> percorso skin - _paths.Cache = cachesPath + Name + @"\"; //--> percorso cache skin - _paths.Media = _paths.Skin + @"Media\"; //--> percorso file multimediali skin - _paths.Animations = _paths.Media + @"Animations\"; //--> percorso per animazioni (multi-image) skin - _paths.Icons = _paths.Media + @"Icons\"; //--> eventuale percorso icone di menu della skin - _paths.Sounds = _paths.Skin + @"Sounds\"; //--> percorso effetto sonori skin + #region Costruttore + public MediaPortalSkin(string skinName, string skinsPath, string cachesPath, bool onlyMenuItems) + { //Costruttore + Name = skinName; //--> nome della skin + _paths.Skin = skinsPath + Name + @"\"; //--> percorso skin + _paths.Cache = cachesPath + Name + @"\"; //--> percorso cache skin + _paths.Media = _paths.Skin + @"Media\"; //--> percorso file multimediali skin + _paths.Animations = _paths.Media + @"Animations\"; //--> percorso per animazioni (multi-image) skin + _paths.Icons = _paths.Media + @"Icons\"; //--> eventuale percorso icone di menu della skin + _paths.Sounds = _paths.Skin + @"Sounds\"; //--> percorso effetto sonori skin - _initialized = GetSkinFiles(onlyMenuItems) && GetSkinLinks(onlyMenuItems); //--> raccolta file della skin (con ID) e link - } - #endregion + _initialized = GetSkinFiles(onlyMenuItems) && GetSkinLinks(onlyMenuItems); //--> raccolta file della skin (con ID) e link + } + #endregion - #region Metodi Privati - private bool GetSkinFiles(bool onlyMenuItems) //Raccolta dei file della skin + #region Metodi Privati + private bool GetSkinFiles(bool onlyMenuItems) //Raccolta dei file della skin + { + if (!Directory.Exists(_paths.Skin)) { - if (!Directory.Exists(_paths.Skin)) + Tools.ErrorMessage("Skin folder not found!", _paths.Skin); + return false; + } + string[] files = Directory.GetFiles(_paths.Skin); //--> lettura file da disco + foreach (string file in files) //Iterazione per applicazione filtro e memorizzazione dati + { + try { - Tools.ErrorMessage("Skin folder not found!", _paths.Skin); - return false; - } - string[] files = Directory.GetFiles(_paths.Skin); //--> lettura file da disco - foreach (string file in files) //Iterazione per applicazione filtro e memorizzazione dati - { - try + if (!file.ToLower().StartsWith("common") && !file.ToLower().Contains("dialog") && !file.ToLower().Contains("wizard") && !file.ToLower().Contains("overlay") && (!onlyMenuItems || (!file.ToLower().EndsWith("myhome.xml") && !file.ToLower().EndsWith("basichome.xml") && !file.ToLower().Contains("fullscreen"))) && file.ToLower().EndsWith(".xml")) { - if (!file.ToLower().StartsWith("common") && !file.ToLower().Contains("dialog") && !file.ToLower().Contains("wizard") && !file.ToLower().Contains("overlay") && (!onlyMenuItems || (!file.ToLower().EndsWith("myhome.xml") && !file.ToLower().EndsWith("basichome.xml") && !file.ToLower().Contains("fullscreen"))) && file.ToLower().EndsWith(".xml")) + XmlDocument xmlFile = new XmlDocument(); + xmlFile.Load(file); + XmlNode node = xmlFile.DocumentElement.SelectSingleNode("/window/id"); + if (node.InnerText.Length > 0) { - XmlDocument xmlFile = new XmlDocument(); - xmlFile.Load(file); - XmlNode node = xmlFile.DocumentElement.SelectSingleNode("/window/id"); - if (node.InnerText.Length > 0) - { - SkinFile skF = new SkinFile(); - skF.Name = file.Remove(0, file.LastIndexOf(@"\") + 1).Replace(".xml", ""); - skF.Id = Convert.ToInt32(node.InnerText); - if (skF.Id >= 0) - _skinFiles.Add(skF); //--> aggiunta file nella lista - } + SkinFile skF = new SkinFile(); + skF.Name = file.Remove(0, file.LastIndexOf(@"\") + 1).Replace(".xml", ""); + skF.Id = Convert.ToInt32(node.InnerText); + if (skF.Id >= 0) + _skinFiles.Add(skF); //--> aggiunta file nella lista } } - catch { } } - if (_skinFiles.Count > 0) - return true; //--> raccolta files effettuata - else + catch { } + } + if (_skinFiles.Count > 0) + return true; //--> raccolta files effettuata + else + { + Tools.ErrorMessage("No skin files found.", _paths.Skin); + return false; + } + } + private bool GetSkinLinks(bool onlyMenuItems) //Raccolta dei link predefiniti per la skin + { + XmlDocument xmlFile = new XmlDocument(); + try + { + using (Stream streamFile = Assembly.GetExecutingAssembly().GetManifestResourceStream( + Assembly.GetExecutingAssembly().GetManifestResourceNames().Where(name => name.Contains("PopularSkinLinks.xml")).ElementAt(0).ToString())) { - Tools.ErrorMessage("No skin files found.", _paths.Skin); - return false; + xmlFile.Load(streamFile); //Links skin disponibili --> lettura file xml incapsulato } } - private bool GetSkinLinks(bool onlyMenuItems) //Raccolta dei link predefiniti per la skin + catch (Exception e) { - XmlDocument xmlFile = new XmlDocument(); - try - { - using (Stream streamFile = Assembly.GetExecutingAssembly().GetManifestResourceStream( - Assembly.GetExecutingAssembly().GetManifestResourceNames().Where(name => name.Contains("PopularSkinLinks.xml")).ElementAt(0).ToString())) - { - xmlFile.Load(streamFile); //Links skin disponibili --> lettura file xml incapsulato - } - } - catch (Exception e) - { - Tools.ErrorMessage("Error loading PopularSkinLinks.xml.", e.Message); - return false; - } + Tools.ErrorMessage("Error loading PopularSkinLinks.xml.", e.Message); + return false; + } - XmlNodeList nodeList = xmlFile.DocumentElement.SelectNodes("/Items/Item"); - foreach (XmlNode node in nodeList) //Iterazione per memorizzazione links + XmlNodeList nodeList = xmlFile.DocumentElement.SelectNodes("/Items/Item"); + foreach (XmlNode node in nodeList) //Iterazione per memorizzazione links + { + if (AddLink(node, true, onlyMenuItems)) //Se nodo padre aggiunto { - if (AddLink(node, true, onlyMenuItems)) //Se nodo padre aggiunto - { - XmlNodeList subNodeList = node.SelectNodes("SubItems/SubItem"); - foreach (XmlNode subNode in subNodeList) //Iterazione per memorizzazione links figli - AddLink(subNode, false, onlyMenuItems); //--> aggiunta nodi figli - } + XmlNodeList subNodeList = node.SelectNodes("SubItems/SubItem"); + foreach (XmlNode subNode in subNodeList) //Iterazione per memorizzazione links figli + AddLink(subNode, false, onlyMenuItems); //--> aggiunta nodi figli } - if (_skinLinks.Count > 0) - return true; //--> raccolta links effettuata - else - { - Tools.ErrorMessage("No skin links found loading PopularSkinLinks.xml."); - return false; - } } - private bool AddLink(XmlNode node, bool isFather, bool onlyMenuItems) //Aggiunta link + if (_skinLinks.Count > 0) + return true; //--> raccolta links effettuata + else { - XmlNode innerNode = node.SelectSingleNode("Menu"); - if (onlyMenuItems && (innerNode == null || innerNode.InnerText.ToLower() != "true" )) - return false; //Nel caso di raccolta dei soli elementi di menu, si saltano gli elementi non corrispondenti + Tools.ErrorMessage("No skin links found loading PopularSkinLinks.xml."); + return false; + } + } + private bool AddLink(XmlNode node, bool isFather, bool onlyMenuItems) //Aggiunta link + { + XmlNode innerNode = node.SelectSingleNode("Menu"); + if (onlyMenuItems && (innerNode == null || innerNode.InnerText.ToLower() != "true" )) + return false; //Nel caso di raccolta dei soli elementi di menu, si saltano gli elementi non corrispondenti - SkinLink popularLink = new SkinLink(); - innerNode = node.SelectSingleNode("Context"); - if (innerNode != null) - popularLink.Context = innerNode.InnerText; - innerNode = node.SelectSingleNode("Caption"); - if (innerNode != null) - popularLink.Caption = innerNode.InnerText; - innerNode = node.SelectSingleNode("XmlFile"); - if (innerNode != null) - popularLink.XmlFile = innerNode.InnerText; - innerNode = node.SelectSingleNode("WindowID"); - if (innerNode != null) - popularLink.WindowID = Convert.ToInt32(innerNode.InnerText); - innerNode = node.SelectSingleNode("LoadParameter"); - if (innerNode != null) - popularLink.LoadParameter = innerNode.InnerText; - innerNode = node.SelectSingleNode("BackgroundImage"); - if (innerNode != null) - popularLink.BackgroundImage = innerNode.InnerText; - innerNode = node.SelectSingleNode("BackgroundFolder"); - if (innerNode != null) - popularLink.BackgroundFolder = innerNode.InnerText; - innerNode = node.SelectSingleNode("FanartHandler"); - if (innerNode != null) - popularLink.FanartHandler = innerNode.InnerText; - innerNode = node.SelectSingleNode("Overlay"); - if (innerNode != null) - popularLink.Overlay = innerNode.InnerText; - innerNode = node.SelectSingleNode("IconList"); - if (innerNode != null) - popularLink.IconList = innerNode.InnerText; - popularLink.IsFather = isFather; - try + SkinLink popularLink = new SkinLink(); + innerNode = node.SelectSingleNode("Context"); + if (innerNode != null) + popularLink.Context = innerNode.InnerText; + innerNode = node.SelectSingleNode("Caption"); + if (innerNode != null) + popularLink.Caption = innerNode.InnerText; + innerNode = node.SelectSingleNode("XmlFile"); + if (innerNode != null) + popularLink.XmlFile = innerNode.InnerText; + innerNode = node.SelectSingleNode("WindowID"); + if (innerNode != null) + popularLink.WindowID = Convert.ToInt32(innerNode.InnerText); + innerNode = node.SelectSingleNode("LoadParameter"); + if (innerNode != null) + popularLink.LoadParameter = innerNode.InnerText; + innerNode = node.SelectSingleNode("BackgroundImage"); + if (innerNode != null) + popularLink.BackgroundImage = innerNode.InnerText; + innerNode = node.SelectSingleNode("BackgroundFolder"); + if (innerNode != null) + popularLink.BackgroundFolder = innerNode.InnerText; + innerNode = node.SelectSingleNode("FanartHandler"); + if (innerNode != null) + popularLink.FanartHandler = innerNode.InnerText; + innerNode = node.SelectSingleNode("Overlay"); + if (innerNode != null) + popularLink.Overlay = innerNode.InnerText; + innerNode = node.SelectSingleNode("IconList"); + if (innerNode != null) + popularLink.IconList = innerNode.InnerText; + popularLink.IsFather = isFather; + try + { + SkinFile skF = _skinFiles.Find(x => x.Id == popularLink.WindowID); + if (skF != null || popularLink.XmlFile == "-") //Verifica se WindowID disponibile nei files della skin (o se non specificato file xml - link di sistema) { - SkinFile skF = _skinFiles.Find(x => x.Id == popularLink.WindowID); - if (skF != null || popularLink.XmlFile == "-") //Verifica se WindowID disponibile nei files della skin (o se non specificato file xml - link di sistema) - { - _skinLinks.Add(popularLink); //--> aggiunta link nella lista - return true; //--> link aggiunto - } - else - return false; //--> link non aggiunto + _skinLinks.Add(popularLink); //--> aggiunta link nella lista + return true; //--> link aggiunto } - catch - { - return false; //--> link non aggiunto (errore nella verifica esistenza WindowID) - } + else + return false; //--> link non aggiunto } - #endregion + catch + { + return false; //--> link non aggiunto (errore nella verifica esistenza WindowID) + } + } + #endregion - #region Proprietà - public bool Initialized { get { return this._initialized; } } - public string SkinPath { get { return this._paths.Skin; } } - public string CachePath { get { return this._paths.Cache; } } - public string MediaPath { get { return this._paths.Media; } } - public string AnimationsPath { get { return this._paths.Animations; } } - public string IconsPath { get { return this._paths.Icons; } } - public string SoundsPath { get { return this._paths.Sounds; } } - public List<SkinFile> SkinFiles { get { return this._skinFiles; } } - public List<SkinLink> SkinLinks { get { return this._skinLinks; } } - #endregion - } + #region Proprietà + public bool Initialized { get { return this._initialized; } } + public string SkinPath { get { return this._paths.Skin; } } + public string CachePath { get { return this._paths.Cache; } } + public string MediaPath { get { return this._paths.Media; } } + public string AnimationsPath { get { return this._paths.Animations; } } + public string IconsPath { get { return this._paths.Icons; } } + public string SoundsPath { get { return this._paths.Sounds; } } + public List<SkinFile> SkinFiles { get { return this._skinFiles; } } + public List<SkinLink> SkinLinks { get { return this._skinLinks; } } + #endregion + } } Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs 2014-05-01 10:43:45 UTC (rev 4792) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs 2014-05-03 17:38:29 UTC (rev 4793) @@ -16,10 +16,6 @@ #region Dati private ShortCuts myShortCuts; //Istanza classe ShortCuts (dati relativi ai shortcuts configurati) private static readonly string LogPrefix; //Prefisso per log eventi - private const int TrailersPluginControlID = 11899; //Id controllo per attivazione plugin Trailers - private const int InvalidWindowID = -1; //Id finestra invalido - private int lastWindowID; //Id ultima finestra attivata dal plugin - private string lastLoadParameter; //Eventuali ultimi parametri di caricamento usati dal plugin #endregion #region Costruttore @@ -34,15 +30,15 @@ { MpLog(false, "Plugin started"); - string settingsFile = Config.GetFile(Config.Dir.Config, Tools.MyAssembly.Name + ".xml"); - myShortCuts = new ShortCuts(settingsFile, false); //--> lettura configurazione relativa agli shortcuts - if (LockKeys.ChangeCapsLock(myShortCuts.GeneralForcingCapsLock)) MpLog(false, "CapsLock " + ((myShortCuts.GeneralForcingCapsLock == LockKeys.LockKeyActions.Off) ? "deactivated" : "activated")); if (LockKeys.ChangeNumLock(myShortCuts.GeneralForcingNumLock)) MpLog(false, "NumLock " + ((myShortCuts.GeneralForcingNumLock == LockKeys.LockKeyActions.Off) ? "deactivated" : "activated")); - if (myShortCuts.Initialized) //Se classe di gestione shortcut inizializzata + string settingsFile = Config.GetFile(Config.Dir.Config, Tools.MyAssembly.Name + ".xml"); + myShortCuts = new ShortCuts(settingsFile); //Creazione classe per gestione shorcuts + myShortCuts.Log += new LogEventHandler(myShortCuts_Log); //--> sottoscrizione evento di log shortuts + if (myShortCuts.Initialize()) //Inizializzazione & lettura impostazioni shorcuts { try { @@ -73,107 +69,6 @@ } #endregion - #region Metodi Privati - private void GoToScreen(ShortCut sc) //Esecuzione azione relativa allo shortcut - { - try - { - MpLog(false, "Go to screen accepted, " + sc.ToString()); - - GUIGraphicsContext.ResetLastActivity(); - if (sc.SoundEffect.Length > 0 && !g_Player.Playing) - Utils.PlaySound(sc.SoundEffect, false, true); //--> eventuale effetto sonoro - if (sc.LoadParameter.Length > 0) //Se richiesti parametri di caricamento - { - bool loadParameterChange = false; - string loadParameter = sc.LoadParameter; - while (true) //Ricerca eventuali GUIProperties - { - int i = loadParameter.IndexOf("(#"), ii = 0; - if (i >= 0) - ii = loadParameter.IndexOf(")", i); - if (i >= 0 && (ii > i)) - { - string propName = loadParameter.Remove(ii).Remove(0, i + 1); - if (propName.Length > 0) - { - loadParameter = loadParameter.Remove(i) + GUIPropertyManager.GetProperty(propName).Trim() + loadParameter.Remove(0, ii + 1); - loadParameterChange = true; - } - else - break; - } - else - break; - } - if (loadParameterChange) //Eventuale log parametri di caricamento definitivi - MpLog(false, "GUIProperties replaced, LoadParameter=[" + loadParameter + "]"); - - GUIWindowManager.ActivateWindow(sc.WindowID, loadParameter, true); //--> richiamo schermata con parametri di caricamento - } - else //Richiamo schermata senza parametri di caricamento - { - GUIMessage msg; - if (sc.WindowID == TrailersPluginControlID) //Se richiesta di attivazione plugin Trailers - msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_CLICKED, 0, TrailersPluginControlID, TrailersPluginControlID, 0, 0, null); - else //Caso normale di attivazione finesta MediaPortal - msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, sc.WindowID, 0, null); - - GUIWindowManager.SendMessage(msg); - //GUIGraphicsContext.SendMessage(msg); //Metodo usato dal vecchio plugin - } - lastWindowID = sc.WindowID; lastLoadParameter = sc.LoadParameter; //--> memorizzazione ultima destinazione visualizzata dal plugin - } - catch (Exception e) - { - MpLog(true, "Error going to screen", e); - } - } - private void GoToPrevious(bool soundEffect) //Ritorno alla finestra precedente - { - try - { - MpLog(false, "Go to previous window"); - - GUIGraphicsContext.ResetLastActivity(); - if (soundEffect) - Utils.PlaySound("back.wav", false, true); //--> eventuale effetto sonoro (indietro) - - GUIWindowManager.ShowPreviousWindow(); //--> visualizzazione finestra precedente - } - catch (Exception e) - { - MpLog(true, "Error going to previous window", e); - } - } - private bool AlreadyAtDestination(ShortCut sc) //Verifica se finestra attuale corrispondente a destinazione shortcut - { - if ((int)GUIWindowManager.ActiveWindow == sc.WindowID) //Prima verifica: da gestore finestre di mediaPortal - { - if (lastWindowID == sc.WindowID) //Seconda verifica: utilizzo dei parametri memorizzati dal plugin se attendibili - if (lastLoadParameter == sc.LoadParameter) //--> verifica corrispondenza eventuali parametri di caricamento per visualizzazione - { - MpLog(false, "Actual window (ID & LoadParameter) corresponds to destination, " + sc.ToString()); - return true; //--> finestra attuale e parametri di caricamento corrispondenti a destinazione shortcut - } - else - return false; //--> parametri di caricamento per visualizzazione non corrispondenti a destinazione shortcut - else //Altrimenti parametri memorizzati dal plugin non attendibili (non si riescono a verificare i parametri di caricamento) - { - if (sc.LoadParameter.Length == 0) //Se destinazione senza parametri di caricamento - { - MpLog(false, "Actual window (ID) corresponds to destination, " + sc.ToString()); - return true; //--> finestra attuale corrispondente a destinazione shortcut - } - else - return false; //--> finestra attuale non corrispondente a destinazione shortcut - } - } - else - return false; //--> finestra attuale non corrispondente a destinazione shortcut - } - #endregion - #region Metodi Pubblici public static void MpLog(bool errorLog, string description) //Registrazione evento su log di MediaPortal (senza passare l'eccezione) { @@ -196,45 +91,27 @@ #region Consumazione Eventi private void rawInput_KeyDown(object sender, KeyEventArgs e) //Evento di pressione tasto { - if (!KeyCombination.IsModifier(e.KeyCode)) //Verifica se il tasto premuto non corrisponde ad un modificatore - { - List<ShortCut> scList = myShortCuts.Items.ToList().FindAll(x => - x.Key == e.KeyCode.ToString() - && x.Ctrl == e.Control - && x.Alt == e.Alt - && x.Shift == e.Shift); //--> raccolta lista shortcut associati alla combinazione di tasti attuale - if (scList != null && scList.Count > 0) //Se trovato almeno uno shortcut - { - if (scList.Count == 1) //Shortcut a destinazione singola - { - if (scList[0].Return && AlreadyAtDestination(scList[0])) //Se impostato flag di ritorno e finestra attuale corrispondente a destinazione - GoToPrevious(scList[0].SoundEffect.Length > 0); //--> visualizzazione finestra precedente - else - GoToScreen(scList[0]); //--> visualizzazione finestra di destinazione shortcut - } - else //Shortcut a destinazione multipla (ciclico) - { - int scIndex = 0; - for (int i = 0; i < scList.Count; i++) //Iterazione di verifica se la finestra attuale corrisponde ad una delle destinazioni - { - if (AlreadyAtDestination(scList[i])) - { - scIndex = (i + 1) % scList.Count; //--> impostazione indice shortcut successivo - break; - } - } - GoToScreen(scList[scIndex]); //--> visualizzazione finestra di destinazione shortcut - } - } - else //Combinazione di tasti non corrispondente a nessuno shortcut - MpLog(false, "Key not mapped: Key=" + (e.Control ? "<CTRL>" : "") + (e.Alt ? "<ALT>" : "") + (e.Shift ? "<SHIFT>" : "") + "<" + e.KeyCode.ToString() + ">"); - } + myShortCuts.KeysReceiving(e); //--> pubblicazione a gestore shortcuts } private void GUIWindowManager_OnActivateWindow(int windowID) //Evento di attivazione finestra di MediaPortal { - if (windowID != lastWindowID) //Se attivata una finestra non corrispondente all'ultima destinazione del plugin - lastWindowID = InvalidWindowID; //--> invalidazione parametri memorizzati dal plugin + myShortCuts.WindowChanged(windowID); //--> pubblicazione a gestore shortcuts } + private void myShortCuts_Log(object sender, LogEventArgs e) + { + switch (e.LogLevel) + { + case LogEventArgs.LogLevels.Error: + if (e.LogException != null) + Tools.ErrorMessage(e.LogMessage, e.LogException.Message); //--> emissione finestra di errore (con descrizione errore) + else + Tools.ErrorMessage(e.LogMessage); //--> emissione finestra di errore + break; + case LogEventArgs.LogLevels.Info: + Tools.InfoMessage(e.LogMessage); //--> emissione finestra informativa + break; + } + } #endregion } } Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs 2014-05-01 10:43:45 UTC (rev 4792) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterConfig.cs 2014-05-03 17:38:29 UTC (rev 4793) @@ -248,9 +248,10 @@ if (mySkin.Initialized) { string settingsFile = Config.GetFile(Config.Dir.Config, Tools.MyAssembly.Name + ".xml"); - //Lettura impostazioni e gestione shorcuts - myShortCuts = new ShortCuts(settingsFile, true); - if (myShortCuts.Initialized) + + myShortCuts = new ShortCuts(settingsFile); //Creazione classe per gestione shorcuts + myShortCuts.Log += new LogEventHandler(myShortCuts_Log); //Sottoscrizione evento di log shortuts + if (myShortCuts.Initialize()) //Inizializzazione & lettura impostazioni shorcuts { //Sottoscrizione evento di modifica lista shortcuts myShortCuts.Items.ListChanged += new ListChangedEventHandler(myShortCutsItems_ListChanged); @@ -277,6 +278,23 @@ e.Cancel = true; //--> annullamento chiusura form } #endregion + #region Evento di Log Shortcuts + private void myShortCuts_Log(object sender, LogEventArgs e) + { + switch (e.LogLevel) + { + case LogEventArgs.LogLevels.Error: + if (e.LogException != null) + Tools.ErrorMessage(e.LogMessage, e.LogException.Message); //--> emissione finestra di errore (con descrizione errore) + else + Tools.ErrorMessage(e.LogMessage); //--> emissione finestra di errore + break; + case LogEventArgs.LogLevels.Info: + Tools.InfoMessage(e.LogMessage); //--> emissione finestra informativa + break; + } + } + #endregion #region Eventi Modifica Griglia private void shortCutsDataGridView_Enter(object sender, EventArgs e) { Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-01 10:43:45 UTC (rev 4792) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-05-03 17:38:29 UTC (rev 4793) @@ -3,15 +3,53 @@ using System.ComponentModel; using MediaPortal.GUI.Library; using System.IO; +using System.Linq; using System.Reflection; using System.Text; using System.Windows.Forms; using System.Xml; using MediaPortal.Profile; +using MediaPortal.Util; +using MediaPortal.Player; using My.Common; namespace ProcessPlugins.ShortCuter { + #region Delegati/Classi + public delegate void LogEventHandler(object sender, LogEventArgs e); //Delegato per evento di log + public class LogEventArgs : EventArgs //Argomenti per evento di log + { + #region Dati + private LogLevels _logLevel; //Livello di log + private string _logMessage; //Messaggio di log + private Exception _logException; //Eventuale eccezione + + public enum LogLevels //Tipologie di livelli di log + { + Debug = 0, //--> log per debug + Info = 1, //--> log informativo (necessario pubblicare all'utente) + Error = 2 //--> log di errore + } + #endregion + + #region Costruttore + public LogEventArgs(LogLevels logLevel, string logMessage) : this(logLevel, logMessage, null) { } + public LogEventArgs(LogLevels logLevel, string logMessage, Exception logException) + { + _logLevel = logLevel; //--> inizializzazione livello di log + _logMessage = logMessage; //--> inizializzazione messaggio di log + _logException = logException; //--> inizializzazione eccezione relativa al log + } + #endregion + + #region Proprietà + public LogLevels LogLevel { get { return this._logLevel; } } + public string LogMessage { get { return this._logMessage; } } + public Exception LogException { get { return this._logException; } } + #endregion + } + #endregion + internal class WindowLink //Classe collegamento ad una finestra di MediaPortal { #region Dati @@ -20,7 +58,7 @@ private string _loadParameter; //Eventuali parametri di caricamento per visualizzazione (sotto-categorie, ecc.) private const int TrailersPluginControlID = 11899; //Id controllo per attivazione plugin Trailers - internal delegate void NotifyLoadParamChanged(string loadParam); //Delegato per notifica di modifica parametri di caricamento + private const int InvalidID = -1; //Id finestra invalido #endregion #region Costruttore @@ -33,51 +71,87 @@ #endregion #region Metodi Pubblici - public void Go() //Visualizzazione finestra del collegamento (senza delegato per notifica di modifica parametri di caricamento) + public bool Go() { return Go(null); } //Visualizzazione finestra del collegamento (senza log) + public bool Go(LogEventHandler Log) //Visualizzazione finestra del collegamento { - Go(null); - } - public void Go(NotifyLoadParamChanged LoadParamChanged) //Visualizzazione finestra del collegamento - { - if (_loadParameter.Length > 0) //Se richiesti parametri di caricamento + if (_caption.Length > 0 && Log != null) + Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "Go to link destination, " + this.ToString())); + + try { - bool loadParameterChange = false; - string loadParameter = _loadParameter; - while (true) //Ricerca eventuali GUIProperties + GUIGraphicsContext.ResetLastActivity(); + + if (_loadParameter.Length > 0) //Se richiesti parametri di caricamento { - int i = loadParameter.IndexOf("(#"), ii = 0; - if (i >= 0) - ii = loadParameter.IndexOf(")", i); - if (i >= 0 && (ii > i)) + bool loadParameterChange = false; + string loadParameter = _loadParameter; + while (true) //Ricerca eventuali GUIProperties { - string propName = loadParameter.Remove(ii).Remove(0, i + 1); - if (propName.Length > 0) + int i = loadParameter.IndexOf("(#"), ii = 0; + if (i >= 0) + ii = loadParameter.IndexOf(")", i); + if (i >= 0 && (ii > i)) { - loadParameter = loadParameter.Remove(i) + GUIPropertyManager.GetProperty(propName).Trim() + loadParameter.Remove(0, ii + 1); - loadParameterChange = true; + string propName = loadParameter.Remove(ii).Remove(0, i + 1); + if (propName.Length > 0) + { + loadParameter = loadParameter.Remove(i) + GUIPropertyManager.GetProperty(propName).Trim() + loadParameter.Remove(0, ii + 1); + loadParameterChange = true; + } + else + break; } else - break; + break; } - else - break; + if (loadParameterChange && Log != null) + Log(this, new LogEventArgs(LogEventArgs.LogLevels.Debug, "GUIProperties replaced, LoadParameter=[" + loadParameter + "]")); + + GUIWindowManager.ActivateWindow(_windowID, loadParameter, true); //--> richiamo schermata con parametri di caricamento } - if (loadParameterChange && LoadParamChanged != null) - LoadParamChanged(loadParameter); //--> notifica di modifica parametri di caricamento + else //Richiamo schermata senza parametri di caricamento + { + GUIMessage msg; + if (_windowID == TrailersPluginControlID) //Se richiesta di attivazione plugin Trailers + msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_CLICKED, 0, TrailersPluginControlID, TrailersPluginControlID, 0, 0, null); + else //Caso normale di attivazione finesta MediaPortal + msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, _windowID, 0, null); - GUIWindowManager.ActivateWindow(_windowID, loadParameter, true); //--> richiamo schermata con parametri di caricamento + GUIWindowManager.SendMessage(msg); //--> invio messaggio per attivazione finestra + } + return true; //--> comando eseguito con successo } - else //Richiamo schermata senza parametri di caricamento + catch (Exception e) { - GUIMessage msg; - if (_windowID == TrailersPluginControlID) //Se richiesta di attivazione plugin Trailers - msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_CLICKED, 0, TrailersPluginControlID, TrailersPluginControlID, 0, 0, null); - else //Caso normale di attivazione finesta MediaPortal - msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, _windowID, 0, null); + if (Log != null) + Log(this, new LogEventArgs(LogEventArgs.LogLevels.Error, "Error going to window", e)); + return false; //--> comando non completato + } + } + public bool GoPrevious() { return GoPrevious(null); } //Ritorno alla finestra precedente (senza log) + public bool GoPrevious(LogEventHandler Log) //Ritorno alla finestra precedente + { + if (_caption.Length > 0 && Log != null) + Log(this, new LogEventArgs(LogEventArgs.LogLevels.Info, "Go to previous window")); - GUIWindowManager.SendMessage(msg); //--> invio messaggio per attivazione finestra + try + { + GUIGraphicsContext.ResetLastActivity(); + GUIWindowManager.ShowPreviousWindow(); //--> visualizzazione finestra precedente + return true; //--> comando eseguito con successo } + catch (Exception e) + { + if (Log != null) + Log(this, new LogEventArgs(LogEventArgs.LogLevels.Error, "Error going to previous window", e)); + return false; //--> comando non completato + } } + public void Reset() //Reset destinazione (invalidazione) + { + _windowID = InvalidID; //--> invalidazione window ID + _loadParameter = ""; //--> reset parametri di caricamento + } public override string ToString() //Override metodo ToString per stampare le proprietà del link { return ((_caption.Length > 0) ? "Link " + _caption + " " : "") + "--> WindowID=" + _windowID.ToString() + ((_loadParameter.Length > 0) ? " LoadParameter=[" + _loadParameter + "]" : ""); @@ -97,7 +171,6 @@ public string LoadParameter { get { return this._loadParameter; } set { this._loadParameter = value; } } #endregion } - internal class KeyCombination //Classe combinazione di tasti { #region Dati @@ -127,8 +200,15 @@ _key = "A"; //--> inizializzazione tasto _ctrl = true; //--> inizializzazione utilizzo del modificatore "Ctrl" _alt = false; //--> inizializzazione utilizzo del modificatore "Alt" - _shift = true; //--> inizializzazione utilizzo del modificatore "Shift" } + _shift = true; //--> inizializzazione utilizzo del modificatore "Shift" } + public KeyCombination(KeyEventArgs k) //Costruttore classe KeyCombination da evento di pressione tasto + { + _key = k.KeyCode.ToString(); //--> assegnazione tasto + _ctrl = k.Control; //--> utilizzo del modificatore "Ctrl" + _alt = k.Alt; //--> utilizzo del modificatore "Alt" + _shift = k.Shift; //--> utilizzo del modificatore "Shift" + } #endregion #region Metodi Pubblici @@ -160,7 +240,6 @@ public bool Shift { get { return this._shift; } set { this._shift = value; } } #endregion } - internal class ShortCut : INotifyPropertyChanged //Classe shortcut (scorciatoia da tastiera) con notifica variazione proprietà { #region Dati @@ -174,12 +253,12 @@ #region Costruttore public ShortCut() //Costruttore classe ShortCut { - _caption = "ShortCut"; //--> inizializzazione titolo - _keys = new KeyCombination(); //--> istanziazione classe KeyCombination - _destination = new WindowLink(); //--> istanziazione classe WindowLink + _caption = "ShortCut"; //--> inizializzazione titolo + _keys = new KeyCombination(); //--> istanziazione classe KeyCombination + _destination = new WindowLink(); //--> istanziazione classe WindowLink _destination.Caption = ""; //--> reset caption destinazione (gestita caption shortcut) - _return = false; //--> inizializzazione ritorno a finestra ... [truncated message content] |
From: <seb...@us...> - 2014-05-01 10:43:48
|
Revision: 4792 http://sourceforge.net/p/mp-plugins/code/4792 Author: sebastiii Date: 2014-05-01 10:43:45 +0000 (Thu, 01 May 2014) Log Message: ----------- Add external bin (based on 1.7.1) and fix AssemblyInfo for proper SubsystemVersions. Modified Paths: -------------- trunk/plugins/MyStreamradioV2/Source/MyStreamRadio/MyStreamRadio.csproj trunk/plugins/MyStreamradioV2/Source/MyStreamRadio/Properties/AssemblyInfo.cs trunk/plugins/MyStreamradioV2/Source/MyStreamRadio/Properties/Resources.Designer.cs Added Paths: ----------- trunk/plugins/MyStreamradioV2/Source/External/ trunk/plugins/MyStreamradioV2/Source/External/Bass.Net.dll trunk/plugins/MyStreamradioV2/Source/External/Common.Utils.dll trunk/plugins/MyStreamradioV2/Source/External/Core.dll trunk/plugins/MyStreamradioV2/Source/External/Databases.dll trunk/plugins/MyStreamradioV2/Source/External/Dialogs.dll trunk/plugins/MyStreamradioV2/Source/External/Utils.dll Added: trunk/plugins/MyStreamradioV2/Source/External/Bass.Net.dll =================================================================== (Binary files differ) Index: trunk/plugins/MyStreamradioV2/Source/External/Bass.Net.dll =================================================================== --- trunk/plugins/MyStreamradioV2/Source/External/Bass.Net.dll 2014-04-30 20:28:38 UTC (rev 4791) +++ trunk/plugins/MyStreamradioV2/Source/External/Bass.Net.dll 2014-05-01 10:43:45 UTC (rev 4792) Property changes on: trunk/plugins/MyStreamradioV2/Source/External/Bass.Net.dll ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: trunk/plugins/MyStreamradioV2/Source/External/Common.Utils.dll =================================================================== (Binary files differ) Index: trunk/plugins/MyStreamradioV2/Source/External/Common.Utils.dll =================================================================== --- trunk/plugins/MyStreamradioV2/Source/External/Common.Utils.dll 2014-04-30 20:28:38 UTC (rev 4791) +++ trunk/plugins/MyStreamradioV2/Source/External/Common.Utils.dll 2014-05-01 10:43:45 UTC (rev 4792) Property changes on: trunk/plugins/MyStreamradioV2/Source/External/Common.Utils.dll ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: trunk/plugins/MyStreamradioV2/Source/External/Core.dll =================================================================== (Binary files differ) Index: trunk/plugins/MyStreamradioV2/Source/External/Core.dll =================================================================== --- trunk/plugins/MyStreamradioV2/Source/External/Core.dll 2014-04-30 20:28:38 UTC (rev 4791) +++ trunk/plugins/MyStreamradioV2/Source/External/Core.dll 2014-05-01 10:43:45 UTC (rev 4792) Property changes on: trunk/plugins/MyStreamradioV2/Source/External/Core.dll ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: trunk/plugins/MyStreamradioV2/Source/External/Databases.dll =================================================================== (Binary files differ) Index: trunk/plugins/MyStreamradioV2/Source/External/Databases.dll =================================================================== --- trunk/plugins/MyStreamradioV2/Source/External/Databases.dll 2014-04-30 20:28:38 UTC (rev 4791) +++ trunk/plugins/MyStreamradioV2/Source/External/Databases.dll 2014-05-01 10:43:45 UTC (rev 4792) Property changes on: trunk/plugins/MyStreamradioV2/Source/External/Databases.dll ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: trunk/plugins/MyStreamradioV2/Source/External/Dialogs.dll =================================================================== (Binary files differ) Index: trunk/plugins/MyStreamradioV2/Source/External/Dialogs.dll =================================================================== --- trunk/plugins/MyStreamradioV2/Source/External/Dialogs.dll 2014-04-30 20:28:38 UTC (rev 4791) +++ trunk/plugins/MyStreamradioV2/Source/External/Dialogs.dll 2014-05-01 10:43:45 UTC (rev 4792) Property changes on: trunk/plugins/MyStreamradioV2/Source/External/Dialogs.dll ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: trunk/plugins/MyStreamradioV2/Source/External/Utils.dll =================================================================== (Binary files differ) Index: trunk/plugins/MyStreamradioV2/Source/External/Utils.dll =================================================================== --- trunk/plugins/MyStreamradioV2/Source/External/Utils.dll 2014-04-30 20:28:38 UTC (rev 4791) +++ trunk/plugins/MyStreamradioV2/Source/External/Utils.dll 2014-05-01 10:43:45 UTC (rev 4792) Property changes on: trunk/plugins/MyStreamradioV2/Source/External/Utils.dll ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Modified: trunk/plugins/MyStreamradioV2/Source/MyStreamRadio/MyStreamRadio.csproj =================================================================== --- trunk/plugins/MyStreamradioV2/Source/MyStreamRadio/MyStreamRadio.csproj 2014-04-30 20:28:38 UTC (rev 4791) +++ trunk/plugins/MyStreamradioV2/Source/MyStreamRadio/MyStreamRadio.csproj 2014-05-01 10:43:45 UTC (rev 4792) @@ -15,7 +15,7 @@ <UpgradeBackupLocation> </UpgradeBackupLocation> <OldToolsVersion>3.5</OldToolsVersion> - <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkProfile /> <PublishUrl>publish\</PublishUrl> <Install>true</Install> @@ -56,27 +56,27 @@ <ItemGroup> <Reference Include="Bass.Net, Version=2.4.4.3, Culture=neutral, PublicKeyToken=b7566c273e6ef480, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\..\..\..\Program Files\Team MediaPortal\MediaPortal\Bass.Net.dll</HintPath> + <HintPath>..\External\Bass.Net.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="Common.Utils, Version=1.1.7.0, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\..\..\..\Program Files\Team MediaPortal\MediaPortal\Common.Utils.dll</HintPath> + <HintPath>..\External\Common.Utils.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="Core, Version=1.0.5.32056, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\..\..\..\Program Files\Team MediaPortal\MediaPortal\Core.dll</HintPath> + <HintPath>..\External\Core.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="Databases, Version=1.0.5.32058, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\..\..\..\Program Files\Team MediaPortal\MediaPortal\Databases.dll</HintPath> + <HintPath>..\External\Databases.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="Dialogs, Version=1.0.5.32061, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\..\..\..\Program Files\Team MediaPortal\MediaPortal\plugins\Windows\Dialogs.dll</HintPath> + <HintPath>..\External\Dialogs.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="System" /> @@ -87,7 +87,7 @@ <Reference Include="System.Xml" /> <Reference Include="Utils, Version=2.2.7.32052, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\..\..\..\Program Files\Team MediaPortal\MediaPortal\Utils.dll</HintPath> + <HintPath>..\External\Utils.dll</HintPath> <Private>False</Private> </Reference> </ItemGroup> Modified: trunk/plugins/MyStreamradioV2/Source/MyStreamRadio/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/MyStreamradioV2/Source/MyStreamRadio/Properties/AssemblyInfo.cs 2014-04-30 20:28:38 UTC (rev 4791) +++ trunk/plugins/MyStreamradioV2/Source/MyStreamRadio/Properties/AssemblyInfo.cs 2014-05-01 10:43:45 UTC (rev 4792) @@ -3,7 +3,8 @@ using System.Runtime.InteropServices; using MediaPortal.Common.Utils; -[assembly: CompatibleVersion("1.1.6.27644")] +// Define that our plugin is designed for MediaPortal 1.7 - the MP dlls have been slightly restructured and it's using .net 4 now, so not backward compatible +[assembly: CompatibleVersion("1.7.000.0", "1.7.000.0")] // Allgemeine Informationen über eine Assembly werden über die folgenden // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, // die mit einer Assembly verknüpft sind. @@ -35,3 +36,9 @@ // übernehmen, indem Sie "*" eingeben: [assembly: AssemblyVersion("0.6.5.1")] [assembly: AssemblyFileVersion("0.6.5.1")] + +// Tell MediaPortal which subsystems this plugin will use, so it can check for compatiblity +[assembly: UsesSubsystem("MP.SkinEngine")] +[assembly: UsesSubsystem("MP.Plugins.Music")] +[assembly: UsesSubsystem("MP.Config")] +[assembly: UsesSubsystem("MP.Externals.BASS")] Modified: trunk/plugins/MyStreamradioV2/Source/MyStreamRadio/Properties/Resources.Designer.cs =================================================================== --- trunk/plugins/MyStreamradioV2/Source/MyStreamRadio/Properties/Resources.Designer.cs 2014-04-30 20:28:38 UTC (rev 4791) +++ trunk/plugins/MyStreamradioV2/Source/MyStreamRadio/Properties/Resources.Designer.cs 2014-05-01 10:43:45 UTC (rev 4792) @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ // <auto-generated> -// Dieser Code wurde von einem Tool generiert. -// Laufzeitversion:2.0.50727.3082 +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 // -// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn -// der Code erneut generiert wird. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ @@ -13,13 +13,13 @@ /// <summary> - /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// A strongly-typed resource class, for looking up localized strings, etc. /// </summary> - // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert - // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. - // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen - // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { @@ -33,7 +33,7 @@ } /// <summary> - /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// Returns the cached ResourceManager instance used by this class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { @@ -47,8 +47,8 @@ } /// <summary> - /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle - /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2014-04-30 20:28:41
|
Revision: 4791 http://sourceforge.net/p/mp-plugins/code/4791 Author: nicsergio Date: 2014-04-30 20:28:38 +0000 (Wed, 30 Apr 2014) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-04-28 17:43:49 UTC (rev 4790) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2014-04-30 20:28:38 UTC (rev 4791) @@ -12,7 +12,7 @@ namespace ProcessPlugins.ShortCuter { - internal class ScreenLink //Classe collegamento ad una finestra di MediaPortal + internal class WindowLink //Classe collegamento ad una finestra di MediaPortal { #region Dati private string _caption; //Titolo link @@ -20,11 +20,11 @@ private string _loadParameter; //Eventuali parametri di caricamento per visualizzazione (sotto-categorie, ecc.) private const int TrailersPluginControlID = 11899; //Id controllo per attivazione plugin Trailers - internal delegate string NotifyLoadParamChanged(); //Delegato per evento di modifica parametri di caricamento + internal delegate void NotifyLoadParamChanged(string loadParam); //Delegato per notifica di modifica parametri di caricamento #endregion #region Costruttore - public ScreenLink() //Costruttore classe ScreenLink + public WindowLink() //Costruttore classe WindowLink { _caption = "Link"; //--> inizializzazione titolo _windowID = 0; //--> inizializzazione window ID @@ -33,9 +33,12 @@ #endregion #region Metodi Pubblici - - public void Go(NotifyLoadParamChanged eee) //Visualizzazione finestra del collegamento + public void Go() //Visualizzazione finestra del collegamento (senza delegato per notifica di modifica parametri di caricamento) { + Go(null); + } + public void Go(NotifyLoadParamChanged LoadParamChanged) //Visualizzazione finestra del collegamento + { if (_loadParameter.Length > 0) //Se richiesti parametri di caricamento { bool loadParameterChange = false; @@ -59,8 +62,8 @@ else break; } - if (loadParameterChange && (LoadParamChg != null)) - LoadParamChg(loadParameter); //--> richiamo dell'evento di modifica parametri di caricamento + if (loadParameterChange && LoadParamChanged != null) + LoadParamChanged(loadParameter); //--> notifica di modifica parametri di caricamento GUIWindowManager.ActivateWindow(_windowID, loadParameter, true); //--> richiamo schermata con parametri di caricamento } @@ -81,10 +84,6 @@ } #endregion - #region Eventi - public event LoadParamChgEventHandler LoadParamChg; //Evento di modifica parametri di caricamento - #endregion - #region Proprietà public bool IsValid { @@ -167,7 +166,7 @@ #region Dati private string _caption; //Titolo link private KeyCombination _keys; //Combinazione di tasti per attivazione shortcut - private ScreenLink _destination; //Destinazione dello shortcut + private WindowLink _destination; //Destinazione dello shortcut private bool _return; //Ritorno a finestra precedente se si è già a destinazione private string _soundEffect; //File relativo all'eventuale effetto sonoro #endregion @@ -177,7 +176,7 @@ { _caption = "ShortCut"; //--> inizializzazione titolo _keys = new KeyCombination(); //--> istanziazione classe KeyCombination - _destination = new ScreenLink(); //--> istanziazione classe Screenlink + _destination = new WindowLink(); //--> istanziazione classe WindowLink _destination.Caption = ""; //--> reset caption destinazione (gestita caption shortcut) _return = false; //--> inizializzazione ritorno a finestra precedente se si è già a destinazione _soundEffect = "click.wav"; //--> inizializzazione effetto sonoro @@ -196,15 +195,15 @@ public ShortCut Clone() //Clonazione shortcut { ShortCut sc = new ShortCut(); - sc.Caption = _caption; - sc.Key = _keys.Key; - sc.Ctrl = _keys.Ctrl; - sc.Alt = _keys.Alt; - sc.Shift = _keys.Shift; - sc.WindowID = _destination.WindowID; + sc.Caption = _caption; + sc.Key = _keys.Key; + sc.Ctrl = _keys.Ctrl; + sc.Alt = _keys.Alt; + sc.Shift = _keys.Shift; + sc.WindowID = _destination.WindowID; sc.LoadParameter = _destination.LoadParameter; - sc.Return = _return; - sc.SoundEffect = _soundEffect; + sc.Return = _return; + sc.SoundEffect = _soundEffect; return sc; } public override string ToString() //Override metodo ToString per stampare le proprietà dello shortcut @@ -247,6 +246,8 @@ private GeneralSettings _general = new GeneralSettings(); //Impostazioni generali plugin private BindingList<ShortCut> _items = new BindingList<ShortCut>(); //Lista (con associazione dati) degli shortcuts configurati private bool _initialized; //Classe inizializzata + + //internal delegate void (string loadParam); //Delegato per notifica di modifica parametri di caricamento #endregion #region Costruttore This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |