|
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.
|