From: <an...@us...> - 2007-10-09 07:36:04
|
Revision: 982 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=982&view=rev Author: and-81 Date: 2007-10-09 00:36:01 -0700 (Tue, 09 Oct 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.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/MainForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Program.cs trunk/plugins/IR Server Suite/Applications/Translator/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/Applications/Translator/Properties/Resources.resx trunk/plugins/IR Server Suite/Applications/Translator/Translator.csproj trunk/plugins/IR Server Suite/Common/IrssComms/Client.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/IrssComms.csproj trunk/plugins/IR Server Suite/Common/IrssComms/IrssMessage.cs trunk/plugins/IR Server Suite/Common/IrssComms/MessageManagerCombo.cs trunk/plugins/IR Server Suite/Common/IrssComms/Server.cs trunk/plugins/IR Server Suite/Common/IrssUtils/CDRom.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/BlastCommand.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/EjectCommand.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/ExternalProgram.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/KeysCommand.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/LearnIR.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/MessageCommand.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/MouseCommand.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/PauseTime.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/PopupMessage.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/SerialCommand.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/ServerAddress.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/TcpMessageCommand.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/WindowList.cs trunk/plugins/IR Server Suite/Common/IrssUtils/IRServerInfo.cs trunk/plugins/IR Server Suite/Common/IrssUtils/IrssLog.cs trunk/plugins/IR Server Suite/Common/IrssUtils/IrssUtils.csproj trunk/plugins/IR Server Suite/Common/IrssUtils/Keyboard.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Win32.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Win32ErrorCodes.cs trunk/plugins/IR Server Suite/Common/MPUtils/ExternalChannelConfig.cs trunk/plugins/IR Server Suite/Common/MPUtils/MPUtils.csproj trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionREMOTE Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IKeyboardReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IMouseReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IR Server Plugin Interface.csproj trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IRServerPluginBase.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IRemoteReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/ITransmitIR.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/CSocketPacket.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTrans Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverXP.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrCode.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrDecoder.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MceDetectionData.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Microsoft MCE Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/NotifyWindow.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/RemoteDetectionData.cs trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster/Serial IR Blaster.cs trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster/Serial IR Blaster.csproj trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/NativeMethods.cs trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/USB-UIRT Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/UirtTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Windows Message Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Windows Message Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10 Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10Transceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/XBCDRC Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/XBCDRC Receiver.csproj trunk/plugins/IR Server Suite/IR Server Suite.sln trunk/plugins/IR Server Suite/Input Service/Input Service/Input Service.csproj trunk/plugins/IR Server Suite/Input Service/Input Service/InputService.cs trunk/plugins/IR Server Suite/Input Service/Input Service/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Program.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MPBlastZonePlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/StbSetup.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/StbSetup.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs trunk/plugins/MCEReplacement/Forms/StbSetup.cs trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/MCEReplacement/MCEReplacement.csproj trunk/plugins/MCEReplacement/MappedEvent.cs Added Paths: ----------- trunk/plugins/IR Server Suite/Applications/Translator/Graphics/Delete.png trunk/plugins/IR Server Suite/Applications/Translator/Graphics/Plus.png Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-10-07 17:28:41 UTC (rev 981) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-10-09 07:36:01 UTC (rev 982) @@ -110,9 +110,9 @@ GC.SuppressFinalize(this); } - protected virtual void Dispose(bool disposeManagedResources) + protected virtual void Dispose(bool disposing) { - if (disposeManagedResources) + if (disposing) { // Dispose managed resources ... @@ -718,15 +718,31 @@ { foreach (IRServerPluginBase plugin in _pluginReceive) { - if (_pluginTransmit == plugin) - resumedTransmit = true; + try + { + plugin.Resume(); - plugin.Resume(); + if (plugin == _pluginTransmit) + resumedTransmit = true; + } + catch (Exception ex) + { + IrssLog.Error(ex.ToString()); + } } } if (_pluginTransmit != null && !resumedTransmit) - _pluginTransmit.Resume(); + { + try + { + _pluginTransmit.Resume(); + } + catch (Exception ex) + { + IrssLog.Error(ex.ToString()); + } + } // Inform clients ... if (_mode == IRServerMode.ServerMode) @@ -747,15 +763,31 @@ { foreach (IRServerPluginBase plugin in _pluginReceive) { - if (_pluginTransmit == plugin) - suspendedTransmit = true; + try + { + plugin.Suspend(); - plugin.Suspend(); + if (plugin == _pluginTransmit) + suspendedTransmit = true; + } + catch (Exception ex) + { + IrssLog.Error(ex.ToString()); + } } } if (_pluginTransmit != null && !suspendedTransmit) - _pluginTransmit.Suspend(); + { + try + { + _pluginTransmit.Suspend(); + } + catch (Exception ex) + { + IrssLog.Error(ex.ToString()); + } + } // Inform clients ... if (_mode == IRServerMode.ServerMode) Modified: trunk/plugins/IR Server Suite/Applications/Translator/Configuration.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Configuration.cs 2007-10-07 17:28:41 UTC (rev 981) +++ trunk/plugins/IR Server Suite/Applications/Translator/Configuration.cs 2007-10-09 07:36:01 UTC (rev 982) @@ -91,7 +91,7 @@ /// </summary> /// <param name="config">Configuration to save.</param> /// <param name="fileName">File to save to.</param> - /// <returns>Success.</returns> + /// <returns>true if successful, otherwise false.</returns> internal static bool Save(Configuration config, string fileName) { try Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs 2007-10-07 17:28:41 UTC (rev 981) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs 2007-10-09 07:36:01 UTC (rev 982) @@ -402,7 +402,8 @@ } textBoxCommand.Text = _command = - String.Format("{0}|{1}|{2}|{3}|{4}", + String.Format("{0}{1}|{2}|{3}|{4}|{5}", + Common.CmdPrefixWindowMsg, target, textBoxMsgTarget.Text, numericUpDownMsg.Value.ToString(), Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.Designer.cs 2007-10-07 17:28:41 UTC (rev 981) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.Designer.cs 2007-10-09 07:36:01 UTC (rev 982) @@ -57,13 +57,13 @@ this.columnHeaderEvent = new System.Windows.Forms.ColumnHeader(); this.columnHeader1 = new System.Windows.Forms.ColumnHeader(); this.tabPageIRCommands = new System.Windows.Forms.TabPage(); - this.listBoxIR = new System.Windows.Forms.ListBox(); + this.listViewIR = new System.Windows.Forms.ListView(); this.buttonNewIR = new System.Windows.Forms.Button(); this.buttonEditIR = new System.Windows.Forms.Button(); this.buttonDeleteIR = new System.Windows.Forms.Button(); this.tabPageMacro = new System.Windows.Forms.TabPage(); + this.listViewMacro = new System.Windows.Forms.ListView(); this.buttonTestMacro = new System.Windows.Forms.Button(); - this.listBoxMacro = new System.Windows.Forms.ListBox(); this.buttonDeleteMacro = new System.Windows.Forms.Button(); this.buttonNewMacro = new System.Windows.Forms.Button(); this.buttonEditMacro = new System.Windows.Forms.Button(); @@ -136,11 +136,11 @@ // buttonRemoveProgram // this.buttonRemoveProgram.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonRemoveProgram.Image = global::Translator.Properties.Resources.Delete; this.buttonRemoveProgram.Location = new System.Drawing.Point(336, 16); this.buttonRemoveProgram.Name = "buttonRemoveProgram"; this.buttonRemoveProgram.Size = new System.Drawing.Size(24, 24); this.buttonRemoveProgram.TabIndex = 2; - this.buttonRemoveProgram.Text = "-"; this.toolTip.SetToolTip(this.buttonRemoveProgram, "Remove the current program from the list"); this.buttonRemoveProgram.UseVisualStyleBackColor = true; this.buttonRemoveProgram.Click += new System.EventHandler(this.buttonRemoveProgram_Click); @@ -148,11 +148,11 @@ // buttonAddProgram // this.buttonAddProgram.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonAddProgram.Image = global::Translator.Properties.Resources.Plus; this.buttonAddProgram.Location = new System.Drawing.Point(304, 16); this.buttonAddProgram.Name = "buttonAddProgram"; this.buttonAddProgram.Size = new System.Drawing.Size(24, 24); this.buttonAddProgram.TabIndex = 1; - this.buttonAddProgram.Text = "+"; this.toolTip.SetToolTip(this.buttonAddProgram, "Add a program to the list"); this.buttonAddProgram.UseVisualStyleBackColor = true; this.buttonAddProgram.Click += new System.EventHandler(this.buttonAddProgram_Click); @@ -249,7 +249,7 @@ this.buttonOK.Location = new System.Drawing.Point(384, 440); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(64, 24); - this.buttonOK.TabIndex = 5; + this.buttonOK.TabIndex = 3; this.buttonOK.Text = "&OK"; this.buttonOK.UseVisualStyleBackColor = true; this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); @@ -401,7 +401,7 @@ // // tabPageIRCommands // - this.tabPageIRCommands.Controls.Add(this.listBoxIR); + this.tabPageIRCommands.Controls.Add(this.listViewIR); this.tabPageIRCommands.Controls.Add(this.buttonNewIR); this.tabPageIRCommands.Controls.Add(this.buttonEditIR); this.tabPageIRCommands.Controls.Add(this.buttonDeleteIR); @@ -413,18 +413,24 @@ this.tabPageIRCommands.Text = "IR Commands"; this.tabPageIRCommands.UseVisualStyleBackColor = true; // - // listBoxIR + // listViewIR // - this.listBoxIR.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + this.listViewIR.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.listBoxIR.FormattingEnabled = true; - this.listBoxIR.IntegralHeight = false; - this.listBoxIR.Location = new System.Drawing.Point(8, 8); - this.listBoxIR.Name = "listBoxIR"; - this.listBoxIR.Size = new System.Drawing.Size(416, 328); - this.listBoxIR.TabIndex = 0; - this.listBoxIR.DoubleClick += new System.EventHandler(this.listBoxIR_DoubleClick); + this.listViewIR.FullRowSelect = true; + this.listViewIR.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; + this.listViewIR.HideSelection = false; + this.listViewIR.LabelEdit = true; + this.listViewIR.Location = new System.Drawing.Point(8, 8); + this.listViewIR.MultiSelect = false; + this.listViewIR.Name = "listViewIR"; + this.listViewIR.Size = new System.Drawing.Size(416, 328); + this.listViewIR.TabIndex = 0; + this.listViewIR.UseCompatibleStateImageBehavior = false; + this.listViewIR.View = System.Windows.Forms.View.List; + this.listViewIR.DoubleClick += new System.EventHandler(this.listViewIR_DoubleClick); + this.listViewIR.AfterLabelEdit += new System.Windows.Forms.LabelEditEventHandler(this.listViewIR_AfterLabelEdit); // // buttonNewIR // @@ -464,8 +470,8 @@ // // tabPageMacro // + this.tabPageMacro.Controls.Add(this.listViewMacro); this.tabPageMacro.Controls.Add(this.buttonTestMacro); - this.tabPageMacro.Controls.Add(this.listBoxMacro); this.tabPageMacro.Controls.Add(this.buttonDeleteMacro); this.tabPageMacro.Controls.Add(this.buttonNewMacro); this.tabPageMacro.Controls.Add(this.buttonEditMacro); @@ -477,6 +483,25 @@ this.tabPageMacro.Text = "Macros"; this.tabPageMacro.UseVisualStyleBackColor = true; // + // listViewMacro + // + this.listViewMacro.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.listViewMacro.FullRowSelect = true; + this.listViewMacro.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; + this.listViewMacro.HideSelection = false; + this.listViewMacro.LabelEdit = true; + this.listViewMacro.Location = new System.Drawing.Point(8, 8); + this.listViewMacro.MultiSelect = false; + this.listViewMacro.Name = "listViewMacro"; + this.listViewMacro.Size = new System.Drawing.Size(416, 328); + this.listViewMacro.TabIndex = 5; + this.listViewMacro.UseCompatibleStateImageBehavior = false; + this.listViewMacro.View = System.Windows.Forms.View.List; + this.listViewMacro.DoubleClick += new System.EventHandler(this.listViewMacro_DoubleClick); + this.listViewMacro.AfterLabelEdit += new System.Windows.Forms.LabelEditEventHandler(this.listViewMacro_AfterLabelEdit); + // // buttonTestMacro // this.buttonTestMacro.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); @@ -489,19 +514,6 @@ this.buttonTestMacro.UseVisualStyleBackColor = true; this.buttonTestMacro.Click += new System.EventHandler(this.buttonTestMacro_Click); // - // listBoxMacro - // - this.listBoxMacro.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.listBoxMacro.FormattingEnabled = true; - this.listBoxMacro.IntegralHeight = false; - this.listBoxMacro.Location = new System.Drawing.Point(8, 8); - this.listBoxMacro.Name = "listBoxMacro"; - this.listBoxMacro.Size = new System.Drawing.Size(416, 328); - this.listBoxMacro.TabIndex = 0; - this.listBoxMacro.DoubleClick += new System.EventHandler(this.listBoxMacro_DoubleClick); - // // buttonDeleteMacro // this.buttonDeleteMacro.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); @@ -541,10 +553,11 @@ // checkBoxAutoRun // this.checkBoxAutoRun.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.checkBoxAutoRun.AutoSize = true; this.checkBoxAutoRun.Location = new System.Drawing.Point(16, 440); this.checkBoxAutoRun.Name = "checkBoxAutoRun"; - this.checkBoxAutoRun.Size = new System.Drawing.Size(184, 24); - this.checkBoxAutoRun.TabIndex = 4; + this.checkBoxAutoRun.Size = new System.Drawing.Size(167, 17); + this.checkBoxAutoRun.TabIndex = 2; this.checkBoxAutoRun.Text = "&Start Translator with Windows"; this.toolTip.SetToolTip(this.checkBoxAutoRun, "Set this to make Translator automatically start when you turn the computer on"); this.checkBoxAutoRun.UseVisualStyleBackColor = true; @@ -573,58 +586,58 @@ this.toolStripSeparator2, this.quitToolStripMenuItem}); this.configurationToolStripMenuItem.Name = "configurationToolStripMenuItem"; - this.configurationToolStripMenuItem.Size = new System.Drawing.Size(35, 20); + this.configurationToolStripMenuItem.Size = new System.Drawing.Size(37, 20); this.configurationToolStripMenuItem.Text = "&File"; // // newToolStripMenuItem // this.newToolStripMenuItem.Name = "newToolStripMenuItem"; - this.newToolStripMenuItem.Size = new System.Drawing.Size(132, 22); + this.newToolStripMenuItem.Size = new System.Drawing.Size(122, 22); this.newToolStripMenuItem.Text = "&New"; this.newToolStripMenuItem.Click += new System.EventHandler(this.newToolStripMenuItem_Click); // // openToolStripMenuItem // this.openToolStripMenuItem.Name = "openToolStripMenuItem"; - this.openToolStripMenuItem.Size = new System.Drawing.Size(132, 22); + this.openToolStripMenuItem.Size = new System.Drawing.Size(122, 22); this.openToolStripMenuItem.Text = "&Open ..."; this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); // // importToolStripMenuItem // this.importToolStripMenuItem.Name = "importToolStripMenuItem"; - this.importToolStripMenuItem.Size = new System.Drawing.Size(132, 22); + this.importToolStripMenuItem.Size = new System.Drawing.Size(122, 22); this.importToolStripMenuItem.Text = "&Import ..."; this.importToolStripMenuItem.Click += new System.EventHandler(this.importToolStripMenuItem_Click); // // exportToolStripMenuItem // this.exportToolStripMenuItem.Name = "exportToolStripMenuItem"; - this.exportToolStripMenuItem.Size = new System.Drawing.Size(132, 22); + this.exportToolStripMenuItem.Size = new System.Drawing.Size(122, 22); this.exportToolStripMenuItem.Text = "&Export ..."; this.exportToolStripMenuItem.Click += new System.EventHandler(this.exportToolStripMenuItem_Click); // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(129, 6); + this.toolStripSeparator1.Size = new System.Drawing.Size(119, 6); // // serverToolStripMenuItem // this.serverToolStripMenuItem.Name = "serverToolStripMenuItem"; - this.serverToolStripMenuItem.Size = new System.Drawing.Size(132, 22); + this.serverToolStripMenuItem.Size = new System.Drawing.Size(122, 22); this.serverToolStripMenuItem.Text = "&Server ..."; this.serverToolStripMenuItem.Click += new System.EventHandler(this.serverToolStripMenuItem_Click); // // toolStripSeparator2 // this.toolStripSeparator2.Name = "toolStripSeparator2"; - this.toolStripSeparator2.Size = new System.Drawing.Size(129, 6); + this.toolStripSeparator2.Size = new System.Drawing.Size(119, 6); // // quitToolStripMenuItem // this.quitToolStripMenuItem.Name = "quitToolStripMenuItem"; - this.quitToolStripMenuItem.Size = new System.Drawing.Size(132, 22); + this.quitToolStripMenuItem.Size = new System.Drawing.Size(122, 22); this.quitToolStripMenuItem.Text = "&Quit"; this.quitToolStripMenuItem.Click += new System.EventHandler(this.quitToolStripMenuItem_Click); // @@ -634,20 +647,20 @@ this.translatorHelpToolStripMenuItem, this.aboutToolStripMenuItem}); this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; - this.helpToolStripMenuItem.Size = new System.Drawing.Size(40, 20); + this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20); this.helpToolStripMenuItem.Text = "&Help"; // // translatorHelpToolStripMenuItem // this.translatorHelpToolStripMenuItem.Name = "translatorHelpToolStripMenuItem"; - this.translatorHelpToolStripMenuItem.Size = new System.Drawing.Size(129, 22); + this.translatorHelpToolStripMenuItem.Size = new System.Drawing.Size(122, 22); this.translatorHelpToolStripMenuItem.Text = "&Contents"; this.translatorHelpToolStripMenuItem.Click += new System.EventHandler(this.translatorHelpToolStripMenuItem_Click); // // aboutToolStripMenuItem // this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; - this.aboutToolStripMenuItem.Size = new System.Drawing.Size(129, 22); + this.aboutToolStripMenuItem.Size = new System.Drawing.Size(122, 22); this.aboutToolStripMenuItem.Text = "&About"; this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click); // @@ -674,7 +687,7 @@ this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MainMenuStrip = this.menuStrip; this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(464, 475); + this.MinimumSize = new System.Drawing.Size(472, 508); this.Name = "MainForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Translator"; @@ -711,13 +724,11 @@ private System.Windows.Forms.TabControl tabControl; private System.Windows.Forms.TabPage tabPagePrograms; private System.Windows.Forms.TabPage tabPageIRCommands; - private System.Windows.Forms.ListBox listBoxIR; private System.Windows.Forms.Button buttonNewIR; private System.Windows.Forms.Button buttonEditIR; private System.Windows.Forms.Button buttonDeleteIR; private System.Windows.Forms.TabPage tabPageMacro; private System.Windows.Forms.Button buttonTestMacro; - private System.Windows.Forms.ListBox listBoxMacro; private System.Windows.Forms.Button buttonDeleteMacro; private System.Windows.Forms.Button buttonNewMacro; private System.Windows.Forms.Button buttonEditMacro; @@ -749,6 +760,8 @@ private System.Windows.Forms.ToolStripMenuItem serverToolStripMenuItem; private System.Windows.Forms.OpenFileDialog openFileDialog; private System.Windows.Forms.SaveFileDialog saveFileDialog; + private System.Windows.Forms.ListView listViewIR; + private System.Windows.Forms.ListView listViewMacro; } } Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2007-10-07 17:28:41 UTC (rev 981) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2007-10-09 07:36:01 UTC (rev 982) @@ -189,19 +189,21 @@ } void RefreshIRList() { - listBoxIR.Items.Clear(); + listViewIR.Items.Clear(); string[] irList = Common.GetIRList(false); if (irList != null && irList.Length > 0) - listBoxIR.Items.AddRange(irList); + foreach (string irFile in irList) + listViewIR.Items.Add(irFile); } void RefreshMacroList() { - listBoxMacro.Items.Clear(); + listViewMacro.Items.Clear(); string[] macroList = Program.GetMacroList(false); if (macroList != null && macroList.Length > 0) - listBoxMacro.Items.AddRange(macroList); + foreach (string macroFile in macroList) + listViewMacro.Items.Add(macroFile); Program.UpdateNotifyMenu(); } @@ -251,48 +253,48 @@ void EditIR() { - if (listBoxIR.SelectedIndex != -1) + if (listViewIR.SelectedItems.Count != 1) + return; + + string command = listViewIR.SelectedItems[0].Text; + string fileName = Common.FolderIRCommands + command + Common.FileExtensionIR; + + if (File.Exists(fileName)) { - string command = listBoxIR.SelectedItem as string; - string fileName = Common.FolderIRCommands + command + Common.FileExtensionIR; + _learnIR = new LearnIR( + new LearnIrDelegate(Program.LearnIR), + new BlastIrDelegate(Program.BlastIR), + Program.TransceiverInformation.Ports, + command); - if (File.Exists(fileName)) - { - _learnIR = new LearnIR( - new LearnIrDelegate(Program.LearnIR), - new BlastIrDelegate(Program.BlastIR), - Program.TransceiverInformation.Ports, - command); + _learnIR.ShowDialog(this); - _learnIR.ShowDialog(this); - - _learnIR = null; - } - else - { - MessageBox.Show(this, "File not found: " + fileName, "IR file missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - RefreshIRList(); - } + _learnIR = null; } + else + { + MessageBox.Show(this, "File not found: " + fileName, "IR file missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + RefreshIRList(); + } } void EditMacro() { - if (listBoxMacro.SelectedIndex != -1) + if (listViewMacro.SelectedItems.Count != 1) + return; + + string command = listViewMacro.SelectedItems[0].Text; + string fileName = Program.FolderMacros + command + Common.FileExtensionMacro; + + if (File.Exists(fileName)) { - string command = listBoxMacro.SelectedItem as string; - string fileName = Program.FolderMacros + command + Common.FileExtensionMacro; - - if (File.Exists(fileName)) - { - MacroEditor macroEditor = new MacroEditor(command); - macroEditor.ShowDialog(this); - } - else - { - MessageBox.Show(this, "File not found: " + fileName, "Macro file missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - RefreshMacroList(); - } + MacroEditor macroEditor = new MacroEditor(command); + macroEditor.ShowDialog(this); } + else + { + MessageBox.Show(this, "File not found: " + fileName, "Macro file missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + RefreshMacroList(); + } } void CommitEvents() @@ -349,6 +351,7 @@ } } + // TODO: Move to a notify window protected override void WndProc(ref Message m) { try @@ -365,7 +368,7 @@ byte[] dataBytes = new byte[dataStructure.cbData]; IntPtr lpData = new IntPtr(dataStructure.lpData); System.Runtime.InteropServices.Marshal.Copy(lpData, dataBytes, 0, dataStructure.cbData); - string strData = Encoding.Default.GetString(dataBytes); + string strData = Encoding.ASCII.GetString(dataBytes); Program.ProcessCommand(strData); } @@ -638,32 +641,21 @@ } private void buttonEditIR_Click(object sender, EventArgs e) { - if (listBoxIR.SelectedIndex == -1) - return; - - _learnIR = new LearnIR( - new LearnIrDelegate(Program.LearnIR), - new BlastIrDelegate(Program.BlastIR), - Program.TransceiverInformation.Ports, - listBoxIR.SelectedItem as string); - - _learnIR.ShowDialog(this); - - _learnIR = null; + EditIR(); } private void buttonDeleteIR_Click(object sender, EventArgs e) { - if (listBoxIR.SelectedIndex == -1) + if (listViewIR.SelectedItems.Count != 1) return; - string file = listBoxIR.SelectedItem as string; + string file = listViewIR.SelectedItems[0].Text; string fileName = Common.FolderIRCommands + file + Common.FileExtensionIR; if (File.Exists(fileName)) { if (MessageBox.Show(this, "Are you sure you want to delete \"" + file + "\"?", "Confirm delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { File.Delete(fileName); - listBoxIR.Items.Remove(listBoxIR.SelectedItem); + listViewIR.Items.Remove(listViewIR.SelectedItems[0]); } } else @@ -685,17 +677,17 @@ } private void buttonDeleteMacro_Click(object sender, EventArgs e) { - if (listBoxMacro.SelectedIndex == -1) + if (listViewMacro.SelectedItems.Count != 1) return; - string file = listBoxMacro.SelectedItem as string; + string file = listViewMacro.SelectedItems[0].Text; string fileName = Program.FolderMacros + file + Common.FileExtensionMacro; if (File.Exists(fileName)) { if (MessageBox.Show(this, "Are you sure you want to delete \"" + file + "\"?", "Confirm delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { File.Delete(fileName); - listBoxMacro.Items.Remove(listBoxMacro.SelectedItem); + listViewMacro.Items.Remove(listViewMacro.SelectedItems[0]); } } else @@ -705,10 +697,10 @@ } private void buttonTestMacro_Click(object sender, EventArgs e) { - if (listBoxMacro.SelectedIndex == -1) + if (listViewMacro.SelectedItems.Count != 1) return; - string fileName = Program.FolderMacros + listBoxMacro.SelectedItem as string + Common.FileExtensionMacro; + string fileName = Program.FolderMacros + listViewMacro.SelectedItems[0].Text + Common.FileExtensionMacro; try { @@ -720,16 +712,86 @@ } } - private void listBoxIR_DoubleClick(object sender, EventArgs e) + private void listViewIR_DoubleClick(object sender, EventArgs e) { EditIR(); } + private void listViewIR_AfterLabelEdit(object sender, LabelEditEventArgs e) + { + ListView origin = sender as ListView; + if (origin == null) + return; - private void listBoxMacro_DoubleClick(object sender, EventArgs e) + ListViewItem originItem = origin.Items[e.Item]; + + string oldFileName = Common.FolderIRCommands + originItem.Text + Common.FileExtensionIR; + if (!File.Exists(oldFileName)) + { + MessageBox.Show("File not found: " + oldFileName, "Cannot rename, Original file not found", MessageBoxButtons.OK, MessageBoxIcon.Error); + e.CancelEdit = true; + return; + } + + if (String.IsNullOrEmpty(e.Label) || !Common.IsValidFileName(e.Label)) + { + MessageBox.Show("File name not valid: " + e.Label, "Cannot rename, New file name not valid", MessageBoxButtons.OK, MessageBoxIcon.Error); + e.CancelEdit = true; + return; + } + + try + { + string newFileName = Common.FolderIRCommands + e.Label + Common.FileExtensionIR; + + File.Move(oldFileName, newFileName); + } + catch (Exception ex) + { + IrssLog.Error(ex.ToString()); + MessageBox.Show(ex.ToString(), "Failed to rename file", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void listViewMacro_DoubleClick(object sender, EventArgs e) { EditMacro(); } + private void listViewMacro_AfterLabelEdit(object sender, LabelEditEventArgs e) + { + ListView origin = sender as ListView; + if (origin == null) + return; + ListViewItem originItem = origin.Items[e.Item]; + + string oldFileName = Program.FolderMacros + originItem.Text + Common.FileExtensionMacro; + if (!File.Exists(oldFileName)) + { + MessageBox.Show("File not found: " + oldFileName, "Cannot rename, Original file not found", MessageBoxButtons.OK, MessageBoxIcon.Error); + e.CancelEdit = true; + return; + } + + if (String.IsNullOrEmpty(e.Label) || !Common.IsValidFileName(e.Label)) + { + MessageBox.Show("File name not valid: " + e.Label, "Cannot rename, New file name not valid", MessageBoxButtons.OK, MessageBoxIcon.Error); + e.CancelEdit = true; + return; + } + + try + { + string newFileName = Program.FolderMacros + e.Label + Common.FileExtensionMacro; + + File.Move(oldFileName, newFileName); + } + catch (Exception ex) + { + IrssLog.Error(ex.ToString()); + MessageBox.Show(ex.ToString(), "Failed to rename file", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + private void checkBoxAutoRun_CheckedChanged(object sender, EventArgs e) { if (checkBoxAutoRun.Checked) Added: trunk/plugins/IR Server Suite/Applications/Translator/Graphics/Delete.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/Applications/Translator/Graphics/Delete.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/IR Server Suite/Applications/Translator/Graphics/Plus.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/Applications/Translator/Graphics/Plus.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/plugins/IR Server Suite/Applications/Translator/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2007-10-07 17:28:41 UTC (rev 981) +++ trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2007-10-09 07:36:01 UTC (rev 982) @@ -221,7 +221,7 @@ { try { - IntPtr hWnd = Win32.GetForegroundWindow(); + IntPtr hWnd = Win32.ForegroundWindow(); if (hWnd == IntPtr.Zero) return; @@ -233,16 +233,16 @@ return; /* - string windowTitle = Win32.GetWindowTitle(hWnd); - if (windowTitle.StartsWith("Translator", StringComparison.InvariantCultureIgnoreCase)) - return; + string windowTitle = Win32.GetWindowTitle(hWnd); + if (windowTitle.StartsWith("Translator", StringComparison.InvariantCultureIgnoreCase)) + return; - int procID; - Win32.GetWindowThreadProcessId(hWnd, out procID); - Process proc = Process.GetProcessById(procID); - if (proc.MainModule.ModuleName.Equals("Translator.exe", StringComparison.InvariantCultureIgnoreCase)) - return; - */ + int procID; + Win32.GetWindowThreadProcessId(hWnd, out procID); + Process proc = Process.GetProcessById(procID); + if (proc.MainModule.ModuleName.Equals("Translator.exe", StringComparison.InvariantCultureIgnoreCase)) + return; + */ _currentForegroundWindow = hWnd; } @@ -283,6 +283,10 @@ SendCopyDataMessage("Translator", Common.CmdPrefixHibernate); continue; + case "-logoff": + SendCopyDataMessage("Translator", Common.CmdPrefixLogOff); + continue; + //TODO: Add more command line options. } } @@ -302,22 +306,22 @@ static void SendCopyDataMessage(string targetWindow, string data) { Win32.COPYDATASTRUCT copyData; - + + byte[] dataBytes = Encoding.ASCII.GetBytes(data); + copyData.dwData = 24; - copyData.lpData = Win32.VarPtr(data).ToInt32(); - copyData.cbData = data.Length; + copyData.lpData = Win32.VarPtr(dataBytes).ToInt32(); + copyData.cbData = dataBytes.Length; IntPtr windowHandle = Win32.FindWindowByTitle(targetWindow); if (windowHandle != IntPtr.Zero) { IntPtr result; Win32.SendMessageTimeout(windowHandle, (int)Win32.WindowsMessage.WM_COPYDATA, IntPtr.Zero, Win32.VarPtr(copyData), Win32.SendMessageTimeoutFlags.SMTO_ABORTIFHUNG, 1000, out result); + int lastError = Marshal.GetLastWin32Error(); - if (result == IntPtr.Zero) - { - int lastError = Marshal.GetLastWin32Error(); + if (result == IntPtr.Zero && lastError != 0) throw new Win32Exception(lastError); - } } } @@ -404,7 +408,7 @@ actions.DropDownItems.Add("System Standby", null, new EventHandler(ClickAction)); actions.DropDownItems.Add("System Hibernate", null, new EventHandler(ClickAction)); actions.DropDownItems.Add("System Reboot", null, new EventHandler(ClickAction)); - //actions.DropDownItems.Add("System Logoff", null, new EventHandler(ClickAction)); + actions.DropDownItems.Add("System LogOff", null, new EventHandler(ClickAction)); actions.DropDownItems.Add("System Shutdown", null, new EventHandler(ClickAction)); actions.DropDownItems.Add(new ToolStripSeparator()); @@ -583,11 +587,9 @@ Reboot(); break; - /* - case "System Logoff": + case "System LogOff": LogOff(); break; - */ case "System Shutdown": ShutDown(); @@ -976,17 +978,17 @@ static void Reboot() { IrssLog.Info("Reboot"); - Win32.ExitWindowsEx(Win32.ExitWindows.Reboot | Win32.ExitWindows.ForceIfHung, Win32.ShutdownReasons.FlagUserDefined); + Win32.WindowsExit(Win32.ExitWindows.Reboot | Win32.ExitWindows.ForceIfHung, Win32.ShutdownReasons.FlagUserDefined); } - /*static void LogOff() + static void LogOff() { IrssLog.Info("LogOff"); - Win32.ExitWindowsEx(Win32.ExitWindows.LogOff | Win32.ExitWindows.ForceIfHung, Win32.ShutdownReason.FlagUserDefined); - }*/ + Win32.WindowsExit(Win32.ExitWindows.LogOff | Win32.ExitWindows.ForceIfHung, Win32.ShutdownReasons.FlagUserDefined); + } static void ShutDown() { IrssLog.Info("ShutDown"); - Win32.ExitWindowsEx(Win32.ExitWindows.ShutDown | Win32.ExitWindows.ForceIfHung, Win32.ShutdownReasons.FlagUserDefined); + Win32.WindowsExit(Win32.ExitWindows.ShutDown | Win32.ExitWindows.ForceIfHung, Win32.ShutdownReasons.FlagUserDefined); } static void MapEvent(MappingEvent theEvent) @@ -1170,6 +1172,12 @@ Reboot(); break; } + + case Common.XmlTagLogOff: + { + LogOff(); + break; + } } } } @@ -1183,7 +1191,7 @@ /// Learn an IR command. /// </summary> /// <param name="fileName">File to place learned IR command in.</param> - /// <returns>Success.</returns> + /// <returns>true if successful, otherwise false.</returns> internal static bool LearnIR(string fileName) { try @@ -1301,6 +1309,10 @@ { Hibernate(); } + else if (command.StartsWith(Common.CmdPrefixLogOff)) // LogOff Command + { + LogOff(); + } else if (command.StartsWith(Common.CmdPrefixReboot)) // Reboot Command { Reboot(); Modified: trunk/plugins/IR Server Suite/Applications/Translator/Properties/Resources.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Properties/Resources.Designer.cs 2007-10-07 17:28:41 UTC (rev 981) +++ trunk/plugins/IR Server Suite/Applications/Translator/Properties/Resources.Designer.cs 2007-10-09 07:36:01 UTC (rev 982) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. -// Runtime Version:2.0.50727.42 +// Runtime Version:2.0.50727.312 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -81,6 +81,13 @@ } } + internal static System.Drawing.Bitmap Delete { + get { + object obj = ResourceManager.GetObject("Delete", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + internal static System.Drawing.Icon Icon16 { get { object obj = ResourceManager.GetObject("Icon16", resourceCulture); @@ -123,6 +130,13 @@ } } + internal static System.Drawing.Bitmap Plus { + get { + object obj = ResourceManager.GetObject("Plus", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + internal static System.Drawing.Bitmap ScrollDown { get { object obj = ResourceManager.GetObject("ScrollDown", resourceCulture); Modified: trunk/plugins/IR Server Suite/Applications/Translator/Properties/Resources.resx =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Properties/Resources.resx 2007-10-07 17:28:41 UTC (rev 981) +++ trunk/plugins/IR Server Suite/Applications/Translator/Properties/Resources.resx 2007-10-09 07:36:01 UTC (rev 982) @@ -127,6 +127,9 @@ <data name="ClickRight" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\graphics\clickright.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data> + <data name="Delete" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\graphics\delete.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> <data name="Icon16" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\Icon16.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data> @@ -145,6 +148,9 @@ <data name="MoveUp" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\graphics\moveup.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data> + <data name="Plus" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\graphics\plus.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> <data name="ScrollDown" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\graphics\scrolldown.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data> Modified: trunk/plugins/IR Server Suite/Applications/Translator/Translator.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Translator.csproj 2007-10-07 17:28:41 UTC (rev 981) +++ trunk/plugins/IR Server Suite/Applications/Translator/Translator.csproj 2007-10-09 07:36:01 UTC (rev 982) @@ -151,10 +151,12 @@ <Content Include="Graphics\ClickLeft.png" /> <Content Include="Graphics\ClickMiddle.png" /> <Content Include="Graphics\ClickRight.png" /> + <Content Include="Graphics\Delete.png" /> <Content Include="Graphics\MoveDown.png" /> <Content Include="Graphics\MoveLeft.png" /> <Content Include="Graphics\MoveRight.png" /> <Content Include="Graphics\MoveUp.png" /> + <Content Include="Graphics\Plus.png" /> <Content Include="Graphics\ScrollDown.png" /> <Content Include="Graphics\ScrollUp.png" /> </ItemGroup> Modified: trunk/plugins/IR Server Suite/Common/IrssComms/Client.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/Client.cs 2007-10-07 17:28:41 UTC (rev 981) +++ trunk/plugins/IR Server Suite/Common/IrssComms/Client.cs 2007-10-09 07:36:01 UTC (rev 982) @@ -86,6 +86,7 @@ /// Create a TCP communications client. /// </summary> /// <param name="serverEndPoint">IP Address and Port combination of Server.</param> + /// <param name="messageSink">The message sink to call for messages.</param> public Client(IPEndPoint serverEndPoint, ClientMessageSink messageSink) { _serverEndpoint = serverEndPoint; @@ -99,15 +100,22 @@ #region IDisposable + /// <summary> + /// Releases unmanaged and - optionally - managed resources + /// </summary> public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } - protected virtual void Dispose(bool disposeManagedResources) + /// <summary> + /// Releases unmanaged and - optionally - managed resources + /// </summary> + /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param> + protected virtual void Dispose(bool disposing) { - if (disposeManagedResources) + if (disposing) { // Dispose managed resources ... Stop(); @@ -126,7 +134,7 @@ /// <summary> /// Start the client communications. /// </summary> - /// <returns>Success.</returns> + /// <returns>true if successful, otherwise false.</returns> public bool Start() { if (_processConnectionThread) @@ -186,7 +194,7 @@ /// Send a message to the server. /// </summary> /// <param name="message">Message to send.</param> - /// <returns>Success.</returns> + /// <returns>true if successful, otherwise false.</returns> public bool Send(IrssMessage message) { if (message == null) Modified: trunk/plugins/IR Server Suite/Common/IrssComms/ClientManager.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/ClientManager.cs 2007-10-07 17:28:41 UTC (rev 981) +++ trunk/plugins/IR Server Suite/Common/IrssComms/ClientManager.cs 2007-10-09 07:36:01 UTC (rev 982) @@ -53,15 +53,22 @@ #region IDisposable + /// <summary> + /// Releases unmanaged and - optionally - managed resources + /// </summary> public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } - protected virtual void Dispose(bool disposeManagedResources) + /// <summary> + /// Releases unmanaged and - optionally - managed resources + /// </summary> + /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param> + protected virtual void Dispose(bool disposing) { - if (disposeManagedResources) + if (disposing) { // Dispose managed resources ... Stop(); Modified: trunk/plugins/IR Server Suite/Common/IrssComms/GenericPCQueue.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/GenericPCQueue.cs 2007-10-07 17:28:41 UTC (rev 981) +++ trunk/plugins/IR Server Suite/Common/IrssComms/GenericPCQueue.cs 2007-10-09 07:36:01 UTC (rev 982) @@ -60,15 +60,22 @@ #region IDisposable + /// <summary> + /// Releases unmanaged and - optionally - managed resources + /// </summary> public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } - protected virtual void Dispose(bool disposeManagedResources) + /// <summary> + /// Releases unmanaged and - optionally - managed resources + /// </summary> + /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param> + protected virtual void Dispose(bool disposing) { - if (disposeManagedResources) + if (disposing) { // Dispose managed resources ... Stop(); Modified: trunk/plugins/IR Server Suite/Common/IrssComms/IrssComms.csproj =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/IrssComms.csproj 2007-10-07 17:28:41 UTC (rev 981) +++ trunk/plugins/IR Server Suite/Common/IrssComms/IrssComms.csproj 2007-10-09 07:36:01 UTC (rev 982) @@ -41,6 +41,7 @@ <UseVSHostingProcess>false</UseVSHostingProcess> <ErrorReport>prompt</ErrorReport> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <DocumentationFile>bin\x86\Debug\IrssComms.XML</DocumentationFile> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> <OutputPath>bin\x86\Release\</OutputPath> Modified: trunk/plugins/IR Server Suite/Common/IrssComms/IrssMessage.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/IrssMessage.cs 2007-10-07 17:28:41 UTC (rev 981) +++ trunk/plugins/IR Server Suite/Common/IrssComms/IrssMessage.cs 2007-10-09 07:36:01 UTC (rev 982) @@ -7,59 +7,160 @@ #region Enumerations + /// <summary> + /// Type of message. + /// </summary> public enum MessageType { + /// <summary> + /// Unknown message type. + /// </summary> Unknown, + /// <summary> + /// Register Client. + /// </summary> RegisterClient, + /// <summary> + /// Unregister Client. + /// </summary> UnregisterClient, + /// <summary> + /// Register Repeater. + /// </summary> RegisterRepeater, + /// <summary> + /// Unregister Repeater. + /// </summary> UnregisterRepeater, + /// <summary> + /// Learn IR Command. + /// </summary> LearnIR, + /// <summary> + /// Blast IR Command. + /// </summary> BlastIR, + /// <summary> + /// Error. + /// </summary> Error, + /// <summary> + /// Server Shutdown. + /// </summary> ServerShutdown, + /// <summary> + /// Server Suspend. + /// </summary> ServerSuspend, + /// <summary> + /// Server Resume + /// </summary> ServerResume, + /// <summary> + /// Remote Event. + /// </summary> RemoteEvent, + /// <summary> + /// Keyboard Event. + /// </summary> KeyboardEvent, + /// <summary> + /// Mouse Event. + /// </summary> MouseEvent, + /// <summary> + /// Forward a Remote Event. + /// </summary> ForwardRemoteEvent, + /// <summary> + /// Forward a Keyboard Event. + /// </summary> ForwardKeyboardEvent, + /// <summary> + /// Forward a Mouse Event. + /// </summary> ForwardMouseEvent, + /// <summary> + /// Available Receivers. + /// </summary> AvailableReceivers, + /// <summary> + /// Available Blasters. + /// </summary> AvailableBlasters, + /// <summary> + /// Active Receivers. + /// </summary> ActiveReceivers, + /// <summary> + /// Active Blasters. + /// </summary> ActiveBlasters, + /// <summary> + /// Detected Receivers. + /// </summary> DetectedReceivers, + /// <summary> + /// Detected Blasters. + /// </summary> DetectedBlasters, } + /// <summary> + /// Flags to determine more information about the message. + /// </summary> [Flags] public enum MessageFlags { + /// <summary> + /// No Flags. + /// </summary> None = 0x0000, - + + /// <summary> + /// Message is a Request. + /// </summary> Request = 0x0001, + /// <summary> + /// Message is a Response to a received Message. + /// </summary> Response = 0x0002, + /// <summary> + /// Message is a Notification. + /// </summary> Notify = 0x0004, - + + /// <summary> + /// Operation Success. + /// </summary> Success = 0x0008, + /// <summary> + /// Operation Failure. + /// </summary> Failure = 0x0010, + /// <summary> + /// Operation Time-Out. + /// </summary> Timeout = 0x0020, + //Error = 0x0040, //DataString = 0x0080, //DataBytes = 0x0100, //ForceRespond = 0x0200, + + /// <summary> + /// Force the recipient not to respond. + /// </summary> ForceNotRespond = 0x0400, } @@ -104,6 +205,9 @@ #region Constructors + /// <summary> + /// Initializes a new instance of the <see cref="IrssMessage"/> class. + /// </summary> protected IrssMessage() { _type = MessageType.Unknown; @@ -111,6 +215,11 @@ _data = null; } + /// <summary> + /// Initializes a new instance of the <see cref="IrssMessage"/> class. + /// </summary> + /// <param name="type">The message type.</param> + /// <param name="flags">The message flags.</param> public IrssMessage(MessageType type, MessageFlags flags) : this() { @@ -118,12 +227,24 @@ _flags = flags; } + /// <summary> + /// Initializes a new instance of the <see cref="IrssMessage"/> class. + /// </summary> + /// <param name="type">The message type.</param> + /// <param name="flags">The message flags.</param> + /// <param name="data">The message data.</param> public IrssMessage(MessageType type, MessageFlags flags, byte[] data) : this(type, flags) { SetDataAsBytes(data); } + /// <summary> + /// Initializes a new instance of the <see cref="IrssMessage"/> class. + /// </summary> + /// <param name="type">The message type.</param> + /// <param name="flags">The message flags.</param> + /// <param name="data">The message data.</param> public IrssMessage(MessageType type, MessageFlags flags, string data) : this(type, flags) { Modified: trunk/plugins/IR Server Suite/Common/IrssComms/MessageManagerCombo.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/MessageManagerCombo.cs 2007-10-07 17:28:41 UTC (rev 981) +++ trunk/plugins/IR Server Suite/Common/IrssComms/MessageManagerCombo.cs 2007-10-09 07:36:01 UTC (rev 982) @@ -73,7 +73,7 @@ /// <summary> /// Indicates whether the current object is equal to another object of the same type. /// </summary> - /// <param name="obj">An object to compare with this object.</param> + /// <param name="other">An object to compare with this object.</param> /// <returns>true if the current object is equal to the other parameter; otherwise, false.</returns> public bool Equals(MessageManagerCombo other) { @@ -83,8 +83,11 @@ /// <summary> /// Indicates whether the current object is equal to another object of the same type. /// </summary> - /// <param name="obj">An object to compare with this object.</param> - /// <returns>true if the current object is equal to the other parameter; otherwise, false.</returns> + /// <param name="obj1">First object to compare.</param> + /// <param name="obj2">Second object to compare.</pa... [truncated message content] |