|
From: <an...@us...> - 2007-02-10 10:47:23
|
Revision: 110
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=110&view=rev
Author: and-81
Date: 2007-02-10 02:47:10 -0800 (Sat, 10 Feb 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/plugins/MCEReplacement/MCEReplacement.cs
trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.cs
trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs
Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs
===================================================================
--- trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-02-10 10:33:25 UTC (rev 109)
+++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-02-10 10:47:10 UTC (rev 110)
@@ -260,7 +260,6 @@
#region IPlugin methods
- //[SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)]
public void Start()
{
Log.Info("MCEReplacement: Starting ({0})", Version);
@@ -364,7 +363,6 @@
Log.Info("MCEReplacement: Started");
}
- //[SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)]
public void Stop()
{
if (LogVerbose)
@@ -437,7 +435,6 @@
#region IPluginReceiver methods
- //[SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)]
public bool WndProc(ref Message msg)
{
// Handle Suspend & Resume ...
@@ -601,7 +598,7 @@
return false;
}
- #endregion
+ #endregion IPluginReceiver methods
#region Private Methods
Modified: trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.cs
===================================================================
--- trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.cs 2007-02-10 10:33:25 UTC (rev 109)
+++ trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.cs 2007-02-10 10:47:10 UTC (rev 110)
@@ -631,16 +631,11 @@
/// <returns>Modified string with escape codes processed</returns>
public static string ReplaceEscapeCodes(string input)
{
- if (input == null)
+ if (String.IsNullOrEmpty(input))
{
- Log.Error("TV3ExtChannelChanger: Null escape code string");
+ Log.Error("TV3ExtChannelChanger: Null or empty escape code string");
return "";
}
- else if (input.Length == 0)
- {
- Log.Info("TV3ExtChannelChanger: Empty escape code string");
- return "";
- }
bool inEscapeCode = false;
bool inHexCode = false;
Modified: trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs
===================================================================
--- trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs 2007-02-10 10:33:25 UTC (rev 109)
+++ trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs 2007-02-10 10:47:10 UTC (rev 110)
@@ -691,11 +691,14 @@
}
/// <summary>
- /// Given a command name this method checks if the file exists as an IR code
- /// or a macro and then processes the request accordingly.
+ /// Given a command this method checks if the file exists as an IR
+ /// command, macro or other command and then processes the request
+ /// accordingly.
/// </summary>
- /// <param name="command">The command name stored in the mapping XML</param>
- /// <returns>success</returns>
+ /// <param name="command">Command to process.</param>
+ /// <param name="port">Blaster port to IR commands to.</param>
+ /// <param name="speed">Blaster speed to execute IR commands at.</param>
+ /// <returns>Success.</returns>
public static bool ProcessCommand(string command, MceIrApi.BlasterPort port, MceIrApi.BlasterSpeed speed)
{
if (String.IsNullOrEmpty(command))
@@ -950,14 +953,22 @@
/// <returns>string[] of IR Commands</returns>
public static string[] GetIRList()
{
- string[] files = Directory.GetFiles(AppDataFolder + IRFolder, "*" + IRExtension);
- string[] list = new string[files.Length];
+ try
+ {
+ string[] files = Directory.GetFiles(AppDataFolder + IRFolder, "*" + IRExtension);
+ string[] list = new string[files.Length];
- int i = 0;
- foreach (string file in files)
- list[i++] = IRFolder + Path.GetFileNameWithoutExtension(file).ToUpperInvariant();
+ int i = 0;
+ foreach (string file in files)
+ list[i++] = IRFolder + Path.GetFileNameWithoutExtension(file).ToUpperInvariant();
- return list;
+ return list;
+ }
+ catch (Exception ex)
+ {
+ Log.Error(ex.Message);
+ return null;
+ }
}
/// <summary>
@@ -966,14 +977,22 @@
/// <returns>string[] of Macros</returns>
public static string[] GetMacroList()
{
- string[] files = Directory.GetFiles(AppDataFolder + MacroFolder, "*" + MacroExtension);
- string[] list = new string[files.Length];
+ try
+ {
+ string[] files = Directory.GetFiles(AppDataFolder + MacroFolder, "*" + MacroExtension);
+ string[] list = new string[files.Length];
- int i = 0;
- foreach (string file in files)
- list[i++] = MacroFolder + Path.GetFileNameWithoutExtension(file).ToUpperInvariant();
+ int i = 0;
+ foreach (string file in files)
+ list[i++] = MacroFolder + Path.GetFileNameWithoutExtension(file).ToUpperInvariant();
- return list;
+ return list;
+ }
+ catch (Exception ex)
+ {
+ Log.Error(ex.Message);
+ return null;
+ }
}
/// <summary>
@@ -1003,16 +1022,11 @@
/// <returns>Modified string with escape codes processed</returns>
public static string ReplaceEscapeCodes(string input)
{
- if (input == null)
+ if (String.IsNullOrEmpty(input))
{
- Log.Error("TV3MceBlaster: Null escape code string");
+ Log.Error("TV3MceBlaster: Null or empty escape code string");
return "";
}
- else if (input.Length == 0)
- {
- Log.Info("TV3MceBlaster: Empty escape code string");
- return "";
- }
bool inEscapeCode = false;
bool inHexCode = false;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|