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