--- trunk/EmuXPortal/Api/EmuConfig.cs 2012/04/04 03:10:52 24 +++ trunk/EmuXPortal/Api/EmuConfig.cs 2012/04/04 05:42:03 32 @@ -9,7 +9,7 @@ namespace EmuXPortal.Api { - public interface IEmuConfig + public interface IEmuConfig : IComparable { string PlatformNameShort { get; } string PlatformNameLong { get; } @@ -18,6 +18,7 @@ string EmuPath { get; } string EmuOptions { get; } string EmuRomPath { get; set; } + string ToString(); } @@ -91,6 +92,7 @@ } } else { logger.WriteLine("Could not find EMU Config File: {0}", config_path); } + return config; } #endregion @@ -127,7 +129,7 @@ #endregion #region private class EmuConfig : IEmuConfig - private class EmuConfig : IEmuConfig + private class EmuConfig : IEmuConfig, IComparable { private const string Unknown_Platform = "Unknown Platform"; public EmuConfig() : this("") { } @@ -188,6 +190,19 @@ public string EmuOptions { get; set; } public string EmuRomPath { get; set; } #endregion + + public override string ToString() + { + return string.Format("{2} {0}{3}{1}","{","}", PlatformNameLong,PlatformNameShort); + } + #region IComparable Members + + public int CompareTo(object obj) + { + return this.PlatformNameLong.CompareTo((obj as EmuConfig).PlatformNameLong); + } + + #endregion } #endregion