From: <an...@us...> - 2007-08-02 15:40:58
|
Revision: 784 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=784&view=rev Author: and-81 Date: 2007-08-02 08:40:55 -0700 (Thu, 02 Aug 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs trunk/plugins/IR Server Suite/Applications/Debug Client/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs trunk/plugins/IR Server Suite/Applications/IR Blast/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/IR Server/IR Server.csproj trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs trunk/plugins/IR Server Suite/Applications/IR Server/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Translator/Configuration.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/GetKeyCodeForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs trunk/plugins/IR Server Suite/Applications/Translator/MappedEvent.cs trunk/plugins/IR Server Suite/Applications/Translator/Program.cs trunk/plugins/IR Server Suite/Applications/Translator/ProgramSettings.cs trunk/plugins/IR Server Suite/Applications/Translator/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Translator/Translator.csproj trunk/plugins/IR Server Suite/Applications/Tray Launcher/GetKeyCodeForm.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/ExternalProgram.Designer.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/ExternalProgram.cs trunk/plugins/IR Server Suite/Common/IrssUtils/IrssUtils.csproj trunk/plugins/IR Server Suite/Common/IrssUtils/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Win32.cs trunk/plugins/IR Server Suite/Common/MPUtils/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IPC/AppModule.InterProcessComm/IClientChannel.cs trunk/plugins/IR Server Suite/IPC/AppModule.InterProcessComm/IInterProcessConnection.cs trunk/plugins/IR Server Suite/IPC/AppModule.InterProcessComm/InterProcessIOException.cs trunk/plugins/IR Server Suite/IPC/AppModule.NamedPipes/NamedPipeNative.cs trunk/plugins/IR Server Suite/IPC/Named Pipes/PipeMessage.cs trunk/plugins/IR Server Suite/IPC/Named Pipes/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Suite.sln trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MPBlastZonePlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/InputMapper/InputHandler.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MappedEvent.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs Added Paths: ----------- trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/WindowList.Designer.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/WindowList.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/WindowList.resx trunk/plugins/IR Server Suite/Common/IrssUtils/Keyboard.cs Removed Paths: ------------- trunk/plugins/IR Server Suite/Applications/Translator/Forms/WindowList.Designer.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/WindowList.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/WindowList.resx Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-08-02 00:09:20 UTC (rev 783) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-08-02 15:40:55 UTC (rev 784) @@ -22,7 +22,7 @@ #region Enumerations /// <summary> - /// A list of MCE remote buttons + /// A list of MCE remote buttons. /// </summary> public enum MceButton { @@ -174,6 +174,8 @@ case "Blast Success": case "Blast Failure": case "Start Learn": + case "Keyboard Event": + case "Mouse Event": return; case "Clients": @@ -204,10 +206,10 @@ return; } - case "Remote Button": + case "Remote Event": { string keyCode = Encoding.ASCII.GetString(received.Data); - RemoteButtonPressed(keyCode); + RemoteHandlerCallback(keyCode); return; } @@ -355,9 +357,9 @@ return true; } - void RemoteButtonPressed(string keyCode) + void RemoteHandlerCallback(string keyCode) { - string text = String.Format("Remote Button \"{0}\"", keyCode); + string text = String.Format("Remote Event \"{0}\"", keyCode); this.Invoke(_AddStatusLine, new Object[] { text }); } @@ -572,7 +574,7 @@ BitConverter.GetBytes(keyCode).CopyTo(data, 0); BitConverter.GetBytes(0).CopyTo(data, 4); - PipeMessage message = new PipeMessage(_localPipeName, Environment.MachineName, "Forward Remote Button", data); + PipeMessage message = new PipeMessage(_localPipeName, Environment.MachineName, "Forward Remote Event", data); PipeAccess.SendMessage(Common.ServerPipeName, _serverAddress, message.ToString()); } catch (Exception ex) Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/Properties/AssemblyInfo.cs 2007-08-02 00:09:20 UTC (rev 783) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/Properties/AssemblyInfo.cs 2007-08-02 15:40:55 UTC (rev 784) @@ -33,7 +33,7 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.3.2")] -[assembly: AssemblyFileVersion("1.0.3.2")] +[assembly: AssemblyVersion("1.0.3.3")] +[assembly: AssemblyFileVersion("1.0.3.3")] [assembly: CLSCompliant(true)] Modified: trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2007-08-02 00:09:20 UTC (rev 783) +++ trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2007-08-02 15:40:55 UTC (rev 784) @@ -31,6 +31,7 @@ static string _blastSpeed = "None"; static bool _treatAsChannelNumber = false; + static int _padChannelNumber = 0; #endregion Variables @@ -74,6 +75,10 @@ _treatAsChannelNumber = true; continue; + case "-pad": + int.TryParse(args[++index], out _padChannelNumber); + continue; + default: irCommands.Add(args[index]); continue; @@ -109,8 +114,19 @@ if (_treatAsChannelNumber) { Info("Processing channel: {0}", command); - foreach (char digit in command) + + StringBuilder channelNumber = new StringBuilder(command); + + if (_padChannelNumber > 0) { + for (int index = 0; index < _padChannelNumber - command.Length; index++) + channelNumber.Insert(0, '0'); + + Info("Padding channel number: {0} becomes {1}", command, channelNumber.ToString()); + } + + foreach (char digit in channelNumber.ToString()) + { if (digit == '~') { Thread.Sleep(500); @@ -172,13 +188,15 @@ { IrssLog.Debug("Show Help"); - Console.WriteLine("IRBlast.exe -host <server> -port [port] -speed [speed] [-channel] <commands>"); + Console.WriteLine("IRBlast -host <server> [-port x] [-speed x] [-pad x] [-channel] <commands>"); Console.WriteLine(""); Console.WriteLine("Use -host to specify the computer that is hosting the IR Server."); Console.WriteLine("Use -port to blast to a particular blaster port (Optional)."); Console.WriteLine("Use -speed to set the blaster speed (Optional)."); Console.WriteLine("Use -channel to tell IR Blast to break apart the following IR Command and"); Console.WriteLine(" use each digit for a separate IR blast (Optional)."); + Console.WriteLine("Use -pad to tell IR Blast to pad channel numbers to a certain length"); + Console.WriteLine(" (Optional, Requires -channel)."); Console.WriteLine("Use a tilde ~ between commands to insert half second pauses."); Console.WriteLine(""); Console.WriteLine(""); @@ -194,10 +212,10 @@ Console.WriteLine("This would blast the \"Turn on surround.IR\" command on the MEDIAPC computer"); Console.WriteLine("to blaster port 2 at the default blaster speed."); Console.WriteLine(""); - Console.WriteLine("IRBlast -host HTPC -channel 302"); + Console.WriteLine("IRBlast -host HTPC -pad 4 -channel 302"); Console.WriteLine(""); - Console.WriteLine("This would blast the 3.IR, 0.IR, and 2.IR commands on the HTPC computer to"); - Console.WriteLine("the default blaster port at the default blaster speed."); + Console.WriteLine("This would blast the 0.IR (for padding), 3.IR, 0.IR, and 2.IR commands on"); + Console.WriteLine("the HTPC computer to the default blaster port at the default blaster speed."); Console.WriteLine(""); Console.WriteLine(""); } @@ -435,7 +453,9 @@ { switch (received.Name) { - case "Remote Button": + case "Remote Event": + case "Keyboard Event": + case "Mouse Event": break; case "Blast Success": Modified: trunk/plugins/IR Server Suite/Applications/IR Blast/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast/Properties/AssemblyInfo.cs 2007-08-02 00:09:20 UTC (rev 783) +++ trunk/plugins/IR Server Suite/Applications/IR Blast/Properties/AssemblyInfo.cs 2007-08-02 15:40:55 UTC (rev 784) @@ -33,7 +33,7 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.3.2")] -[assembly: AssemblyFileVersion("1.0.3.2")] +[assembly: AssemblyVersion("1.0.3.3")] +[assembly: AssemblyFileVersion("1.0.3.3")] [assembly: CLSCompliant(true)] \ No newline at end of file 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-08-02 00:09:20 UTC (rev 783) +++ trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2007-08-02 15:40:55 UTC (rev 784) @@ -32,6 +32,7 @@ static string _blastSpeed = "None"; static bool _treatAsChannelNumber = false; + static int _padChannelNumber = 0; #endregion Variables @@ -73,6 +74,10 @@ _treatAsChannelNumber = true; continue; + case "-pad": + int.TryParse(args[++index], out _padChannelNumber); + continue; + default: irCommands.Add(args[index]); continue; @@ -108,8 +113,19 @@ if (_treatAsChannelNumber) { IrssLog.Info("Processing channel: {0}", command); - foreach (char digit in command) + + StringBuilder channelNumber = new StringBuilder(command); + + if (_padChannelNumber > 0) { + for (int index = 0; index < _padChannelNumber - command.Length; index++) + channelNumber.Insert(0, '0'); + + IrssLog.Info("Padding channel number: {0} becomes {1}", command, channelNumber.ToString()); + } + + foreach (char digit in channelNumber.ToString()) + { if (digit == '~') { Thread.Sleep(500); @@ -141,7 +157,7 @@ } } - else + else // Give help ... { ShowHelp(); } @@ -399,7 +415,9 @@ { switch (received.Name) { - case "Remote Button": + case "Remote Event": + case "Keyboard Event": + case "Mouse Event": break; case "Blast Success": Modified: trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Properties/AssemblyInfo.cs 2007-08-02 00:09:20 UTC (rev 783) +++ trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Properties/AssemblyInfo.cs 2007-08-02 15:40:55 UTC (rev 784) @@ -33,7 +33,7 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.3.2")] -[assembly: AssemblyFileVersion("1.0.3.2")] +[assembly: AssemblyVersion("1.0.3.3")] +[assembly: AssemblyFileVersion("1.0.3.3")] [assembly: CLSCompliant(true)] \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IR Server.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IR Server.csproj 2007-08-02 00:09:20 UTC (rev 783) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IR Server.csproj 2007-08-02 15:40:55 UTC (rev 784) @@ -120,10 +120,6 @@ <Project>{CA15769C-232E-4CA7-94FD-206A06CA3ABB}</Project> <Name>IrssUtils</Name> </ProjectReference> - <ProjectReference Include="..\..\Common\MPUtils\MPUtils.csproj"> - <Project>{08F57DD7-2C6E-484E-9CC5-835F70C5BC64}</Project> - <Name>MPUtils</Name> - </ProjectReference> <ProjectReference Include="..\..\IPC\Named Pipes\Named Pipes.csproj"> <Project>{F4EA6055-7133-4F18-8971-E19ADEB482C1}</Project> <Name>Named Pipes</Name> Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-08-02 00:09:20 UTC (rev 783) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-08-02 15:40:55 UTC (rev 784) @@ -46,7 +46,7 @@ #region Constants - public static readonly string ConfigurationFile = Common.FolderAppData + "IR Server\\IR Server.xml"; + static readonly string ConfigurationFile = Common.FolderAppData + "IR Server\\IR Server.xml"; #endregion Constants @@ -98,7 +98,7 @@ /// <summary> /// Start the server /// </summary> - /// <returns>success</returns> + /// <returns>success.</returns> internal bool Start() { try @@ -202,7 +202,11 @@ } if (_pluginReceive != null && _pluginReceive.CanReceive) - _pluginReceive.RemoteButtonCallback += new RemoteButtonHandler(RemoteButtonPressed); + { + _pluginReceive.RemoteCallback += new RemoteHandler(RemoteHandlerCallback); + _pluginReceive.KeyboardCallback += new KeyboardHandler(KeyboardHandlerCallback); + _pluginReceive.MouseCallback += new MouseHandler(MouseHandlerCallback); + } _notifyIcon.Visible = true; @@ -233,7 +237,11 @@ } if (_pluginReceive != null && _pluginReceive.CanReceive) - _pluginReceive.RemoteButtonCallback -= new RemoteButtonHandler(RemoteButtonPressed); + { + _pluginReceive.RemoteCallback -= new RemoteHandler(RemoteHandlerCallback); + _pluginReceive.KeyboardCallback -= new KeyboardHandler(KeyboardHandlerCallback); + _pluginReceive.MouseCallback -= new MouseHandler(MouseHandlerCallback); + } // Stop Plugin(s) try @@ -486,36 +494,102 @@ catch { } } - void RemoteButtonPressed(string keyCode) + void RemoteHandlerCallback(string keyCode) { - IrssLog.Debug("Remote Button Pressed: {0}", keyCode); - + IrssLog.Debug("Remote Event: {0}", keyCode); + byte[] bytes = Encoding.ASCII.GetBytes(keyCode); switch (_mode) { case IRServerMode.ServerMode: { - PipeMessage message = new PipeMessage(Common.ServerPipeName, Environment.MachineName, "Remote Button", bytes); + PipeMessage message = new PipeMessage(Common.ServerPipeName, Environment.MachineName, "Remote Event", bytes); SendToAll(message); break; } case IRServerMode.RelayMode: { - PipeMessage message = new PipeMessage(_localPipeName, Environment.MachineName, "Forward Remote Button", bytes); + PipeMessage message = new PipeMessage(_localPipeName, Environment.MachineName, "Forward Remote Event", bytes); SendTo(Common.ServerPipeName, _hostComputer, message); break; } case IRServerMode.RepeaterMode: { - IrssLog.Debug("Remote button press ignored, IR Server is in Repeater Mode."); + IrssLog.Debug("Remote event ignored, IR Server is in Repeater Mode."); break; } } } + void KeyboardHandlerCallback(int vKey, bool keyUp) + { + IrssLog.Debug("Keyboard Event: {0}, keyUp: {1}", vKey, keyUp); + + byte[] bytes = new byte[8]; + BitConverter.GetBytes(vKey).CopyTo(bytes, 0); + BitConverter.GetBytes(keyUp).CopyTo(bytes, 4); + + switch (_mode) + { + case IRServerMode.ServerMode: + { + PipeMessage message = new PipeMessage(Common.ServerPipeName, Environment.MachineName, "Keyboard Event", bytes); + SendToAll(message); + break; + } + + case IRServerMode.RelayMode: + { + PipeMessage message = new PipeMessage(_localPipeName, Environment.MachineName, "Forward Keyboard Event", bytes); + SendTo(Common.ServerPipeName, _hostComputer, message); + break; + } + + case IRServerMode.RepeaterMode: + { + IrssLog.Debug("Keyboard event ignored, IR Server is in Repeater Mode."); + break; + } + } + } + + void MouseHandlerCallback(int deltaX, int deltaY, int buttons) + { + IrssLog.Debug("Mouse Event - deltaX: {0}, deltaY: {1}, buttons: {2}", deltaX, deltaY, buttons); + + byte[] bytes = new byte[12]; + BitConverter.GetBytes(deltaX).CopyTo(bytes, 0); + BitConverter.GetBytes(deltaY).CopyTo(bytes, 4); + BitConverter.GetBytes(buttons).CopyTo(bytes, 8); + + switch (_mode) + { + case IRServerMode.ServerMode: + { + PipeMessage message = new PipeMessage(Common.ServerPipeName, Environment.MachineName, "Mouse Event", bytes); + SendToAll(message); + break; + } + + case IRServerMode.RelayMode: + { + PipeMessage message = new PipeMessage(_localPipeName, Environment.MachineName, "Forward Mouse Event", bytes); + SendTo(Common.ServerPipeName, _hostComputer, message); + break; + } + + case IRServerMode.RepeaterMode: + { + IrssLog.Debug("Mouse event ignored, IR Server is in Repeater Mode."); + break; + } + } + } + + void SendToAll(PipeMessage message) { IrssLog.Debug("SendToAll({0})", message.ToString()); @@ -814,28 +888,14 @@ } byte[] data = null; - FileStream fileStream = null; try { - string tempFile = Path.GetTempFileName(); - - LearnStatus status = _pluginTransmit.Learn(tempFile); + LearnStatus status = _pluginTransmit.Learn(out data); switch (status) { case LearnStatus.Success: - fileStream = new FileStream(tempFile, FileMode.Open); - - if (fileStream != null && fileStream.Length != 0) - { - data = new byte[fileStream.Length]; - fileStream.Read(data, 0, (int)fileStream.Length); - } - - fileStream.Close(); - fileStream = null; - - File.Delete(tempFile); + IrssLog.Info("Learn IR success"); break; case LearnStatus.Failure: @@ -850,9 +910,6 @@ catch (Exception ex) { IrssLog.Error(ex.ToString()); - - if (fileStream != null) - fileStream.Close(); } return data; @@ -866,7 +923,9 @@ { switch (received.Name) { - case "Remote Button": + case "Remote Event": + case "Keyboard Event": + case "Mouse Event": break; case "Register Success": @@ -883,9 +942,9 @@ break; } - case "Forward Remote Button": + case "Forward Remote Event": { - PipeMessage forward = new PipeMessage(Common.ServerPipeName, Environment.MachineName, "Remote Button", received.Data); + PipeMessage forward = new PipeMessage(Common.ServerPipeName, Environment.MachineName, "Remote Event", received.Data); if (_mode == IRServerMode.RelayMode) { forward.Name = received.Name; @@ -898,6 +957,36 @@ break; } + case "Forward Keyboard Event": + { + PipeMessage forward = new PipeMessage(Common.ServerPipeName, Environment.MachineName, "Keyboard Event", received.Data); + if (_mode == IRServerMode.RelayMode) + { + forward.Name = received.Name; + SendTo(Common.ServerPipeName, _hostComputer, forward); + } + else + { + SendToAllExcept(received.FromPipe, received.FromServer, forward); + } + break; + } + + case "Forward Mouse Event": + { + PipeMessage forward = new PipeMessage(Common.ServerPipeName, Environment.MachineName, "Mouse Event", received.Data); + if (_mode == IRServerMode.RelayMode) + { + forward.Name = received.Name; + SendTo(Common.ServerPipeName, _hostComputer, forward); + } + else + { + SendToAllExcept(received.FromPipe, received.FromServer, forward); + } + break; + } + case "List": { if (_mode != IRServerMode.RelayMode) Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Properties/AssemblyInfo.cs 2007-08-02 00:09:20 UTC (rev 783) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Properties/AssemblyInfo.cs 2007-08-02 15:40:55 UTC (rev 784) @@ -34,8 +34,8 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.3.2")] -[assembly: AssemblyFileVersion("1.0.3.2")] +[assembly: AssemblyVersion("1.0.3.3")] +[assembly: AssemblyFileVersion("1.0.3.3")] [assembly: CLSCompliant(true)] Modified: trunk/plugins/IR Server Suite/Applications/Translator/Configuration.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Configuration.cs 2007-08-02 00:09:20 UTC (rev 783) +++ trunk/plugins/IR Server Suite/Applications/Translator/Configuration.cs 2007-08-02 15:40:55 UTC (rev 784) @@ -9,7 +9,10 @@ namespace Translator { - + + /// <summary> + /// Translator configuration. + /// </summary> [XmlRoot] public class Configuration { @@ -26,6 +29,9 @@ #region Properties + /// <summary> + /// IR Server host. + /// </summary> [XmlElement] public string ServerHost { @@ -33,6 +39,9 @@ set { _serverHost = value; } } + /// <summary> + /// System wide button mappings. + /// </summary> [XmlArray] public List<ButtonMapping> SystemWideMappings { @@ -40,6 +49,9 @@ set { _systemWideMappings = value; } } + /// <summary> + /// Program settings. + /// </summary> [XmlArray] public List<ProgramSettings> Programs { @@ -47,6 +59,9 @@ set { _programSettings = value; } } + /// <summary> + /// Mapped events. + /// </summary> [XmlArray] public List<MappedEvent> Events { Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs 2007-08-02 00:09:20 UTC (rev 783) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs 2007-08-02 15:40:55 UTC (rev 784) @@ -431,7 +431,7 @@ } else if (radioButtonWindowTitle.Checked) { - WindowList windowList = new WindowList(); + IrssUtils.Forms.WindowList windowList = new IrssUtils.Forms.WindowList(); if (windowList.ShowDialog(this) == DialogResult.OK) textBoxMsgTarget.Text = windowList.SelectedWindowTitle; } Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.Designer.cs 2007-08-02 00:09:20 UTC (rev 783) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.Designer.cs 2007-08-02 15:40:55 UTC (rev 784) @@ -46,13 +46,16 @@ this.comboBoxWindowStyle = new System.Windows.Forms.ComboBox(); this.labelWindowStyle = new System.Windows.Forms.Label(); this.checkBoxIgnoreSystemWide = new System.Windows.Forms.CheckBox(); + this.checkBoxForceFocus = new System.Windows.Forms.CheckBox(); + this.groupBoxOptions = new System.Windows.Forms.GroupBox(); + this.groupBoxOptions.SuspendLayout(); this.SuspendLayout(); // // textBoxApp // this.textBoxApp.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxApp.Location = new System.Drawing.Point(8, 56); + this.textBoxApp.Location = new System.Drawing.Point(8, 72); this.textBoxApp.Name = "textBoxApp"; this.textBoxApp.Size = new System.Drawing.Size(336, 20); this.textBoxApp.TabIndex = 3; @@ -60,7 +63,7 @@ // buttonLocate // this.buttonLocate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonLocate.Location = new System.Drawing.Point(352, 56); + this.buttonLocate.Location = new System.Drawing.Point(352, 72); this.buttonLocate.Name = "buttonLocate"; this.buttonLocate.Size = new System.Drawing.Size(24, 20); this.buttonLocate.TabIndex = 4; @@ -72,7 +75,7 @@ // this.labelApplication.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.labelApplication.Location = new System.Drawing.Point(8, 40); + this.labelApplication.Location = new System.Drawing.Point(8, 56); this.labelApplication.Name = "labelApplication"; this.labelApplication.Size = new System.Drawing.Size(336, 16); this.labelApplication.TabIndex = 2; @@ -80,27 +83,28 @@ // // labelAppDisplayName // + this.labelAppDisplayName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.labelAppDisplayName.Location = new System.Drawing.Point(8, 8); this.labelAppDisplayName.Name = "labelAppDisplayName"; - this.labelAppDisplayName.Size = new System.Drawing.Size(144, 20); + this.labelAppDisplayName.Size = new System.Drawing.Size(368, 16); this.labelAppDisplayName.TabIndex = 0; this.labelAppDisplayName.Text = "Application display name:"; - this.labelAppDisplayName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // textBoxDisplayName // this.textBoxDisplayName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxDisplayName.Location = new System.Drawing.Point(152, 8); + this.textBoxDisplayName.Location = new System.Drawing.Point(8, 24); this.textBoxDisplayName.Name = "textBoxDisplayName"; - this.textBoxDisplayName.Size = new System.Drawing.Size(224, 20); + this.textBoxDisplayName.Size = new System.Drawing.Size(368, 20); this.textBoxDisplayName.TabIndex = 1; // // labelStartupFolder // this.labelStartupFolder.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.labelStartupFolder.Location = new System.Drawing.Point(8, 88); + this.labelStartupFolder.Location = new System.Drawing.Point(8, 104); this.labelStartupFolder.Name = "labelStartupFolder"; this.labelStartupFolder.Size = new System.Drawing.Size(336, 16); this.labelStartupFolder.TabIndex = 5; @@ -109,7 +113,7 @@ // buttonStartupFolder // this.buttonStartupFolder.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonStartupFolder.Location = new System.Drawing.Point(352, 104); + this.buttonStartupFolder.Location = new System.Drawing.Point(352, 120); this.buttonStartupFolder.Name = "buttonStartupFolder"; this.buttonStartupFolder.Size = new System.Drawing.Size(24, 20); this.buttonStartupFolder.TabIndex = 7; @@ -121,7 +125,7 @@ // this.textBoxAppStartFolder.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxAppStartFolder.Location = new System.Drawing.Point(8, 104); + this.textBoxAppStartFolder.Location = new System.Drawing.Point(8, 120); this.textBoxAppStartFolder.Name = "textBoxAppStartFolder"; this.textBoxAppStartFolder.Size = new System.Drawing.Size(336, 20); this.textBoxAppStartFolder.TabIndex = 6; @@ -130,7 +134,7 @@ // this.labelAppParams.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.labelAppParams.Location = new System.Drawing.Point(8, 136); + this.labelAppParams.Location = new System.Drawing.Point(8, 152); this.labelAppParams.Name = "labelAppParams"; this.labelAppParams.Size = new System.Drawing.Size(368, 16); this.labelAppParams.TabIndex = 8; @@ -140,7 +144,7 @@ // this.textBoxApplicationParameters.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxApplicationParameters.Location = new System.Drawing.Point(8, 152); + this.textBoxApplicationParameters.Location = new System.Drawing.Point(8, 168); this.textBoxApplicationParameters.Name = "textBoxApplicationParameters"; this.textBoxApplicationParameters.Size = new System.Drawing.Size(368, 20); this.textBoxApplicationParameters.TabIndex = 9; @@ -148,10 +152,10 @@ // buttonOK // this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonOK.Location = new System.Drawing.Point(224, 248); + this.buttonOK.Location = new System.Drawing.Point(224, 336); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(72, 24); - this.buttonOK.TabIndex = 15; + this.buttonOK.TabIndex = 14; this.buttonOK.Text = "OK"; this.buttonOK.UseVisualStyleBackColor = true; this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); @@ -160,10 +164,10 @@ // this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.Location = new System.Drawing.Point(304, 248); + this.buttonCancel.Location = new System.Drawing.Point(304, 336); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(72, 24); - this.buttonCancel.TabIndex = 16; + this.buttonCancel.TabIndex = 15; this.buttonCancel.Text = "Cancel"; this.buttonCancel.UseVisualStyleBackColor = true; this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); @@ -171,20 +175,20 @@ // buttonTest // this.buttonTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.buttonTest.Location = new System.Drawing.Point(8, 248); + this.buttonTest.Location = new System.Drawing.Point(8, 336); this.buttonTest.Name = "buttonTest"; this.buttonTest.Size = new System.Drawing.Size(72, 24); - this.buttonTest.TabIndex = 14; + this.buttonTest.TabIndex = 13; this.buttonTest.Text = "Test"; this.buttonTest.UseVisualStyleBackColor = true; this.buttonTest.Click += new System.EventHandler(this.buttonTest_Click); // // checkBoxShellExecute // - this.checkBoxShellExecute.Location = new System.Drawing.Point(8, 216); + this.checkBoxShellExecute.Location = new System.Drawing.Point(16, 24); this.checkBoxShellExecute.Name = "checkBoxShellExecute"; this.checkBoxShellExecute.Size = new System.Drawing.Size(176, 24); - this.checkBoxShellExecute.TabIndex = 12; + this.checkBoxShellExecute.TabIndex = 0; this.checkBoxShellExecute.Text = "Start using ShellExecute"; this.checkBoxShellExecute.UseVisualStyleBackColor = true; // @@ -194,7 +198,7 @@ | System.Windows.Forms.AnchorStyles.Right))); this.comboBoxWindowStyle.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxWindowStyle.FormattingEnabled = true; - this.comboBoxWindowStyle.Location = new System.Drawing.Point(96, 184); + this.comboBoxWindowStyle.Location = new System.Drawing.Point(96, 200); this.comboBoxWindowStyle.MaxDropDownItems = 4; this.comboBoxWindowStyle.Name = "comboBoxWindowStyle"; this.comboBoxWindowStyle.Size = new System.Drawing.Size(152, 21); @@ -202,7 +206,7 @@ // // labelWindowStyle // - this.labelWindowStyle.Location = new System.Drawing.Point(8, 184); + this.labelWindowStyle.Location = new System.Drawing.Point(8, 200); this.labelWindowStyle.Name = "labelWindowStyle"; this.labelWindowStyle.Size = new System.Drawing.Size(88, 21); this.labelWindowStyle.TabIndex = 10; @@ -211,22 +215,44 @@ // // checkBoxIgnoreSystemWide // - this.checkBoxIgnoreSystemWide.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.checkBoxIgnoreSystemWide.Location = new System.Drawing.Point(200, 216); + this.checkBoxIgnoreSystemWide.Location = new System.Drawing.Point(16, 56); this.checkBoxIgnoreSystemWide.Name = "checkBoxIgnoreSystemWide"; this.checkBoxIgnoreSystemWide.Size = new System.Drawing.Size(176, 24); - this.checkBoxIgnoreSystemWide.TabIndex = 13; + this.checkBoxIgnoreSystemWide.TabIndex = 2; this.checkBoxIgnoreSystemWide.Text = "Ignore System-Wide mappings"; this.checkBoxIgnoreSystemWide.UseVisualStyleBackColor = true; // + // checkBoxForceFocus + // + this.checkBoxForceFocus.Location = new System.Drawing.Point(208, 24); + this.checkBoxForceFocus.Name = "checkBoxForceFocus"; + this.checkBoxForceFocus.Size = new System.Drawing.Size(152, 24); + this.checkBoxForceFocus.TabIndex = 1; + this.checkBoxForceFocus.Text = "Force window focus"; + this.checkBoxForceFocus.UseVisualStyleBackColor = true; + // + // groupBoxOptions + // + this.groupBoxOptions.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxOptions.Controls.Add(this.checkBoxShellExecute); + this.groupBoxOptions.Controls.Add(this.checkBoxForceFocus); + this.groupBoxOptions.Controls.Add(this.checkBoxIgnoreSystemWide); + this.groupBoxOptions.Location = new System.Drawing.Point(8, 232); + this.groupBoxOptions.Name = "groupBoxOptions"; + this.groupBoxOptions.Size = new System.Drawing.Size(368, 88); + this.groupBoxOptions.TabIndex = 12; + this.groupBoxOptions.TabStop = false; + this.groupBoxOptions.Text = "Options"; + // // EditProgramForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(384, 281); - this.Controls.Add(this.checkBoxIgnoreSystemWide); + this.ClientSize = new System.Drawing.Size(384, 369); + this.Controls.Add(this.groupBoxOptions); this.Controls.Add(this.buttonTest); - this.Controls.Add(this.checkBoxShellExecute); this.Controls.Add(this.comboBoxWindowStyle); this.Controls.Add(this.labelWindowStyle); this.Controls.Add(this.buttonCancel); @@ -248,6 +274,7 @@ this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Application"; + this.groupBoxOptions.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); @@ -272,5 +299,7 @@ private System.Windows.Forms.ComboBox comboBoxWindowStyle; private System.Windows.Forms.Label labelWindowStyle; private System.Windows.Forms.CheckBox checkBoxIgnoreSystemWide; + private System.Windows.Forms.CheckBox checkBoxForceFocus; + private System.Windows.Forms.GroupBox groupBoxOptions; } } \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.cs 2007-08-02 00:09:20 UTC (rev 783) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.cs 2007-08-02 15:40:55 UTC (rev 784) @@ -6,6 +6,7 @@ using System.Drawing; using System.IO; using System.Text; +using System.Threading; using System.Windows.Forms; using IrssUtils; @@ -48,6 +49,11 @@ get { return checkBoxShellExecute.Checked; } set { checkBoxShellExecute.Checked = value; } } + public bool ForceWindowFocus + { + get { return checkBoxForceFocus.Checked; } + set { checkBoxForceFocus.Checked = value; } + } public bool IgnoreSystemWide { get { return checkBoxIgnoreSystemWide.Checked; } @@ -66,13 +72,14 @@ if (progSettings != null) { - DisplayName = progSettings.Name; - Filename = progSettings.Filename; - StartupFolder = progSettings.Folder; - Parameters = progSettings.Arguments; - StartState = progSettings.WindowState; - UseShellExecute = progSettings.UseShellExecute; - IgnoreSystemWide = progSettings.IgnoreSystemWide; + DisplayName = progSettings.Name; + Filename = progSettings.Filename; + StartupFolder = progSettings.Folder; + Parameters = progSettings.Arguments; + StartState = progSettings.WindowState; + UseShellExecute = progSettings.UseShellExecute; + ForceWindowFocus = progSettings.ForceWindowFocus; + IgnoreSystemWide = progSettings.IgnoreSystemWide; } } @@ -114,15 +121,33 @@ try { Process process = new Process(); - process.StartInfo.FileName = Filename; - process.StartInfo.WorkingDirectory = StartupFolder; - process.StartInfo.Arguments = Parameters; - process.StartInfo.WindowStyle = StartState; - process.StartInfo.UseShellExecute = UseShellExecute; + process.StartInfo.FileName = Filename; + process.StartInfo.WorkingDirectory = StartupFolder; + process.StartInfo.Arguments = Parameters; + process.StartInfo.WindowStyle = StartState; + process.StartInfo.UseShellExecute = UseShellExecute; IrssLog.Info("Launching program {0}", DisplayName); process.Start(); + + // Give new process focus ... + if (StartState != ProcessWindowStyle.Hidden && ForceWindowFocus) + { + IntPtr processWindow = IntPtr.Zero; + while (!process.HasExited) + { + processWindow = process.MainWindowHandle; + if (processWindow != IntPtr.Zero) + { + Win32.SetForegroundWindow(processWindow); + break; + } + + Thread.Sleep(500); + } + } + } catch (Exception ex) { Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/GetKeyCodeForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/GetKeyCodeForm.cs 2007-08-02 00:09:20 UTC (rev 783) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/GetKeyCodeForm.cs 2007-08-02 15:40:55 UTC (rev 784) @@ -61,7 +61,7 @@ { PipeMessage received = PipeMessage.FromString(message); - if (received.Name == "Remote Button") + if (received.Name == "Remote Event") { _keyCode = Encoding.ASCII.GetString(received.Data); Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2007-08-02 00:09:20 UTC (rev 783) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2007-08-02 15:40:55 UTC (rev 784) @@ -20,7 +20,7 @@ #region Enumerations /// <summary> - /// A list of MCE remote buttons + /// A list of MCE remote buttons. /// </summary> public enum MceButton { @@ -881,7 +881,7 @@ } private void aboutToolStripMenuItem_Click(object sender, EventArgs e) { - MessageBox.Show(this, "Translator\nVersion 1.0.3.2 for IR Server Suite\nBy Aaron Dinnage, 2007", "About Translator", MessageBoxButtons.OK, MessageBoxIcon.Information); + MessageBox.Show(this, "Translator\nVersion 1.0.3.3 for IR Server Suite\nBy Aaron Dinnage, 2007", "About Translator", MessageBoxButtons.OK, MessageBoxIcon.Information); } #endregion Menu Deleted: trunk/plugins/IR Server Suite/Applications/Translator/Forms/WindowList.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/WindowList.Designer.cs 2007-08-02 00:09:20 UTC (rev 783) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/WindowList.Designer.cs 2007-08-02 15:40:55 UTC (rev 784) @@ -1,70 +0,0 @@ -namespace Translator -{ - partial class WindowList - { - /// <summary> - /// Required designer variable. - /// </summary> - private System.ComponentModel.IContainer components = null; - - /// <summary> - /// Clean up any resources being used. - /// </summary> - /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// <summary> - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// </summary> - private void InitializeComponent() - { - this.listBoxWindows = new System.Windows.Forms.ListBox(); - this.SuspendLayout(); - // - // listBoxWindows - // - this.listBoxWindows.Dock = System.Windows.Forms.DockStyle.Fill; - this.listBoxWindows.FormattingEnabled = true; - this.listBoxWindows.HorizontalScrollbar = true; - this.listBoxWindows.IntegralHeight = false; - this.listBoxWindows.Location = new System.Drawing.Point(0, 0); - this.listBoxWindows.Name = "listBoxWindows"; - this.listBoxWindows.Size = new System.Drawing.Size(292, 376); - this.listBoxWindows.TabIndex = 0; - this.listBoxWindows.DoubleClick += new System.EventHandler(this.listBoxWindows_DoubleClick); - this.listBoxWindows.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.listBoxWindows_KeyPress); - // - // WindowList - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(292, 376); - this.Controls.Add(this.listBoxWindows); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "WindowList"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Window List"; - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.ListBox listBoxWindows; - } -} \ No newline at end of file Deleted: trunk/plugins/IR Server Suite/Applications/Translator/Forms/WindowList.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/WindowList.cs 2007-08-02 00:09:20 UTC (rev 783) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/WindowList.cs 2007-08-02 15:40:55 UTC (rev 784) @@ -1,83 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Runtime.InteropServices; -using System.Text; -using System.Windows.Forms; - -namespace Translator -{ - - public partial class WindowList : Form - { - - #region Interop - - public delegate bool EnumWindowsProc(int hWnd, int lParam); - - [DllImport("user32.dll")] - private static extern int GetWindowText(int hWnd, StringBuilder title, int size); - - [DllImport("user32.dll")] - private static extern int EnumWindows(EnumWindowsProc ewp, int lParam); - - #endregion Interop - - #region Properties - - public string SelectedWindowTitle - { - get { return listBoxWindows.SelectedItem as string; } - } - - #endregion Properties - - #region Constructor - - public WindowList() - { - InitializeComponent(); - - PopulateList(); - } - - #endregion Constructor - - void PopulateList() - { - EnumWindowsProc ewp = new EnumWindowsProc(AddWindow); - - EnumWindows(ewp, 0); - } - - bool AddWindow(int hWnd, int lParam) - { - StringBuilder title = new StringBuilder(256); - GetWindowText(hWnd, title, 256); - - if (title.Length != 0) - listBoxWindows.Items.Add(title.ToString()); - - return true; - } - - private void listBoxWindows_DoubleClick(object sender, EventArgs e) - { - this.DialogResult = DialogResult.OK; - this.Close(); - } - - private void listBoxWindows_KeyPress(object sender, KeyPressEventArgs e) - { - if (e.KeyChar == 27) - { - this.DialogResult = DialogResult.Cancel; - this.Close(); - } - } - - } - -} Deleted: trunk/plugins/IR Server Suite/Applications/Translator/Forms/WindowList.resx =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/WindowList.resx 2007-08-02 00:09:20 UTC (rev 783) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/WindowList.resx 2007-08-02 15:40:55 UTC (rev 784) @@ -1,120 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<root> - <!-- - Microsoft ResX Schema - - Version 2.0 - - The primary goals of this format is to allow a simple XML format - that is mostly human readable. The generation and parsing of the - various data types are done through the TypeConverter classes - associated with the data types. - - Example: - - ... ado.net/XML headers & schema ... - <resheader name="resmimetype">text/microsoft-resx</resheader> - <resheader name="version">2.0</resheader> - <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> - <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> - <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> - <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> - <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> - <value>[base64 mime encoded serialized .NET Framework object]</value> - </data> - <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> - <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> - <comment>This is a comment</comment> - </data> - - There are any number of "resheader" rows that contain simple - name/value pairs. - - Each data row contains a name, and value. The row also contains a - type or mimetype. Type corresponds to a .NET class that support - text/value conversion through the TypeConverter architecture. - Classes that don't support this are serialized and stored with the - mimetype set. - - The mimetype is used for serialized objects, and tells the - ResXResourceReader how to depersist the object. This is currently not - extensible. For a given mimetype the value must be set accordingly: - - Note - application/x-microsoft.net.object.binary.base64 is the format - that the ResXResourceWriter will generate, however the reader can - read any of the formats listed below. - - mimetype: application/x-microsoft.net.object.binary.base64 - value : The object must be serialized with - : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter - : and then encoded with base64 encoding. - - mimetype: application/x-microsoft.net.object.soap.base64 - value : The object must be serialized with - : System.Runtime.Serialization.Formatters.Soap.SoapFormatter - : and then encoded with base64 encoding. - - mimetype: application/x-microsoft.net.object.bytearray.base64 - value : The object must be serialized into a byte array - : using a System.ComponentModel.TypeConverter - : and then encoded with base64 encoding. - --> - <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> - <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> - <xsd:element name="root" msdata:IsDataSet="true"> - <xsd:complexType> - <xsd:choice maxOccurs="unbounded"> - <xsd:element name="metadata"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" /> - </xsd:sequence> - <xsd:attribute name="name" use="required" type="xsd:string" /> - <xsd:attribute name="type" type="xsd:string" /> - <xsd:attribute name="mimetype" type="xsd:string" /> - <xsd:attribute ref="xml:space" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="assembly"> - <xsd:complexType> - <xsd:attribute name="alias" type="xsd:string" /> - <xsd:attribute name="name" type="xsd:string" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="data"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> - <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> - <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> - <xsd:attribute ref="xml:space" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="resheader"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" use="required" /> - </xsd:complexType> - </xsd:element> - </xsd:choice> - </xsd:complexType> - </xsd:element> - </xsd:schema> - <resheader name="resmimetype"> - <value>text/microsoft-resx</value> - </resheader> - <resheader name="version"> - <value>2.0</value> - </resheader> - <resheader name="reader"> - <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> - <resheader name="writer"> - <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> -</root> \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Applications/Translator/MappedEvent.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/MappedEvent.cs 2007-08-02 00:09:20 UTC (rev 783) +++ trunk/plugins/IR Server Suite/Applications/Translator/MappedEvent.cs 2007-08-02 15:40:55 UTC (rev 784) @@ -9,72 +9,24 @@ #region Enumerations /// <summary> - /// A list of events that can be mapped in the Event Mapper + /// A list of events that can be mapped in the Event Mapper. /// </summary> public enum MappingEvent { None, - //Time_Schedule, - //Program_Launch, Translator_Start, Translator_Quit, PC_Shutdown, PC_Suspend, PC_Resume, PC_Logoff, + Scheduled_Event, } - #region TODO - /* - public enum ScheduleRepeatDelay - { - // Repeat - In_1_Minute, - In_5_Minutes, - In_10_Minutes, - In_15_Minutes, - In_30_Minutes, - In_45_Minutes, - In_1_Hour, - In_2_Hours, - In_6_Hours, - In_12_Hours, - In_24_Hours, - In_48_Hours, - In_7_Days, - In_14_Days, - In_21_Days, - In_28_Days, - In_60_Days, - In_365_Days, - - // When - At_Noon, - At_Midnight, - At_6_AM, - At_6_PM, - - // Repeat? - Weekdays, - Weekends, - Mondays, - Tuesdays, - Wednesdays, - Thursdays, - Fridays, - Saturdays, - Sundays, - - - } - */ - - #endregion TODO - #endregion Enumerations /// <summary> - /// MappedEvent class is used to pass events into the Event Mapper feature + /// MappedEvent class is used to pass events into the Event Mapper feature. /// </summary> public class MappedEvent { @@ -83,13 +35,15 @@ MappingEvent _eventType; string _command; - + + //EventSchedule _schedule; + #endregion Variables #region Properties /// <summary> - /// Type of event + /// Type of event. /// </summary> [XmlAttribute] public MappingEvent EventType @@ -99,7 +53,7 @@ } /// <summary> - /// Command to execute when mapped event occurs + /// Command to execute when mapped event occurs. /// </summary> [XmlAttribute] public string Command @@ -113,15 +67,15 @@ #region Constructors /// <summary> - /// Default constructor + /// Default constructor. /// </summary> public MappedEvent() : this(MappingEvent.None, String.Empty) { } /// <summary> - /// Used to run the Event Mapper + /// Used to run the Event Mapper. /// </summary> - /// <param name="eventType">Event to act on</param> - /// <param name="command">Command to execute when event occurs</param> + /// <param name="eventType">Event to act on.</param> + /// <param name="command">Command to execute when event occurs.</param... [truncated message content] |