|
From: <nic...@us...> - 2015-01-05 20:21:36
|
Revision: 4905
http://sourceforge.net/p/mp-plugins/code/4905
Author: nicsergio
Date: 2015-01-05 20:21:33 +0000 (Mon, 05 Jan 2015)
Log Message:
-----------
Modified Paths:
--------------
trunk/plugins/ShortCuter&SkinEditor/Source/Common/My.Common.csproj
trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.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/ShortCuter.csproj
trunk/plugins/ShortCuter&SkinEditor/Source/XtremeMenuEditor/XtremeMenuEditor.csproj
Added Paths:
-----------
trunk/plugins/ShortCuter&SkinEditor/Source/Common/MediaPortalSkin.cs
trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/Skin.cs
Removed Paths:
-------------
trunk/plugins/ShortCuter&SkinEditor/Source/Common/Skin.cs
trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinWithSounds.cs
Added: trunk/plugins/ShortCuter&SkinEditor/Source/Common/MediaPortalSkin.cs
===================================================================
--- trunk/plugins/ShortCuter&SkinEditor/Source/Common/MediaPortalSkin.cs (rev 0)
+++ trunk/plugins/ShortCuter&SkinEditor/Source/Common/MediaPortalSkin.cs 2015-01-05 20:21:33 UTC (rev 4905)
@@ -0,0 +1,206 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using System.Xml;
+
+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
+ {
+ 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 = string.Empty; //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 = string.Empty; //Eventuale testo aggiuntivo ("guarda"-"ascolta"-ecc.)
+ public string Caption = string.Empty; //Titolo
+ public string XmlFile = string.Empty; //Nome del file xml della skin
+ public int WindowID = 0; //Id finestra per visualizzazione in MediaPortal
+ public string LoadParameter = string.Empty; //Eventuali parametri aggiuntivi per visualizzazione (sotto-categorie, ecc.)
+ public string BackgroundImage = string.Empty; //File immagine di background
+ public string BackgroundFolder = string.Empty; //Cartella per multi-image di background
+ public string FanartHandler = string.Empty; //Tipologia di fanart per background
+ public string Overlay = string.Empty; //Eventuale riquadro visualizzato in sovrapposizione all'immagine di background
+ public string IconList = string.Empty; //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
+
+ _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
+ {
+ if (!Directory.Exists(_paths.Skin))
+ {
+ DialogHelper.Error("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"))
+ {
+ 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", string.Empty);
+ 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
+ {
+ DialogHelper.Error("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()))
+ {
+ xmlFile.Load(streamFile); //Links skin disponibili --> lettura file xml incapsulato
+ }
+ }
+ catch (Exception e)
+ {
+ DialogHelper.Error("Error loading PopularSkinLinks.xml.", e.Message);
+ return false;
+ }
+
+ 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
+ {
+ 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
+ {
+ DialogHelper.Error("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
+ {
+ 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
+ }
+ 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
+ }
+}
Modified: trunk/plugins/ShortCuter&SkinEditor/Source/Common/My.Common.csproj
===================================================================
--- trunk/plugins/ShortCuter&SkinEditor/Source/Common/My.Common.csproj 2015-01-02 14:17:57 UTC (rev 4904)
+++ trunk/plugins/ShortCuter&SkinEditor/Source/Common/My.Common.csproj 2015-01-05 20:21:33 UTC (rev 4905)
@@ -52,7 +52,7 @@
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
- <Compile Include="Skin.cs" />
+ <Compile Include="MediaPortalSkin.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Tools.cs" />
</ItemGroup>
Deleted: trunk/plugins/ShortCuter&SkinEditor/Source/Common/Skin.cs
===================================================================
--- trunk/plugins/ShortCuter&SkinEditor/Source/Common/Skin.cs 2015-01-02 14:17:57 UTC (rev 4904)
+++ trunk/plugins/ShortCuter&SkinEditor/Source/Common/Skin.cs 2015-01-05 20:21:33 UTC (rev 4905)
@@ -1,206 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Reflection;
-using System.Xml;
-
-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
- {
- 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 = string.Empty; //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 = string.Empty; //Eventuale testo aggiuntivo ("guarda"-"ascolta"-ecc.)
- public string Caption = string.Empty; //Titolo
- public string XmlFile = string.Empty; //Nome del file xml della skin
- public int WindowID = 0; //Id finestra per visualizzazione in MediaPortal
- public string LoadParameter = string.Empty; //Eventuali parametri aggiuntivi per visualizzazione (sotto-categorie, ecc.)
- public string BackgroundImage = string.Empty; //File immagine di background
- public string BackgroundFolder = string.Empty; //Cartella per multi-image di background
- public string FanartHandler = string.Empty; //Tipologia di fanart per background
- public string Overlay = string.Empty; //Eventuale riquadro visualizzato in sovrapposizione all'immagine di background
- public string IconList = string.Empty; //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
-
- _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
- {
- if (!Directory.Exists(_paths.Skin))
- {
- DialogHelper.Error("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"))
- {
- 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", string.Empty);
- 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
- {
- DialogHelper.Error("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()))
- {
- xmlFile.Load(streamFile); //Links skin disponibili --> lettura file xml incapsulato
- }
- }
- catch (Exception e)
- {
- DialogHelper.Error("Error loading PopularSkinLinks.xml.", e.Message);
- return false;
- }
-
- 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
- {
- 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
- {
- DialogHelper.Error("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
- {
- 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
- }
- 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
- }
-}
Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.cs
===================================================================
--- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.cs 2015-01-02 14:17:57 UTC (rev 4904)
+++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/ShortCuterConfig.cs 2015-01-05 20:21:33 UTC (rev 4905)
@@ -481,7 +481,8 @@
}
private void skinNavConfigButton_Click(object sender, EventArgs e)
{
- new SkinNavigatorConfig().ShowConfig(myShortCuts.Navigator, mySkin);
+ unsavedChanges = true;
+ new SkinNavigatorConfig(myShortCuts.Navigator, mySkin).ShowDialog();
}
private void infoPictureBox_Click(object sender, EventArgs e)
{
Added: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/Skin.cs
===================================================================
--- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/Skin.cs (rev 0)
+++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/Skin.cs 2015-01-05 20:21:33 UTC (rev 4905)
@@ -0,0 +1,51 @@
+using System.Collections.Generic;
+using System.IO;
+using My.Common;
+
+namespace ShortCuter.Configuration
+{
+ internal class Skin : MediaPortalSkin //Classe per gestione skin di MediaPortal
+ {
+ #region Dati
+ private List<string> _skinSounds = new List<string>(); //Lista effetti sonori della skin
+ #endregion
+
+ #region Costruttore
+ public Skin(string skinName, string skinsPath, string cachesPath) : base(skinName, skinsPath, cachesPath, false)
+ { //Costruttore classe Skin
+ _initialized = _initialized && GetSkinSounds(); //--> raccolta effetti sonori della skin
+ }
+ #endregion
+
+ #region Metodi Privati
+ private bool GetSkinSounds() //Raccolta effetti sonori della skin
+ {
+ DirectoryInfo dInfo = new DirectoryInfo(_paths.Sounds);
+ if (!dInfo.Exists)
+ {
+ DialogHelper.Error("Skin sounds folder not found!", _paths.Sounds);
+ return false;
+ }
+ foreach (FileInfo fInfo in dInfo.GetFiles()) //Iterazione per applicazione filtro e memorizzazione dati
+ {
+ if (fInfo.Extension.ToLower() == ".wav")
+ _skinSounds.Add(fInfo.Name); //--> aggiunta effetto sonoro nella lista
+ }
+ if (_skinSounds.Count > 0)
+ {
+ _skinSounds.Insert(0, string.Empty); //--> aggiunta della selezione per nessun effetto sonoro
+ return true; //--> raccolta effetti sonori effettuata
+ }
+ else
+ {
+ DialogHelper.Error("No sounds found.", _paths.Sounds);
+ return false;
+ }
+ }
+ #endregion
+
+ #region Proprietà
+ public List<string> SkinSounds { get { return this._skinSounds; } }
+ #endregion
+ }
+}
Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinNavigatorConfig.Designer.cs
===================================================================
--- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinNavigatorConfig.Designer.cs 2015-01-02 14:17:57 UTC (rev 4904)
+++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinNavigatorConfig.Designer.cs 2015-01-05 20:21:33 UTC (rev 4905)
@@ -53,6 +53,7 @@
this.Name = "SkinNavigatorConfig";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Skin Navigator Configuration";
+ this.Load += new System.EventHandler(this.SkinNavigatorConfig_Load);
this.ResumeLayout(false);
}
Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinNavigatorConfig.cs
===================================================================
--- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinNavigatorConfig.cs 2015-01-02 14:17:57 UTC (rev 4904)
+++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinNavigatorConfig.cs 2015-01-05 20:21:33 UTC (rev 4905)
@@ -4,26 +4,30 @@
{
internal partial class SkinNavigatorConfig : Form
{
- //private SkinNavigatorConfig mySkinNavigatorConfig; //Istanza form di visualizzazione versione
+ #region Dati
+ private SkinNavigator mySkinNavigator; //Istanza classe SkinNavigator (gestione configurazione)
+ private Skin mySkin; //Istanza classe Skin (dati relativi alla skin di MediaPortal)
+ #endregion
- public SkinNavigatorConfig()
+ #region Costruttore
+ internal SkinNavigatorConfig(SkinNavigator navigator, Skin skin)
{
InitializeComponent();
+ mySkinNavigator = navigator;
+ mySkin = skin;
}
+ #endregion
+ #region Metodi Privati
+ #endregion
- #region Metodi Pubblici
- public void ShowConfig(SkinNavigator navigator, Skin skin)
- { //Visualizzazione informazioni sulla versione
- //mySkinNavigatorConfig = new SkinNavigatorConfig();
- skinItems.Populate(skin.SkinFiles, skin.SkinLinks, true, false);
- ShowDialog(); //--> visualizzazione form
+ #region Consumazione Eventi
+ #region Eventi Form
+ private void SkinNavigatorConfig_Load(object sender, System.EventArgs e)
+ {
+ skinItems.Populate(mySkin.SkinFiles, mySkin.SkinLinks, true, false);
}
#endregion
-
-
-
-
-
+ #endregion
}
}
Deleted: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinWithSounds.cs
===================================================================
--- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinWithSounds.cs 2015-01-02 14:17:57 UTC (rev 4904)
+++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/Configuration/SkinWithSounds.cs 2015-01-05 20:21:33 UTC (rev 4905)
@@ -1,51 +0,0 @@
-using System.Collections.Generic;
-using System.IO;
-using My.Common;
-
-namespace ShortCuter.Configuration
-{
- internal class Skin : MediaPortalSkin //Classe per gestione skin di MediaPortal
- {
- #region Dati
- private List<string> _skinSounds = new List<string>(); //Lista effetti sonori della skin
- #endregion
-
- #region Costruttore
- public Skin(string skinName, string skinsPath, string cachesPath) : base(skinName, skinsPath, cachesPath, false)
- { //Costruttore classe Skin
- _initialized = _initialized && GetSkinSounds(); //--> raccolta effetti sonori della skin
- }
- #endregion
-
- #region Metodi Privati
- private bool GetSkinSounds() //Raccolta effetti sonori della skin
- {
- DirectoryInfo dInfo = new DirectoryInfo(_paths.Sounds);
- if (!dInfo.Exists)
- {
- DialogHelper.Error("Skin sounds folder not found!", _paths.Sounds);
- return false;
- }
- foreach (FileInfo fInfo in dInfo.GetFiles()) //Iterazione per applicazione filtro e memorizzazione dati
- {
- if (fInfo.Extension.ToLower() == ".wav")
- _skinSounds.Add(fInfo.Name); //--> aggiunta effetto sonoro nella lista
- }
- if (_skinSounds.Count > 0)
- {
- _skinSounds.Insert(0, string.Empty); //--> aggiunta della selezione per nessun effetto sonoro
- return true; //--> raccolta effetti sonori effettuata
- }
- else
- {
- DialogHelper.Error("No sounds found.", _paths.Sounds);
- return false;
- }
- }
- #endregion
-
- #region Proprietà
- public List<string> SkinSounds { get { return this._skinSounds; } }
- #endregion
- }
-}
Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj
===================================================================
--- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2015-01-02 14:17:57 UTC (rev 4904)
+++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2015-01-05 20:21:33 UTC (rev 4905)
@@ -87,8 +87,8 @@
</Reference>
</ItemGroup>
<ItemGroup>
- <Compile Include="..\Common\Skin.cs">
- <Link>Configuration\Skin.cs</Link>
+ <Compile Include="..\Common\MediaPortalSkin.cs">
+ <Link>Configuration\MediaPortalSkin.cs</Link>
</Compile>
<Compile Include="..\Common\SkinItems.cs">
<Link>Configuration\SkinItems.cs</Link>
@@ -146,7 +146,7 @@
<Compile Include="Configuration\SkinNavigatorConfig.Designer.cs">
<DependentUpon>SkinNavigatorConfig.cs</DependentUpon>
</Compile>
- <Compile Include="Configuration\SkinWithSounds.cs" />
+ <Compile Include="Configuration\Skin.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="..\Common\SkinItems.resx">
Modified: trunk/plugins/ShortCuter&SkinEditor/Source/XtremeMenuEditor/XtremeMenuEditor.csproj
===================================================================
--- trunk/plugins/ShortCuter&SkinEditor/Source/XtremeMenuEditor/XtremeMenuEditor.csproj 2015-01-02 14:17:57 UTC (rev 4904)
+++ trunk/plugins/ShortCuter&SkinEditor/Source/XtremeMenuEditor/XtremeMenuEditor.csproj 2015-01-05 20:21:33 UTC (rev 4905)
@@ -80,8 +80,8 @@
</Reference>
</ItemGroup>
<ItemGroup>
- <Compile Include="..\Common\Skin.cs">
- <Link>Skin.cs</Link>
+ <Compile Include="..\Common\MediaPortalSkin.cs">
+ <Link>MediaPortalSkin.cs</Link>
</Compile>
<Compile Include="..\Common\SkinItems.cs">
<Link>SkinItems.cs</Link>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|