From: <an...@us...> - 2007-12-14 03:55:13
|
Revision: 1156 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1156&view=rev Author: and-81 Date: 2007-12-13 19:55:11 -0800 (Thu, 13 Dec 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs trunk/plugins/IR Server Suite/Applications/Web Remote/Program.cs trunk/plugins/IR Server Suite/Applications/Web Remote/Setup.cs trunk/plugins/IR Server Suite/Applications/Web Remote/Web Remote.csproj trunk/plugins/IR Server Suite/Applications/Web Remote/WebServer.cs trunk/plugins/IR Server Suite/Common/IrssComms/ClientManager.cs trunk/plugins/IR Server Suite/Common/IrssComms/GenericPCQueue.cs trunk/plugins/IR Server Suite/Common/IrssComms/IrssMessage.cs trunk/plugins/IR Server Suite/Common/IrssComms/Server.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/MouseCommand.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/SmsKeyboard.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/VirtualKeyboard.cs trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Girder Plugin.cs trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/GirderPluginWrapper.cs trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DeviceIoOverlapped.cs trunk/plugins/IR Server Suite/IR Server Plugins/Wii Remote Receiver/Wii Remote Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/ReceiverWindow.cs trunk/plugins/IR Server Suite/Input Service/Input Service/InputService.cs trunk/plugins/IR Server Suite/Input Service/Input Service/InputServiceInstaller.cs trunk/plugins/IR Server Suite/Input Service/Input Service/Program.cs trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Config.cs trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Input Service Configuration.exe.manifest trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Properties/AssemblyInfo.cs Modified: trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2007-12-13 16:37:04 UTC (rev 1155) +++ trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2007-12-14 03:55:11 UTC (rev 1156) @@ -25,12 +25,12 @@ static bool _registered; - static string _serverHost = null; + static string _serverHost; static string _blastPort = "Default"; - static bool _treatAsChannelNumber = false; - static int _padChannelNumber = 0; + static bool _treatAsChannelNumber; + static int _padChannelNumber; #endregion Variables @@ -73,7 +73,7 @@ continue; case "-PAD": - int.TryParse(args[++index], out _padChannelNumber); + _padChannelNumber = int.Parse(args[++index]); continue; default: @@ -141,7 +141,7 @@ } } } - else if (command.StartsWith("~")) + else if (command.StartsWith("~", StringComparison.OrdinalIgnoreCase)) { Thread.Sleep(command.Length * 500); } @@ -347,15 +347,13 @@ static void Info(string format, params object[] args) { - string message = String.Format(format, args); - Console.WriteLine(message); - IrssLog.Info(message); + Console.WriteLine(format, args); + IrssLog.Info(format, args); } static void Warn(string format, params object[] args) { - string message = String.Format(format, args); - Console.WriteLine(message); - IrssLog.Warn(message); + Console.WriteLine(format, args); + IrssLog.Warn(format, args); } static void Error(Exception ex) { Modified: trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2007-12-13 16:37:04 UTC (rev 1155) +++ trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2007-12-14 03:55:11 UTC (rev 1156) @@ -26,12 +26,12 @@ static bool _registered; - static string _serverHost = null; + static string _serverHost; static string _blastPort = "Default"; - static bool _treatAsChannelNumber = false; - static int _padChannelNumber = 0; + static bool _treatAsChannelNumber; + static int _padChannelNumber; #endregion Variables @@ -72,7 +72,7 @@ continue; case "-PAD": - int.TryParse(args[++index], out _padChannelNumber); + _padChannelNumber = int.Parse(args[++index]); continue; default: @@ -140,7 +140,7 @@ } } } - else if (command.StartsWith("~")) + else if (command.StartsWith("~", StringComparison.OrdinalIgnoreCase)) { Thread.Sleep(command.Length * 500); } Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs 2007-12-13 16:37:04 UTC (rev 1155) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs 2007-12-14 03:55:11 UTC (rev 1156) @@ -158,7 +158,7 @@ string prefix = _command; string suffix = String.Empty; - int find = _command.IndexOf(": "); + int find = _command.IndexOf(": ", StringComparison.OrdinalIgnoreCase); if (find != -1) { Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2007-12-13 16:37:04 UTC (rev 1155) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2007-12-14 03:55:11 UTC (rev 1156) @@ -100,7 +100,7 @@ ToolStripMenuItem _editProgramToolStripMenuItem; ToolStripMenuItem _removeProgramToolStripMenuItem; - int _selectedProgram = 0; + int _selectedProgram; #endregion Variables Modified: trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2007-12-13 16:37:04 UTC (rev 1155) +++ trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2007-12-14 03:55:11 UTC (rev 1156) @@ -17,6 +17,9 @@ namespace TrayLauncher { + /// <summary> + /// Tray launcher main class. + /// </summary> class Tray { Modified: trunk/plugins/IR Server Suite/Applications/Web Remote/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Web Remote/Program.cs 2007-12-13 16:37:04 UTC (rev 1155) +++ trunk/plugins/IR Server Suite/Applications/Web Remote/Program.cs 2007-12-14 03:55:11 UTC (rev 1156) @@ -25,7 +25,7 @@ /// <summary> /// Web Remote. /// </summary> - public static class Program + static class Program { #region Constants @@ -187,7 +187,7 @@ /// </summary> /// <param name="sender">Sender.</param> /// <param name="e">Event args.</param> - public static void Application_ThreadException(object sender, ThreadExceptionEventArgs e) + static void Application_ThreadException(object sender, ThreadExceptionEventArgs e) { IrssLog.Error(e.Exception.ToString()); } Modified: trunk/plugins/IR Server Suite/Applications/Web Remote/Setup.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Web Remote/Setup.cs 2007-12-13 16:37:04 UTC (rev 1155) +++ trunk/plugins/IR Server Suite/Applications/Web Remote/Setup.cs 2007-12-14 03:55:11 UTC (rev 1156) @@ -15,7 +15,7 @@ /// <summary> /// Setup Form. /// </summary> - public partial class Setup : Form + partial class Setup : Form { #region Properties @@ -54,6 +54,9 @@ #region Constructor + /// <summary> + /// Initializes a new instance of the <see cref="Setup"/> class. + /// </summary> public Setup() { InitializeComponent(); Modified: trunk/plugins/IR Server Suite/Applications/Web Remote/Web Remote.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/Web Remote/Web Remote.csproj 2007-12-13 16:37:04 UTC (rev 1155) +++ trunk/plugins/IR Server Suite/Applications/Web Remote/Web Remote.csproj 2007-12-14 03:55:11 UTC (rev 1156) @@ -22,6 +22,8 @@ <WarningLevel>4</WarningLevel> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <UseVSHostingProcess>false</UseVSHostingProcess> + <DocumentationFile> + </DocumentationFile> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> Modified: trunk/plugins/IR Server Suite/Applications/Web Remote/WebServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Web Remote/WebServer.cs 2007-12-13 16:37:04 UTC (rev 1155) +++ trunk/plugins/IR Server Suite/Applications/Web Remote/WebServer.cs 2007-12-14 03:55:11 UTC (rev 1156) @@ -18,7 +18,7 @@ /// <summary> /// Provides a Web front-end to the Virtual Remote. /// </summary> - public class WebServer + class WebServer { #region Constants @@ -102,7 +102,8 @@ while (true) { - Socket socket = AcceptConnection(); + AcceptConnection(); + string command = HttpUtility.UrlDecode(GetCommand()); if (command.StartsWith("GET", StringComparison.OrdinalIgnoreCase)) @@ -130,7 +131,7 @@ { string url = GetUrl(argument); - if (url.StartsWith("/")) + if (url.StartsWith("/", StringComparison.OrdinalIgnoreCase)) url = url.Substring(1); if (url.Length == 0) @@ -174,33 +175,14 @@ } } - string GetUrl(string argument) + void AcceptConnection() { - StringBuilder outputString = new StringBuilder(); - - for (int index = 0; index < argument.Length; index++) - { - char curChar = argument[index]; - - if (Char.IsWhiteSpace(curChar)) - break; - - outputString.Append(curChar); - } - - return outputString.ToString(); - } - - Socket AcceptConnection() - { _serverSocket.Listen(1); + Socket socket = _serverSocket.Accept(); _networkStream = new NetworkStream(socket, FileAccess.ReadWrite, true); _networkReader = new StreamReader(_networkStream); - IPEndPoint ep = (IPEndPoint)socket.RemoteEndPoint; - - return socket; } string GetCommand() @@ -220,13 +202,7 @@ return command; } - - string GetCommandElement(string command) - { - string[] commandElements = command.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); - return commandElements[1]; - } - + void SendFile(string path) { byte[] buffer = new byte[2048]; @@ -267,6 +243,7 @@ SendString("Content-Type: {0}\r\n\r\n", contentType); } + /* void SendRedirect(string newLocation) { SendString("HTTP/1.1 301 Moved Permanently\r\n"); @@ -274,7 +251,31 @@ SendString("Server:{0}\r\n", ServerName); SendString("Location: {0}\r\n\r\n", newLocation); } + */ + static string GetUrl(string argument) + { + StringBuilder outputString = new StringBuilder(); + + for (int index = 0; index < argument.Length; index++) + { + char curChar = argument[index]; + + if (Char.IsWhiteSpace(curChar)) + break; + + outputString.Append(curChar); + } + + return outputString.ToString(); + } + + static string GetCommandElement(string command) + { + string[] commandElements = command.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); + return commandElements[1]; + } + #endregion Implementation } Modified: trunk/plugins/IR Server Suite/Common/IrssComms/ClientManager.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/ClientManager.cs 2007-12-13 16:37:04 UTC (rev 1155) +++ trunk/plugins/IR Server Suite/Common/IrssComms/ClientManager.cs 2007-12-14 03:55:11 UTC (rev 1156) @@ -1,11 +1,9 @@ using System; -using System.Collections.Generic; #if TRACE using System.Diagnostics; #endif using System.Net; using System.Net.Sockets; -using System.Text; using System.Threading; namespace IrssComms @@ -19,7 +17,7 @@ #region Variables - bool _processReceiveThread = false; + bool _processReceiveThread; Thread _receiveThread; ServerMessageSink _messageSink; Modified: trunk/plugins/IR Server Suite/Common/IrssComms/GenericPCQueue.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/GenericPCQueue.cs 2007-12-13 16:37:04 UTC (rev 1155) +++ trunk/plugins/IR Server Suite/Common/IrssComms/GenericPCQueue.cs 2007-12-14 03:55:11 UTC (rev 1156) @@ -1,5 +1,4 @@ using System; -using System.Collections; using System.Collections.Generic; #if TRACE using System.Diagnostics; Modified: trunk/plugins/IR Server Suite/Common/IrssComms/IrssMessage.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/IrssMessage.cs 2007-12-13 16:37:04 UTC (rev 1155) +++ trunk/plugins/IR Server Suite/Common/IrssComms/IrssMessage.cs 2007-12-14 03:55:11 UTC (rev 1156) @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.Text; namespace IrssComms @@ -212,7 +211,6 @@ { _type = MessageType.Unknown; _flags = MessageFlags.None; - _data = null; } /// <summary> @@ -221,7 +219,6 @@ /// <param name="type">The message type.</param> /// <param name="flags">The message flags.</param> public IrssMessage(MessageType type, MessageFlags flags) - : this() { _type = type; _flags = flags; Modified: trunk/plugins/IR Server Suite/Common/IrssComms/Server.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/Server.cs 2007-12-13 16:37:04 UTC (rev 1155) +++ trunk/plugins/IR Server Suite/Common/IrssComms/Server.cs 2007-12-14 03:55:11 UTC (rev 1156) @@ -5,7 +5,6 @@ #endif using System.Net; using System.Net.Sockets; -using System.Text; using System.Threading; namespace IrssComms @@ -48,7 +47,7 @@ Socket _serverSocket; - bool _processConnectionThread = false; + bool _processConnectionThread; Thread _connectionThread; List<ClientManager> _clientManagers; Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs 2007-12-13 16:37:04 UTC (rev 1155) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs 2007-12-14 03:55:11 UTC (rev 1156) @@ -600,15 +600,15 @@ break; default: - if (command.StartsWith(MouseMoveDown)) + if (command.StartsWith(MouseMoveDown, StringComparison.OrdinalIgnoreCase)) Mouse.Move(0, int.Parse(command.Substring(MouseMoveDown.Length)), false); - else if (command.StartsWith(MouseMoveLeft)) + else if (command.StartsWith(MouseMoveLeft, StringComparison.OrdinalIgnoreCase)) Mouse.Move(-int.Parse(command.Substring(MouseMoveLeft.Length)), 0, false); - else if (command.StartsWith(MouseMoveRight)) + else if (command.StartsWith(MouseMoveRight, StringComparison.OrdinalIgnoreCase)) Mouse.Move(int.Parse(command.Substring(MouseMoveRight.Length)), 0, false); - else if (command.StartsWith(MouseMoveUp)) + else if (command.StartsWith(MouseMoveUp, StringComparison.OrdinalIgnoreCase)) Mouse.Move(0, -int.Parse(command.Substring(MouseMoveUp.Length)), false); - else if (command.StartsWith(MouseMoveToPos)) + else if (command.StartsWith(MouseMoveToPos, StringComparison.OrdinalIgnoreCase)) { string subString = command.Substring(MouseMoveToPos.Length); Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/MouseCommand.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/MouseCommand.cs 2007-12-13 16:37:04 UTC (rev 1155) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/MouseCommand.cs 2007-12-14 03:55:11 UTC (rev 1156) @@ -91,13 +91,17 @@ case Common.MouseScrollUp: checkBoxMouseScrollUp.Checked = true; break; default: - if (command.StartsWith(Common.MouseMoveDown)) checkBoxMouseMoveDown.Checked = true; - else if (command.StartsWith(Common.MouseMoveLeft)) checkBoxMouseMoveLeft.Checked = true; - else if (command.StartsWith(Common.MouseMoveRight)) checkBoxMouseMoveRight.Checked = true; - else if (command.StartsWith(Common.MouseMoveUp)) checkBoxMouseMoveUp.Checked = true; - else if (command.StartsWith(Common.MouseMoveToPos)) + if (command.StartsWith(Common.MouseMoveDown, StringComparison.OrdinalIgnoreCase)) + checkBoxMouseMoveDown.Checked = true; + else if (command.StartsWith(Common.MouseMoveLeft, StringComparison.OrdinalIgnoreCase)) + checkBoxMouseMoveLeft.Checked = true; + else if (command.StartsWith(Common.MouseMoveRight, StringComparison.OrdinalIgnoreCase)) + checkBoxMouseMoveRight.Checked = true; + else if (command.StartsWith(Common.MouseMoveUp, StringComparison.OrdinalIgnoreCase)) + checkBoxMouseMoveUp.Checked = true; + else if (command.StartsWith(Common.MouseMoveToPos, StringComparison.OrdinalIgnoreCase)) { - checkBoxMouseMoveToPos.Checked = true; + checkBoxMouseMoveToPos.Checked = true; string subString = command.Substring(Common.MouseMoveToPos.Length); Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/SmsKeyboard.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/SmsKeyboard.cs 2007-12-13 16:37:04 UTC (rev 1155) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/SmsKeyboard.cs 2007-12-14 03:55:11 UTC (rev 1156) @@ -3,6 +3,7 @@ using System.ComponentModel; using System.Data; using System.Drawing; +using System.Globalization; using System.Text; using System.Windows.Forms; @@ -202,9 +203,9 @@ void PutChar(string chr) { if (_shift) - chr = chr.ToUpper(); + chr = chr.ToUpper(CultureInfo.CurrentCulture); else - chr = chr.ToLower(); + chr = chr.ToLower(CultureInfo.CurrentCulture); int curPos = textBoxKeys.SelectionStart; Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/VirtualKeyboard.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/VirtualKeyboard.cs 2007-12-13 16:37:04 UTC (rev 1155) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/VirtualKeyboard.cs 2007-12-14 03:55:11 UTC (rev 1156) @@ -3,6 +3,7 @@ using System.ComponentModel; using System.Data; using System.Drawing; +using System.Globalization; using System.Text; using System.Windows.Forms; @@ -289,74 +290,74 @@ if (_capsLock || _shift) { - TextAdd(origin.Text.ToUpperInvariant()); + TextAdd(origin.Text.ToUpper(CultureInfo.CurrentCulture)); if (_shift) ToggleShift(); } else { - TextAdd(origin.Text.ToLowerInvariant()); + TextAdd(origin.Text.ToLower(CultureInfo.CurrentCulture)); } } void ButtonsCaseUpper() { - buttonA.Text = buttonA.Text.ToUpper(); - buttonB.Text = buttonB.Text.ToUpper(); - buttonC.Text = buttonC.Text.ToUpper(); - buttonD.Text = buttonD.Text.ToUpper(); - buttonE.Text = buttonE.Text.ToUpper(); - buttonF.Text = buttonF.Text.ToUpper(); - buttonG.Text = buttonG.Text.ToUpper(); - buttonH.Text = buttonH.Text.ToUpper(); - buttonI.Text = buttonI.Text.ToUpper(); - buttonJ.Text = buttonJ.Text.ToUpper(); - buttonK.Text = buttonK.Text.ToUpper(); - buttonL.Text = buttonL.Text.ToUpper(); - buttonM.Text = buttonM.Text.ToUpper(); - buttonN.Text = buttonN.Text.ToUpper(); - buttonO.Text = buttonO.Text.ToUpper(); - buttonP.Text = buttonP.Text.ToUpper(); - buttonQ.Text = buttonQ.Text.ToUpper(); - buttonR.Text = buttonR.Text.ToUpper(); - buttonS.Text = buttonS.Text.ToUpper(); - buttonT.Text = buttonT.Text.ToUpper(); - buttonU.Text = buttonU.Text.ToUpper(); - buttonV.Text = buttonV.Text.ToUpper(); - buttonW.Text = buttonW.Text.ToUpper(); - buttonX.Text = buttonX.Text.ToUpper(); - buttonY.Text = buttonY.Text.ToUpper(); - buttonZ.Text = buttonZ.Text.ToUpper(); + buttonA.Text = buttonA.Text.ToUpper(CultureInfo.CurrentCulture); + buttonB.Text = buttonB.Text.ToUpper(CultureInfo.CurrentCulture); + buttonC.Text = buttonC.Text.ToUpper(CultureInfo.CurrentCulture); + buttonD.Text = buttonD.Text.ToUpper(CultureInfo.CurrentCulture); + buttonE.Text = buttonE.Text.ToUpper(CultureInfo.CurrentCulture); + buttonF.Text = buttonF.Text.ToUpper(CultureInfo.CurrentCulture); + buttonG.Text = buttonG.Text.ToUpper(CultureInfo.CurrentCulture); + buttonH.Text = buttonH.Text.ToUpper(CultureInfo.CurrentCulture); + buttonI.Text = buttonI.Text.ToUpper(CultureInfo.CurrentCulture); + buttonJ.Text = buttonJ.Text.ToUpper(CultureInfo.CurrentCulture); + buttonK.Text = buttonK.Text.ToUpper(CultureInfo.CurrentCulture); + buttonL.Text = buttonL.Text.ToUpper(CultureInfo.CurrentCulture); + buttonM.Text = buttonM.Text.ToUpper(CultureInfo.CurrentCulture); + buttonN.Text = buttonN.Text.ToUpper(CultureInfo.CurrentCulture); + buttonO.Text = buttonO.Text.ToUpper(CultureInfo.CurrentCulture); + buttonP.Text = buttonP.Text.ToUpper(CultureInfo.CurrentCulture); + buttonQ.Text = buttonQ.Text.ToUpper(CultureInfo.CurrentCulture); + buttonR.Text = buttonR.Text.ToUpper(CultureInfo.CurrentCulture); + buttonS.Text = buttonS.Text.ToUpper(CultureInfo.CurrentCulture); + buttonT.Text = buttonT.Text.ToUpper(CultureInfo.CurrentCulture); + buttonU.Text = buttonU.Text.ToUpper(CultureInfo.CurrentCulture); + buttonV.Text = buttonV.Text.ToUpper(CultureInfo.CurrentCulture); + buttonW.Text = buttonW.Text.ToUpper(CultureInfo.CurrentCulture); + buttonX.Text = buttonX.Text.ToUpper(CultureInfo.CurrentCulture); + buttonY.Text = buttonY.Text.ToUpper(CultureInfo.CurrentCulture); + buttonZ.Text = buttonZ.Text.ToUpper(CultureInfo.CurrentCulture); } void ButtonsCaseLower() { - buttonA.Text = buttonA.Text.ToLower(); - buttonB.Text = buttonB.Text.ToLower(); - buttonC.Text = buttonC.Text.ToLower(); - buttonD.Text = buttonD.Text.ToLower(); - buttonE.Text = buttonE.Text.ToLower(); - buttonF.Text = buttonF.Text.ToLower(); - buttonG.Text = buttonG.Text.ToLower(); - buttonH.Text = buttonH.Text.ToLower(); - buttonI.Text = buttonI.Text.ToLower(); - buttonJ.Text = buttonJ.Text.ToLower(); - buttonK.Text = buttonK.Text.ToLower(); - buttonL.Text = buttonL.Text.ToLower(); - buttonM.Text = buttonM.Text.ToLower(); - buttonN.Text = buttonN.Text.ToLower(); - buttonO.Text = buttonO.Text.ToLower(); - buttonP.Text = buttonP.Text.ToLower(); - buttonQ.Text = buttonQ.Text.ToLower(); - buttonR.Text = buttonR.Text.ToLower(); - buttonS.Text = buttonS.Text.ToLower(); - buttonT.Text = buttonT.Text.ToLower(); - buttonU.Text = buttonU.Text.ToLower(); - buttonV.Text = buttonV.Text.ToLower(); - buttonW.Text = buttonW.Text.ToLower(); - buttonX.Text = buttonX.Text.ToLower(); - buttonY.Text = buttonY.Text.ToLower(); - buttonZ.Text = buttonZ.Text.ToLower(); + buttonA.Text = buttonA.Text.ToLower(CultureInfo.CurrentCulture); + buttonB.Text = buttonB.Text.ToLower(CultureInfo.CurrentCulture); + buttonC.Text = buttonC.Text.ToLower(CultureInfo.CurrentCulture); + buttonD.Text = buttonD.Text.ToLower(CultureInfo.CurrentCulture); + buttonE.Text = buttonE.Text.ToLower(CultureInfo.CurrentCulture); + buttonF.Text = buttonF.Text.ToLower(CultureInfo.CurrentCulture); + buttonG.Text = buttonG.Text.ToLower(CultureInfo.CurrentCulture); + buttonH.Text = buttonH.Text.ToLower(CultureInfo.CurrentCulture); + buttonI.Text = buttonI.Text.ToLower(CultureInfo.CurrentCulture); + buttonJ.Text = buttonJ.Text.ToLower(CultureInfo.CurrentCulture); + buttonK.Text = buttonK.Text.ToLower(CultureInfo.CurrentCulture); + buttonL.Text = buttonL.Text.ToLower(CultureInfo.CurrentCulture); + buttonM.Text = buttonM.Text.ToLower(CultureInfo.CurrentCulture); + buttonN.Text = buttonN.Text.ToLower(CultureInfo.CurrentCulture); + buttonO.Text = buttonO.Text.ToLower(CultureInfo.CurrentCulture); + buttonP.Text = buttonP.Text.ToLower(CultureInfo.CurrentCulture); + buttonQ.Text = buttonQ.Text.ToLower(CultureInfo.CurrentCulture); + buttonR.Text = buttonR.Text.ToLower(CultureInfo.CurrentCulture); + buttonS.Text = buttonS.Text.ToLower(CultureInfo.CurrentCulture); + buttonT.Text = buttonT.Text.ToLower(CultureInfo.CurrentCulture); + buttonU.Text = buttonU.Text.ToLower(CultureInfo.CurrentCulture); + buttonV.Text = buttonV.Text.ToLower(CultureInfo.CurrentCulture); + buttonW.Text = buttonW.Text.ToLower(CultureInfo.CurrentCulture); + buttonX.Text = buttonX.Text.ToLower(CultureInfo.CurrentCulture); + buttonY.Text = buttonY.Text.ToLower(CultureInfo.CurrentCulture); + buttonZ.Text = buttonZ.Text.ToLower(CultureInfo.CurrentCulture); } void ToggleShift() Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Girder Plugin.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Girder Plugin.cs 2007-12-13 16:37:04 UTC (rev 1155) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Girder Plugin.cs 2007-12-14 03:55:11 UTC (rev 1156) @@ -36,7 +36,7 @@ string _pluginFile; - RemoteHandler _remoteButtonHandler = null; + RemoteHandler _remoteButtonHandler; GirderPluginWrapper _pluginWrapper; @@ -86,7 +86,7 @@ _pluginWrapper = new GirderPluginWrapper(_pluginFile); - _pluginWrapper.EventCallback += new GirderPluginWrapper.PluginEventCallback(PluginCallback); + _pluginWrapper.EventCallback += new PluginEventCallback(PluginCallback); bool open = _pluginWrapper.GirOpen(); if (open) Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/GirderPluginWrapper.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/GirderPluginWrapper.cs 2007-12-13 16:37:04 UTC (rev 1155) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/GirderPluginWrapper.cs 2007-12-14 03:55:11 UTC (rev 1156) @@ -9,7 +9,20 @@ namespace GirderPlugin { + #region Delegates + /// <summary> + /// Callback for when the plugin sends an event. + /// </summary> + /// <param name="eventstring">Plugin event string.</param> + /// <param name="payload">Additional data.</param> + /// <param name="len">Length of additional data.</param> + /// <param name="device">Device ID, to uniquely identify this plugin.</param> + public delegate void PluginEventCallback(string eventstring, IntPtr payload, int len, int device); + + #endregion Delegates + + /// <summary> /// Wrapper class to work with Girder 3.x plugins. /// </summary> public class GirderPluginWrapper : IDisposable @@ -41,11 +54,11 @@ #region Interop - [DllImport("kernel32")] + [DllImport("kernel32", CharSet = CharSet.Auto)] extern static IntPtr LoadLibrary( string dllFileName); - [DllImport("kernel32")] + [DllImport("kernel32", CharSet = CharSet.Auto)] static extern IntPtr GetProcAddress( IntPtr module, string functionName); @@ -336,15 +349,6 @@ #endregion Variables - /// <summary> - /// Callback for when the plugin sends an event. - /// </summary> - /// <param name="eventstring">Plugin event string.</param> - /// <param name="payload">Additional data.</param> - /// <param name="len">Length of additional data.</param> - /// <param name="device">Device ID, to uniquely identify this plugin.</param> - public delegate void PluginEventCallback(string eventstring, IntPtr payload, int len, int device); - #region Girder Plugin Properties /// <summary> @@ -841,7 +845,7 @@ #region Implementation - bool WriteString(IntPtr stringPtr, int maxSize, string value) + static bool WriteString(IntPtr stringPtr, int maxSize, string value) { try { Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Properties/AssemblyInfo.cs 2007-12-13 16:37:04 UTC (rev 1155) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Properties/AssemblyInfo.cs 2007-12-14 03:55:11 UTC (rev 1156) @@ -1,4 +1,5 @@ -using System.Reflection; +using System; +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Security.Permissions; @@ -20,6 +21,8 @@ // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] +[assembly: CLSCompliant(true)] + // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("bc4c093c-29d8-491a-866b-fa370bc4e0d3")] Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs 2007-12-13 16:37:04 UTC (rev 1155) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs 2007-12-14 03:55:11 UTC (rev 1156) @@ -203,7 +203,6 @@ static RemoteHandler _remoteButtonHandler; static Socket _socket; - static IAsyncResult _asynResult; static AsyncCallback _pfnCallBack; static string _irTransRemoteModel; static string _irTransServerAddress; @@ -445,7 +444,7 @@ CSocketPacket socketPkt = new CSocketPacket(); socketPkt.ThisSocket = _socket; - _asynResult = _socket.BeginReceive(socketPkt.ReceiveBuffer, 0, socketPkt.ReceiveBuffer.Length, SocketFlags.None, _pfnCallBack, socketPkt); + _socket.BeginReceive(socketPkt.ReceiveBuffer, 0, socketPkt.ReceiveBuffer.Length, SocketFlags.None, _pfnCallBack, socketPkt); } #if TRACE catch (SocketException ex) @@ -534,42 +533,6 @@ #endif } - /// <summary> - /// Converts structs to byte arrays. - /// </summary> - /// <param name="structure">The structure.</param> - /// <param name="size">The size.</param> - /// <returns>Converted structure.</returns> - static byte[] StructToByteArray(object structure, int size) - { - if (structure == null || size <= 0) - return null; - - try - { - byte[] byteArray = new byte[size]; - - IntPtr pointer = Marshal.AllocHGlobal(size); - Marshal.StructureToPtr(structure, pointer, false); - Marshal.Copy(pointer, byteArray, 0, size); - Marshal.FreeHGlobal(pointer); - - return byteArray; - } -#if TRACE - catch (Exception ex) - { - Trace.WriteLine(ex.ToString()); - } -#else - catch - { - } -#endif - - return null; - } - #endregion Implementation } Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DeviceIoOverlapped.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DeviceIoOverlapped.cs 2007-12-13 16:37:04 UTC (rev 1155) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DeviceIoOverlapped.cs 2007-12-14 03:55:11 UTC (rev 1156) @@ -13,13 +13,13 @@ #region Variables - IntPtr _ptrOverlapped = IntPtr.Zero; + IntPtr _ptrOverlapped = IntPtr.Zero; - int _fieldOffsetInternalLow = 0; - int _fieldOffsetInternalHigh = 0; - int _fieldOffsetOffsetLow = 0; - int _fieldOffsetOffsetHigh = 0; - int _fieldOffsetEventHandle = 0; + int _fieldOffsetInternalLow; + int _fieldOffsetInternalHigh; + int _fieldOffsetOffsetLow; + int _fieldOffsetOffsetHigh; + int _fieldOffsetEventHandle; #endregion Variables Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Wii Remote Receiver/Wii Remote Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Wii Remote Receiver/Wii Remote Receiver.cs 2007-12-13 16:37:04 UTC (rev 1155) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Wii Remote Receiver/Wii Remote Receiver.cs 2007-12-14 03:55:11 UTC (rev 1156) @@ -25,6 +25,8 @@ Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\IR Server Suite\\IR Server\\Wii Remote Receiver.xml"; + readonly int ScreenWidth = Screen.PrimaryScreen.WorkingArea.Width; + readonly int ScreenHeight = Screen.PrimaryScreen.WorkingArea.Height; #endregion Constants @@ -46,9 +48,6 @@ WiimoteState _previousState; - int _screenWidth = Screen.PrimaryScreen.WorkingArea.Width; - int _screenHeight = Screen.PrimaryScreen.WorkingArea.Height; - #endregion Variables #region Implementation @@ -330,8 +329,8 @@ if (ws.IRState.Found1 && ws.IRState.Found2) { - int x = (int)(_screenWidth - (ws.IRState.X1 + ws.IRState.X2) / 2 * _screenWidth); - int y = (int)((ws.IRState.Y1 + ws.IRState.Y2) / 2 * _screenHeight); + int x = (int)(ScreenWidth - (ws.IRState.X1 + ws.IRState.X2) / 2 * ScreenWidth); + int y = (int)((ws.IRState.Y1 + ws.IRState.Y2) / 2 * ScreenHeight); if (_handleMouseLocally) { @@ -339,8 +338,8 @@ } else { - int prevX = (int)(_screenWidth - (_previousState.IRState.X1 + _previousState.IRState.X2) / 2 * _screenWidth); - int prevY = (int)((_previousState.IRState.Y1 + _previousState.IRState.Y2) / 2 * _screenHeight); + int prevX = (int)(ScreenWidth - (_previousState.IRState.X1 + _previousState.IRState.X2) / 2 * ScreenWidth); + int prevY = (int)((_previousState.IRState.Y1 + _previousState.IRState.Y2) / 2 * ScreenHeight); int deltaX = x - prevX; int deltaY = y - prevY; Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/ReceiverWindow.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/ReceiverWindow.cs 2007-12-13 16:37:04 UTC (rev 1155) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/ReceiverWindow.cs 2007-12-14 03:55:11 UTC (rev 1156) @@ -22,7 +22,7 @@ #region Variables - ProcessMessage _processMessage = null; + ProcessMessage _processMessage; #endregion Variables @@ -52,7 +52,7 @@ createParams.ExStyle = 0x80; createParams.Style = unchecked((int)0x80000000); - CreateHandle(createParams); + base.CreateHandle(createParams); } #endregion Constructor Modified: trunk/plugins/IR Server Suite/Input Service/Input Service/InputService.cs =================================================================== --- trunk/plugins/IR Server Suite/Input Service/Input Service/InputService.cs 2007-12-13 16:37:04 UTC (rev 1155) +++ trunk/plugins/IR Server Suite/Input Service/Input Service/InputService.cs 2007-12-14 03:55:11 UTC (rev 1156) @@ -30,7 +30,7 @@ /// <summary> /// Describes the operation mode of the Input Service. /// </summary> - public enum InputServiceMode + enum InputServiceMode { /// <summary> /// Acts as a standard Server (Default). @@ -49,9 +49,9 @@ #endregion Enumerations /// <summary> - /// MediaPortal Input Service. + /// Input Service. /// </summary> - public class InputService : ServiceBase + class InputService : ServiceBase { #region Constants Modified: trunk/plugins/IR Server Suite/Input Service/Input Service/InputServiceInstaller.cs =================================================================== --- trunk/plugins/IR Server Suite/Input Service/Input Service/InputServiceInstaller.cs 2007-12-13 16:37:04 UTC (rev 1155) +++ trunk/plugins/IR Server Suite/Input Service/Input Service/InputServiceInstaller.cs 2007-12-14 03:55:11 UTC (rev 1156) @@ -15,7 +15,7 @@ /// Installer for the Input Service. /// </summary> [RunInstaller(true)] - public class InputServiceInstaller : Installer + class InputServiceInstaller : Installer { /// <summary> Modified: trunk/plugins/IR Server Suite/Input Service/Input Service/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Input Service/Input Service/Program.cs 2007-12-13 16:37:04 UTC (rev 1155) +++ trunk/plugins/IR Server Suite/Input Service/Input Service/Program.cs 2007-12-14 03:55:11 UTC (rev 1156) @@ -23,29 +23,33 @@ #region Constants - public const string ServiceName = "MPInputService"; - public const string ServiceDisplayName = "MediaPortal Input Service"; + public const string ServiceName = "InputService"; + public const string ServiceDisplayName = "Input Service"; public const string ServiceDescription = "Provides access to input devices"; #endregion Constants + /// <summary> + /// The main entry point for the service. + /// </summary> + /// <param name="args">Command line parameters.</param> static void Main(string[] args) { - if (args.Length >= 1) + if (args.Length == 1) { TransactedInstaller transactedInstaller = new TransactedInstaller(); InputServiceInstaller inputServiceInstaller = new InputServiceInstaller(); transactedInstaller.Installers.Add(inputServiceInstaller); - String path = String.Format("/assemblypath={0}", Assembly.GetExecutingAssembly().Location); - String[] cmdline = { path }; + string path = "/assemblypath=" + Assembly.GetExecutingAssembly().Location; + string[] cmdline = { path }; InstallContext installContext = new InstallContext(String.Empty, cmdline); transactedInstaller.Context = installContext; - if (args[0].Equals("/install", System.StringComparison.OrdinalIgnoreCase)) + if (args[0].Equals("/install", StringComparison.OrdinalIgnoreCase)) transactedInstaller.Install(new Hashtable()); - else if (args[0].Equals("/uninstall", System.StringComparison.OrdinalIgnoreCase)) + else if (args[0].Equals("/uninstall", StringComparison.OrdinalIgnoreCase)) transactedInstaller.Uninstall(null); return; Modified: trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Config.cs =================================================================== --- trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Config.cs 2007-12-13 16:37:04 UTC (rev 1155) +++ trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Config.cs 2007-12-14 03:55:11 UTC (rev 1156) @@ -167,7 +167,7 @@ nameCell.AddController(nameCellController); nameCell.AddController(new SourceGrid.Cells.Controllers.ToolTipText()); - nameCell.ToolTipText = string.Format("{0}\nVersion: {1}\nAuthor: {2}\n{3}", transceiver.Name, transceiver.Version, transceiver.Author, transceiver.Description); + nameCell.ToolTipText = String.Format("{0}\nVersion: {1}\nAuthor: {2}\n{3}", transceiver.Name, transceiver.Version, transceiver.Author, transceiver.Description); gridPlugins[row, 0] = nameCell; Modified: trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Input Service Configuration.exe.manifest =================================================================== --- trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Input Service Configuration.exe.manifest 2007-12-13 16:37:04 UTC (rev 1155) +++ trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Input Service Configuration.exe.manifest 2007-12-14 03:55:11 UTC (rev 1156) @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" ?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" > <assemblyIdentity version="1.0.3.5" processorArchitecture="X86" name="Input Service Configuration" type="win32" /> - <description>Configure the local MediaPortal Input Service</description> + <description>Configure the local Input Service</description> <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> <security> <requestedPrivileges> Modified: trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Properties/AssemblyInfo.cs 2007-12-13 16:37:04 UTC (rev 1155) +++ trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Properties/AssemblyInfo.cs 2007-12-14 03:55:11 UTC (rev 1156) @@ -6,7 +6,7 @@ // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Input Service Configuration")] -[assembly: AssemblyDescription("Configure the Input Service")] +[assembly: AssemblyDescription("Configure the local Input Service")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("and-81")] [assembly: AssemblyProduct("Input Service Configuration")] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |