|
From: <nic...@us...> - 2014-06-16 17:28:24
|
Revision: 4840
http://sourceforge.net/p/mp-plugins/code/4840
Author: nicsergio
Date: 2014-06-16 17:28:20 +0000 (Mon, 16 Jun 2014)
Log Message:
-----------
Modified Paths:
--------------
trunk/plugins/ShortCuter&SkinEditor/Source/Common/Skin.cs
trunk/plugins/ShortCuter&SkinEditor/Source/Common/Tools.cs
trunk/plugins/ShortCuter&SkinEditor/Source/Common/VersionInfo.cs
trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.cs
trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinWithSounds.cs
trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/NavigatorDialog.cs
trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/ShortCuter.cs
trunk/plugins/ShortCuter&SkinEditor/Source/XtremeMenuEditor/BHEditor.cs
trunk/plugins/ShortCuter&SkinEditor/Source/XtremeMenuEditor/MediaPortal.cs
trunk/plugins/ShortCuter&SkinEditor/Source/XtremeMenuEditor/Menu.cs
Modified: trunk/plugins/ShortCuter&SkinEditor/Source/Common/Skin.cs
===================================================================
--- trunk/plugins/ShortCuter&SkinEditor/Source/Common/Skin.cs 2014-06-16 14:56:35 UTC (rev 4839)
+++ trunk/plugins/ShortCuter&SkinEditor/Source/Common/Skin.cs 2014-06-16 17:28:20 UTC (rev 4840)
@@ -67,7 +67,7 @@
{
if (!Directory.Exists(_paths.Skin))
{
- Tools.ErrorMessage("Skin folder not found!", _paths.Skin);
+ DialogHelper.Error("Skin folder not found!", _paths.Skin);
return false;
}
string[] files = Directory.GetFiles(_paths.Skin); //--> lettura file da disco
@@ -96,7 +96,7 @@
return true; //--> raccolta files effettuata
else
{
- Tools.ErrorMessage("No skin files found.", _paths.Skin);
+ DialogHelper.Error("No skin files found.", _paths.Skin);
return false;
}
}
@@ -113,7 +113,7 @@
}
catch (Exception e)
{
- Tools.ErrorMessage("Error loading PopularSkinLinks.xml.", e.Message);
+ DialogHelper.Error("Error loading PopularSkinLinks.xml.", e.Message);
return false;
}
@@ -131,7 +131,7 @@
return true; //--> raccolta links effettuata
else
{
- Tools.ErrorMessage("No skin links found loading PopularSkinLinks.xml.");
+ DialogHelper.Error("No skin links found loading PopularSkinLinks.xml.");
return false;
}
}
Modified: trunk/plugins/ShortCuter&SkinEditor/Source/Common/Tools.cs
===================================================================
--- trunk/plugins/ShortCuter&SkinEditor/Source/Common/Tools.cs 2014-06-16 14:56:35 UTC (rev 4839)
+++ trunk/plugins/ShortCuter&SkinEditor/Source/Common/Tools.cs 2014-06-16 17:28:20 UTC (rev 4840)
@@ -9,110 +9,92 @@
namespace My.Common
{
- internal static class Tools //Collezione utilità
+ internal static class ExecutingAssembly //Classe per accesso alle proprietà assembly in esecuzione
{
- #region Classi
- public static class MyAssembly //Classe per accesso alle proprietà assembly in esecuzione
+ #region Dati
+ public static readonly string Name; //Nome progetto
+ public static readonly string Title; //Titolo
+ public static readonly string File; //File binario
+ public static readonly string Path; //Percorso del file binario
+ public static readonly string Version; //Versione
+ public static readonly string Description; //Descrizione (breve)
+ public static readonly string Author; //Autore
+ public static readonly string BuildDate; //Data & ora di compilazione
+ #endregion
+
+ #region Costruttore
+ static ExecutingAssembly()
{
- #region Dati
- public static readonly string Name; //Nome progetto
- public static readonly string Title; //Titolo
- public static readonly string File; //File binario
- public static readonly string Path; //Percorso del file binario
- public static readonly string Version; //Versione
- public static readonly string Description; //Descrizione (breve)
- public static readonly string Author; //Autore
- public static readonly string BuildDate; //Data & ora di compilazione
- #endregion
+ Assembly myAssembly = Assembly.GetExecutingAssembly(); //Raccolta informazioni assembly in esecuzione
+ Name = myAssembly.GetName().Name.ToString();
+ Title = ((AssemblyTitleAttribute)myAssembly.GetCustomAttributes(typeof(AssemblyTitleAttribute), false)[0]).Title;
+ File = System.IO.Path.GetFileName(myAssembly.Location);
+ Path = System.IO.Path.GetDirectoryName(myAssembly.Location) + @"\";
+ Version = myAssembly.GetName().Version.ToString();
+ Description = ((AssemblyDescriptionAttribute)myAssembly.GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false)[0]).Description;
+ Author = ((AssemblyCompanyAttribute)myAssembly.GetCustomAttributes(typeof(AssemblyCompanyAttribute), false)[0]).Company;
+ BuildDate = RetrieveLinkerTimestamp(myAssembly.Location);
+ }
+ #endregion
- #region Costruttore
- static MyAssembly()
+ #region Metodi Privati
+ private static string RetrieveLinkerTimestamp(string filePath) //Lettura data & ora di compilazione di un assembly
+ {
+ const int c_PeHeaderOffset = 60;
+ const int c_LinkerTimestampOffset = 8;
+ byte[] b = new byte[2048];
+ System.IO.Stream s = null;
+
+ try
{
- Assembly myAssembly = Assembly.GetExecutingAssembly(); //Raccolta informazioni assembly in esecuzione
- Name = myAssembly.GetName().Name.ToString();
- Title = ((AssemblyTitleAttribute)myAssembly.GetCustomAttributes(typeof(AssemblyTitleAttribute), false)[0]).Title;
- File = System.IO.Path.GetFileName(myAssembly.Location);
- Path = System.IO.Path.GetDirectoryName(myAssembly.Location) + @"\";
- Version = myAssembly.GetName().Version.ToString();
- Description = ((AssemblyDescriptionAttribute)myAssembly.GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false)[0]).Description;
- Author = ((AssemblyCompanyAttribute)myAssembly.GetCustomAttributes(typeof(AssemblyCompanyAttribute), false)[0]).Company;
- BuildDate = RetrieveLinkerTimestamp(myAssembly.Location);
+ s = new System.IO.FileStream(filePath, System.IO.FileMode.Open, System.IO.FileAccess.Read);
+ s.Read(b, 0, 2048);
}
- #endregion
-
- #region Metodi Privati
- private static string RetrieveLinkerTimestamp(string filePath) //Lettura data & ora di compilazione di un assembly
+ finally
{
- const int c_PeHeaderOffset = 60;
- const int c_LinkerTimestampOffset = 8;
- byte[] b = new byte[2048];
- System.IO.Stream s = null;
+ if (s != null)
+ s.Close();
+ }
- try
- {
- s = new System.IO.FileStream(filePath, System.IO.FileMode.Open, System.IO.FileAccess.Read);
- s.Read(b, 0, 2048);
- }
- finally
- {
- if (s != null)
- s.Close();
- }
-
- int i = System.BitConverter.ToInt32(b, c_PeHeaderOffset);
- int secondsSince1970 = System.BitConverter.ToInt32(b, i + c_LinkerTimestampOffset);
- DateTime dt = new DateTime(1970, 1, 1, 0, 0, 0);
- dt = dt.AddSeconds(secondsSince1970);
- dt = dt.AddHours(TimeZone.CurrentTimeZone.GetUtcOffset(dt).Hours);
- return dt.ToString();
- }
- #endregion
+ int i = System.BitConverter.ToInt32(b, c_PeHeaderOffset);
+ int secondsSince1970 = System.BitConverter.ToInt32(b, i + c_LinkerTimestampOffset);
+ DateTime dt = new DateTime(1970, 1, 1, 0, 0, 0);
+ dt = dt.AddSeconds(secondsSince1970);
+ dt = dt.AddHours(TimeZone.CurrentTimeZone.GetUtcOffset(dt).Hours);
+ return dt.ToString();
}
#endregion
-
+ }
+ internal static class DialogHelper //Classe per gestire velocemente finestre di dialogo
+ {
#region Dati
- private static readonly string MessageHeader = MyAssembly.Title; //Intestazione messaggi (titolo assembly)
+ private static readonly string MessageHeader = ExecutingAssembly.Title; //Intestazione messaggi (titolo assembly)
#endregion
#region Metodi Pubblici
- #region Finestre di Dialogo
- public static void ErrorMessage(string description) //Emissione messaggio di errore (senza errore specifico)
+ public static void Error(string description) //Emissione messaggio di errore (senza errore specifico)
{
- ErrorMessage(description, string.Empty); //--> override metodo per parametro opzionale
+ Error(description, string.Empty); //--> override metodo per parametro opzionale
}
- public static void ErrorMessage(string description, string error) //Emissione messaggio di errore (con errore specifico)
+ public static void Error(string description, string error) //Emissione messaggio di errore (con errore specifico)
{
if (error.Length > 0)
description += string.Format("\n\n[{0}]", error); //--> composizione stringa descrizione per errore specifico
MessageBox.Show(description, MessageHeader, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
}
- public static void InfoMessage(string description) //Emissione messaggio informativo
+ public static void Info(string description) //Emissione messaggio informativo
{
MessageBox.Show(description, MessageHeader, MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
}
- public static bool QuestionMessage(string question) //Emissione messaggio di conferma
+ public static bool Question(string question) //Emissione messaggio di conferma
{
DialogResult ret = MessageBox.Show(question, MessageHeader, MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
return (ret == DialogResult.OK);
}
#endregion
- #region Metodi Grafici
- public static void RoundEdges(Control winControl, int radius) //Arrotondamento spigoli controllo grafico (raggiature simmetriche)
- {
- RoundEdges(winControl, radius, radius);
- }
- public static void RoundEdges(Control winControl, int wRadius, int hRadius) //Arrotondamento spigoli controllo grafico
- {
- Rectangle r = new Rectangle(-1, -1, winControl.Width + 1, winControl.Height + 1);
- GraphicsPath gp = new GraphicsPath();
- gp.AddArc(r.X, r.Y, wRadius, hRadius, 180, 90);
- gp.AddArc(r.X + r.Width - wRadius, r.Y, wRadius, hRadius, 270, 90);
- gp.AddArc(r.X + r.Width - wRadius, r.Y + r.Height - hRadius, wRadius, hRadius, 0, 90);
- gp.AddArc(r.X, r.Y + r.Height - hRadius, wRadius, hRadius, 90, 90);
- winControl.Region = new Region(gp);
- }
- #endregion
- #region Enum con Descrizioni
+ }
+ internal static class EnumHelper //Classe per gestione enumerativi con descrizione
+ {
public static string GetEnumDescription(Enum enumValue) //Ottenimento descrizione enumerativo
{
FieldInfo fi = enumValue.GetType().GetField(enumValue.ToString());
@@ -140,7 +122,22 @@
strings.Add(GetEnumDescription(e));
return strings;
}
- #endregion
- #endregion
}
+ internal static class GraphTools //Classe di utilità grafiche
+ {
+ public static void RoundEdges(Control winControl, int radius) //Arrotondamento spigoli controllo grafico (raggiature simmetriche)
+ {
+ RoundEdges(winControl, radius, radius);
+ }
+ public static void RoundEdges(Control winControl, int wRadius, int hRadius) //Arrotondamento spigoli controllo grafico
+ {
+ Rectangle r = new Rectangle(-1, -1, winControl.Width + 1, winControl.Height + 1);
+ GraphicsPath gp = new GraphicsPath();
+ gp.AddArc(r.X, r.Y, wRadius, hRadius, 180, 90);
+ gp.AddArc(r.X + r.Width - wRadius, r.Y, wRadius, hRadius, 270, 90);
+ gp.AddArc(r.X + r.Width - wRadius, r.Y + r.Height - hRadius, wRadius, hRadius, 0, 90);
+ gp.AddArc(r.X, r.Y + r.Height - hRadius, wRadius, hRadius, 90, 90);
+ winControl.Region = new Region(gp);
+ }
+ }
}
Modified: trunk/plugins/ShortCuter&SkinEditor/Source/Common/VersionInfo.cs
===================================================================
--- trunk/plugins/ShortCuter&SkinEditor/Source/Common/VersionInfo.cs 2014-06-16 14:56:35 UTC (rev 4839)
+++ trunk/plugins/ShortCuter&SkinEditor/Source/Common/VersionInfo.cs 2014-06-16 17:28:20 UTC (rev 4840)
@@ -28,14 +28,14 @@
{ //Visualizzazione informazioni sulla versione
myVersionInfo = new VersionInfo();
myVersionInfo.logoPictureBox.Image = logo; //--> logo applicazione
- Tools.RoundEdges(myVersionInfo, 75, 50); //--> arrotondamento spigoli form
+ GraphTools.RoundEdges(myVersionInfo, 75, 50); //--> arrotondamento spigoli form
- myVersionInfo.versionLabel.Text = Tools.MyAssembly.Version;
- myVersionInfo.fileLabel.Text = Tools.MyAssembly.File;
- myVersionInfo.titleLabel.Text = Tools.MyAssembly.Title;
- myVersionInfo.descriptionLabel.Text = Tools.MyAssembly.Description;
- myVersionInfo.authorLabel.Text = Tools.MyAssembly.Author;
- myVersionInfo.buildDateLabel.Text = Tools.MyAssembly.BuildDate;
+ myVersionInfo.versionLabel.Text = ExecutingAssembly.Version;
+ myVersionInfo.fileLabel.Text = ExecutingAssembly.File;
+ myVersionInfo.titleLabel.Text = ExecutingAssembly.Title;
+ myVersionInfo.descriptionLabel.Text = ExecutingAssembly.Description;
+ myVersionInfo.authorLabel.Text = ExecutingAssembly.Author;
+ myVersionInfo.buildDateLabel.Text = ExecutingAssembly.BuildDate;
if (comment.Length > 0) //Eventuale visualizzazione commento
{
Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.cs
===================================================================
--- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.cs 2014-06-16 14:56:35 UTC (rev 4839)
+++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.cs 2014-06-16 17:28:20 UTC (rev 4840)
@@ -247,7 +247,7 @@
}
if (mySkin.Initialized)
{
- string settingsFile = Config.GetFile(Config.Dir.Config, Tools.MyAssembly.Name + ".xml");
+ string settingsFile = Config.GetFile(Config.Dir.Config, ExecutingAssembly.Name + ".xml");
myShortCuts = new ShortCuts(settingsFile); //Creazione classe per gestione shorcuts
myShortCuts.Log += new LogEventHandler(myShortCuts_Log); //Sottoscrizione evento di log shortuts
@@ -276,7 +276,7 @@
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?"))
+ if (unsavedChanges && !DialogHelper.Question("Unsaved changes will be lost...\nDo you want to proceed?"))
{
e.Cancel = true; //--> annullamento chiusura form
return;
@@ -292,12 +292,12 @@
{
case LogEventArgs.LogLevels.Error:
if (e.LogException != null)
- Tools.ErrorMessage(e.LogMessage, e.LogException.Message); //--> emissione finestra di errore (con descrizione errore)
+ DialogHelper.Error(e.LogMessage, e.LogException.Message); //--> emissione finestra di errore (con descrizione errore)
else
- Tools.ErrorMessage(e.LogMessage); //--> emissione finestra di errore
+ DialogHelper.Error(e.LogMessage); //--> emissione finestra di errore
break;
case LogEventArgs.LogLevels.Info:
- Tools.InfoMessage(e.LogMessage); //--> emissione finestra informativa
+ DialogHelper.Info(e.LogMessage); //--> emissione finestra informativa
break;
}
}
@@ -461,7 +461,7 @@
}
private void resetButton_Click(object sender, EventArgs e)
{
- if (Tools.QuestionMessage("Configuration data will be overwritten...\nDo you want to proceed?"))
+ if (DialogHelper.Question("Configuration data will be overwritten...\nDo you want to proceed?"))
{
myShortCuts.LoadConfig(true);
}
@@ -481,15 +481,15 @@
#region Implementazione ISetupForm
public string PluginName()
{
- return Tools.MyAssembly.Title;
+ return ExecutingAssembly.Title;
}
public string Description()
{
- return Tools.MyAssembly.Description;
+ return ExecutingAssembly.Description;
}
public string Author()
{
- return Tools.MyAssembly.Author;
+ return ExecutingAssembly.Author;
}
public void ShowPlugin()
{
Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinWithSounds.cs
===================================================================
--- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinWithSounds.cs 2014-06-16 14:56:35 UTC (rev 4839)
+++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinWithSounds.cs 2014-06-16 17:28:20 UTC (rev 4840)
@@ -23,7 +23,7 @@
DirectoryInfo dInfo = new DirectoryInfo(_paths.Sounds);
if (!dInfo.Exists)
{
- Tools.ErrorMessage("Skin sounds folder not found!", _paths.Sounds);
+ DialogHelper.Error("Skin sounds folder not found!", _paths.Sounds);
return false;
}
foreach (FileInfo fInfo in dInfo.GetFiles()) //Iterazione per applicazione filtro e memorizzazione dati
@@ -38,7 +38,7 @@
}
else
{
- Tools.ErrorMessage("No sounds found.", _paths.Sounds);
+ DialogHelper.Error("No sounds found.", _paths.Sounds);
return false;
}
}
Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/NavigatorDialog.cs
===================================================================
--- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/NavigatorDialog.cs 2014-06-16 14:56:35 UTC (rev 4839)
+++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/NavigatorDialog.cs 2014-06-16 17:28:20 UTC (rev 4840)
@@ -41,7 +41,7 @@
}
public override string GetModuleName() //Override metodo GetModuleName
{
- return Tools.MyAssembly.Title; //--> ritorno del titolo dell'assembly
+ return ExecutingAssembly.Title; //--> ritorno del titolo dell'assembly
}
protected override void OnWindowLoaded() //Override metodo OnWindowLoaded
{
@@ -69,7 +69,7 @@
protected override void OnPageLoad() //Override metodo OnPageLoad
{
base.OnPageLoad();
- lblHeading2.Label = Tools.MyAssembly.Title; //--> forzatura label "Menu"
+ lblHeading2.Label = ExecutingAssembly.Title; //--> forzatura label "Menu"
int navControlId = 0;
if (!_panelView) //Visualizzazione a lista
Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/ShortCuter.cs
===================================================================
--- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/ShortCuter.cs 2014-06-16 14:56:35 UTC (rev 4839)
+++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Plugin/ShortCuter.cs 2014-06-16 17:28:20 UTC (rev 4840)
@@ -18,7 +18,7 @@
#region Costruttore
static ShortCuter() //Costruttore classe ShortCuter
{
- LogPrefix = Tools.MyAssembly.Title + ": "; //Header per log su file (titolo assembly)
+ LogPrefix = ExecutingAssembly.Title + ": "; //Header per log su file (titolo assembly)
}
#endregion
@@ -27,7 +27,7 @@
{
MpLog(new LogEventArgs(LogEventArgs.LogLevels.Info, "Plugin started"));
- string settingsFile = Config.GetFile(Config.Dir.Config, Tools.MyAssembly.Name + ".xml");
+ string settingsFile = Config.GetFile(Config.Dir.Config, ExecutingAssembly.Name + ".xml");
myShortCuts = new ShortCuts(settingsFile); //Creazione classe per gestione shorcuts
myShortCuts.Log += new LogEventHandler(myShortCuts_Log); //--> sottoscrizione evento di log shortuts
@@ -74,7 +74,7 @@
}
public override string GetModuleName() //Valorizzazione proprietà #currentmodule al caricamento
{
- return Tools.MyAssembly.Title;
+ return ExecutingAssembly.Title;
}
public override int GetID { get { return (NavigatorDialog.DialogWindowID + 1); } } //--> id finestra (deve avere un valore >0 e diverso da NavigatorDialog)
#endregion
Modified: trunk/plugins/ShortCuter&SkinEditor/Source/XtremeMenuEditor/BHEditor.cs
===================================================================
--- trunk/plugins/ShortCuter&SkinEditor/Source/XtremeMenuEditor/BHEditor.cs 2014-06-16 14:56:35 UTC (rev 4839)
+++ trunk/plugins/ShortCuter&SkinEditor/Source/XtremeMenuEditor/BHEditor.cs 2014-06-16 17:28:20 UTC (rev 4840)
@@ -80,7 +80,7 @@
fanartHandlerPictureBox.Parent = backgroundPictureBox;
fanartHandlerPictureBox.Location = new Point(fanartHandlerPictureBox.Location.X - backgroundPictureBox.Location.X,
fanartHandlerPictureBox.Location.Y - backgroundPictureBox.Location.Y);
- Tools.RoundEdges(backgroundPictureBox, 45);
+ GraphTools.RoundEdges(backgroundPictureBox, 45);
toolTip.SetToolTip(menuRowAddButton, "Add menu item to list");
toolTip.SetToolTip(menuRowRemoveButton, "Remove selected menu item from list");
@@ -385,7 +385,7 @@
{
if (captionTextBox.Text.Length == 0)
{
- Tools.InfoMessage("A caption is requested.");
+ DialogHelper.Info("A caption is requested.");
return;
}
MenuItem mItem = new MenuItem();
@@ -430,12 +430,12 @@
{
if (captionTextBox.Text.Length == 0)
{
- Tools.InfoMessage("A caption is requested.");
+ DialogHelper.Info("A caption is requested.");
return;
}
if (contextTextBox.Text.Length > 0 || multiImageRadioButton.Checked || fanartRadioButton.Checked || overlayComboBox.SelectedIndex > 0)
- Tools.InfoMessage("Sub-menu items limitations:\n" +
+ DialogHelper.Info("Sub-menu items limitations:\n" +
" - only support single background image (no multi-image, no fanart)\n" +
" - do not support overlay\n" +
" - do not display context labels" );
@@ -504,7 +504,7 @@
myMediaPortal = new MediaPortal(SkinName);
if (myMediaPortal.Initialized)
{
- string settingsFile = MediaPortal.ConfigPath + Tools.MyAssembly.Name + ".xml";
+ string settingsFile = MediaPortal.ConfigPath + ExecutingAssembly.Name + ".xml";
//Lettura impostazioni e gestione menu
myMenu = new MenuItems(settingsFile, MenuItemsMinNum, MenuItemsMaxNum, SubMenuItemsMaxNum);
if (myMenu.Initialized)
@@ -530,7 +530,7 @@
{
if (unsavedChanges) //Se presenti modifiche non salvate
{ //Richiesta conferma per chiusura applicazione
- if (!Tools.QuestionMessage("Unsaved changes will be lost...\nDo you want to proceed?"))
+ if (!DialogHelper.Question("Unsaved changes will be lost...\nDo you want to proceed?"))
{
e.Cancel = true; //--> annullamento chiusura form
return;
Modified: trunk/plugins/ShortCuter&SkinEditor/Source/XtremeMenuEditor/MediaPortal.cs
===================================================================
--- trunk/plugins/ShortCuter&SkinEditor/Source/XtremeMenuEditor/MediaPortal.cs 2014-06-16 14:56:35 UTC (rev 4839)
+++ trunk/plugins/ShortCuter&SkinEditor/Source/XtremeMenuEditor/MediaPortal.cs 2014-06-16 17:28:20 UTC (rev 4840)
@@ -67,7 +67,7 @@
DirectoryInfo dInfo = new DirectoryInfo(_paths.Media);
if (!dInfo.Exists)
{
- Tools.ErrorMessage("Skin media folder not found!", _paths.Media);
+ DialogHelper.Error("Skin media folder not found!", _paths.Media);
return false;
}
string fName, fExt;
@@ -101,7 +101,7 @@
return true; //--> raccolta immagini effettuata
else
{
- Tools.ErrorMessage("No background images found.", _paths.Media);
+ DialogHelper.Error("No background images found.", _paths.Media);
return false;
}
}
@@ -110,7 +110,7 @@
DirectoryInfo dInfo = new DirectoryInfo(_paths.Animations);
if (!dInfo.Exists)
{
- Tools.ErrorMessage("Skin animations folder not found!", _paths.Animations);
+ DialogHelper.Error("Skin animations folder not found!", _paths.Animations);
return false;
}
foreach (DirectoryInfo subdInfo in dInfo.GetDirectories()) //Iterazione per applicazione filtro e memorizzazione dati
@@ -122,7 +122,7 @@
return true; //--> raccolta cartelle effettuata
else
{
- Tools.ErrorMessage("No animation folders found.", _paths.Animations);
+ DialogHelper.Error("No animation folders found.", _paths.Animations);
return false;
}
}
@@ -131,7 +131,7 @@
DirectoryInfo dInfo = new DirectoryInfo(_paths.Icons);
if (!dInfo.Exists)
{
- Tools.ErrorMessage("Skin icons folder not found!", _paths.Icons);
+ DialogHelper.Error("Skin icons folder not found!", _paths.Icons);
return false;
}
string fExt;
@@ -145,7 +145,7 @@
return true; //--> raccolta icone effettuata
else
{
- Tools.ErrorMessage("No icons found.", _paths.Icons);
+ DialogHelper.Error("No icons found.", _paths.Icons);
return false;
}
}
@@ -188,7 +188,7 @@
}
else
{
- Tools.ErrorMessage("No BasicHome overlay found.", _paths.Skin);
+ DialogHelper.Error("No BasicHome overlay found.", _paths.Skin);
return false;
}
}
@@ -275,13 +275,13 @@
}
catch (Exception e)
{
- _paths.Install = string.Empty;
- Tools.ErrorMessage("MediaPortal installation not found.\nMediaPortal must be installed!", e.Message);
+ _paths.Install = string.Empty;
+ DialogHelper.Error("MediaPortal installation not found.\nMediaPortal must be installed!", e.Message);
return false;
}
if ((_paths.Install.Length == 0) || (!Directory.Exists(_paths.Install)))
{
- Tools.ErrorMessage("MediaPortal installation folder not found!", _paths.Install);
+ DialogHelper.Error("MediaPortal installation folder not found!", _paths.Install);
return false;
}
else
@@ -297,7 +297,7 @@
XmlDocument xmlDirs = new XmlDocument();
if (!File.Exists(dirs))
{
- Tools.ErrorMessage("MediaPortal directories file not found!", dirs);
+ DialogHelper.Error("MediaPortal directories file not found!", dirs);
return false;
}
xmlDirs.Load(dirs);
@@ -328,25 +328,25 @@
}
if ((_paths.Config.Length == 0) || (!Directory.Exists(_paths.Config)))
{
- Tools.ErrorMessage("MediaPortal configuration folder not found!", _paths.Config);
+ DialogHelper.Error("MediaPortal configuration folder not found!", _paths.Config);
return false;
}
else
if ((_paths.Skins.Length == 0) || (!Directory.Exists(_paths.Skins)))
{
- Tools.ErrorMessage("MediaPortal skins folder not found!", _paths.Skins);
+ DialogHelper.Error("MediaPortal skins folder not found!", _paths.Skins);
return false;
}
else
if ((_paths.Thumbs.Length == 0) | (!Directory.Exists(_paths.Thumbs)))
{
- Tools.ErrorMessage("MediaPortal thumbs folder not found!", _paths.Thumbs);
+ DialogHelper.Error("MediaPortal thumbs folder not found!", _paths.Thumbs);
return false;
}
else
if ((_paths.Caches.Length == 0) | (!Directory.Exists(_paths.Caches)))
{
- Tools.ErrorMessage("MediaPortal skins cache folder not found!", _paths.Caches);
+ DialogHelper.Error("MediaPortal skins cache folder not found!", _paths.Caches);
return false;
}
else
@@ -364,7 +364,7 @@
}
catch (Exception e)
{
- Tools.ErrorMessage("Error loading FanartList.xml.", e.Message);
+ DialogHelper.Error("Error loading FanartList.xml.", e.Message);
return false;
}
XmlNodeList nodeList = xmlFile.DocumentElement.SelectNodes("/Items/Item");
@@ -386,7 +386,7 @@
return true; //--> raccolta effettuata
else
{
- Tools.ErrorMessage("No fanart types found loading FanartList.xml.");
+ DialogHelper.Error("No fanart types found loading FanartList.xml.");
return false;
}
}
@@ -406,7 +406,7 @@
}
private bool GetUserConfig(ref string skinName, ref string mediaFolder) //Procedura di lettura eventuale configurazione utente per l'assembly
{
- string configFile = _paths.Config + Tools.MyAssembly.Name + ".Config.xml";
+ string configFile = _paths.Config + ExecutingAssembly.Name + ".Config.xml";
if (!File.Exists(configFile)) //Verifica presenza del file di configurazione
return false;
Modified: trunk/plugins/ShortCuter&SkinEditor/Source/XtremeMenuEditor/Menu.cs
===================================================================
--- trunk/plugins/ShortCuter&SkinEditor/Source/XtremeMenuEditor/Menu.cs 2014-06-16 14:56:35 UTC (rev 4839)
+++ trunk/plugins/ShortCuter&SkinEditor/Source/XtremeMenuEditor/Menu.cs 2014-06-16 17:28:20 UTC (rev 4840)
@@ -68,7 +68,7 @@
_initialized = GetMenu(false); //--> lettura impostazioni di menu
if (!_initialized)
{
- Tools.InfoMessage("Settings file not found or wrong: default menu will be loaded..");
+ DialogHelper.Info("Settings file not found or wrong: default menu will be loaded..");
_initialized = GetMenu(true); //Se lettura menu fallita --> caricamento menu predefinito
}
}
@@ -187,20 +187,20 @@
if (_items.Count > 0)
{
if (_items.Count < ItemsMinNum)
- Tools.InfoMessage("Invalid menu: the number of items should be at least " + ItemsMinNum.ToString() + ".");
+ DialogHelper.Info("Invalid menu: the number of items should be at least " + ItemsMinNum.ToString() + ".");
return true; //--> lettura menu effettuata
}
else
{
if (defaultSettings) //Se nessun elemento trovato nel menu predefinito: emissione messaggio
- Tools.ErrorMessage("No menu items found loading DefaultMenu.xml.");
+ DialogHelper.Error("No menu items found loading DefaultMenu.xml.");
return false;
}
}
catch (Exception e)
{
if (defaultSettings) //Se lettura menu predefinito fallita: emissione messaggio di errore
- Tools.ErrorMessage("Error loading DefaultMenu.xml.", e.Message);
+ DialogHelper.Error("Error loading DefaultMenu.xml.", e.Message);
return false;
}
finally
@@ -216,7 +216,7 @@
string skinMenuFile = skinPath + SkinSettingsFile;
if (!File.Exists(skinMenuFile))
{
- Tools.ErrorMessage("Skin settings file not found!", skinMenuFile);
+ DialogHelper.Error("Skin settings file not found!", skinMenuFile);
return false; //--> file impostazioni di skin non trovato
}
@@ -249,7 +249,7 @@
if (menuSectionIndex < 0)
{
- Tools.ErrorMessage("Section \"stringsettings\" not found!", skinMenuFile);
+ DialogHelper.Error("Section \"stringsettings\" not found!", skinMenuFile);
return false; //--> sezione per la scrittura impostazioni di menu non trovata
}
@@ -299,7 +299,7 @@
}
catch (Exception e)
{
- Tools.ErrorMessage("Error writing menu settings in SkinSettings.xml.", e.Message);
+ DialogHelper.Error("Error writing menu settings in SkinSettings.xml.", e.Message);
return false; //--> procedura terminata con errori
}
finally
@@ -347,7 +347,7 @@
}
catch (Exception e)
{
- Tools.ErrorMessage("Error writing multi-image settings in " + file, e.Message);
+ DialogHelper.Error("Error writing multi-image settings in " + file, e.Message);
return false; //--> procedura terminata con errori
}
finally
@@ -375,7 +375,7 @@
{
if (_items.Count < ItemsMinNum) //Controllo della validità del menu
{
- Tools.ErrorMessage("Invalid menu: the number of items should be at least " + ItemsMinNum.ToString() + ".");
+ DialogHelper.Error("Invalid menu: the number of items should be at least " + ItemsMinNum.ToString() + ".");
return false;
}
@@ -448,7 +448,7 @@
}
catch (Exception e)
{
- Tools.ErrorMessage("Error saving menu settings.", e.Message);
+ DialogHelper.Error("Error saving menu settings.", e.Message);
return false;
}
finally
@@ -458,7 +458,7 @@
}
if (WriteSkinSettings(skinPath) && WriteSkinMultiImages(skinPath)) //--> scrittura impostazioni e controlli multi-image skin
{
- Tools.InfoMessage("Procedure completed successfully.");
+ DialogHelper.Info("Procedure completed successfully.");
return true; //--> procedura terminata correttamente
}
else
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|