From: <an...@us...> - 2007-11-13 05:04:44
|
Revision: 1050 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1050&view=rev Author: and-81 Date: 2007-11-12 21:04:36 -0800 (Mon, 12 Nov 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs trunk/plugins/IR Server Suite/Applications/IR Server/Advanced.cs trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.cs trunk/plugins/IR Server Suite/Applications/Translator/Configuration.cs trunk/plugins/IR Server Suite/Applications/Translator/CopyDataWM.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MacroEditor.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/ProgramSettings.cs trunk/plugins/IR Server Suite/Applications/Translator/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/Applications/Translator/Translator.csproj trunk/plugins/IR Server Suite/Applications/Tray Launcher/Setup.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/MessageCommand.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/ServerAddress.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/WindowList.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/XML.cs trunk/plugins/IR Server Suite/Common/MPUtils/Forms/GoToScreen.cs trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/DeviceSelect.cs trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/RawInput.cs trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/IrDecoder.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/IrDecoder.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/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/WinLircServer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Windows Message Receiver.cs 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 Suite.sln trunk/plugins/IR Server Suite/Input Service/Input Service/InputService.cs trunk/plugins/IR Server Suite/Input Service/Input Service/Program.cs trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Advanced.cs trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Config.cs trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Program.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MPBlastZonePlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Menu.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/MacroEditor.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/MacroEditor.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 Added Paths: ----------- trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.resx trunk/plugins/IR Server Suite/Applications/Translator/Forms/MenuForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MenuForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MenuForm.resx trunk/plugins/IR Server Suite/Common/IrssUtils/Audio.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Graphics/DoubleClickLeft.png trunk/plugins/IR Server Suite/Common/IrssUtils/Graphics/DoubleClickMiddle.png trunk/plugins/IR Server Suite/Common/IrssUtils/Graphics/DoubleClickRight.png trunk/plugins/IR Server Suite/Common/IrssUtils/Network.cs Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-11-12 20:48:32 UTC (rev 1049) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-11-13 05:04:36 UTC (rev 1050) @@ -108,7 +108,7 @@ Client _client; string _serverHost = "localhost"; - string _learnIRFilename = null; + string _learnIRFilename; bool _registered; @@ -117,7 +117,7 @@ #endregion Variables delegate void DelegateAddStatusLine(string status); - DelegateAddStatusLine _addStatusLine = null; + DelegateAddStatusLine _addStatusLine; void AddStatusLine(string status) { @@ -145,9 +145,9 @@ comboBoxComputer.Items.Clear(); comboBoxComputer.Items.Add("localhost"); - string[] networkPCs = IrssUtils.Win32.GetNetworkComputers(false); + List<string> networkPCs = Network.GetComputers(false); if (networkPCs != null) - comboBoxComputer.Items.AddRange(networkPCs); + comboBoxComputer.Items.AddRange(networkPCs.ToArray()); comboBoxComputer.Text = _serverHost; } @@ -476,7 +476,7 @@ private void comboBoxRemoteButtons_SelectedIndexChanged(object sender, EventArgs e) { - if (comboBoxRemoteButtons.SelectedItem.ToString() == "Custom") + if (comboBoxRemoteButtons.SelectedItem.ToString().Equals("Custom", StringComparison.OrdinalIgnoreCase)) numericUpDownButton.Enabled = true; else numericUpDownButton.Enabled = false; Modified: trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2007-11-12 20:48:32 UTC (rev 1049) +++ trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2007-11-13 05:04:36 UTC (rev 1050) @@ -55,21 +55,21 @@ for (int index = 0; index < args.Length; index++) { - switch (args[index].ToLowerInvariant()) + switch (args[index].ToUpperInvariant()) { - case "-host": + case "-HOST": _serverHost = args[++index]; continue; - case "-port": + case "-PORT": _blastPort = args[++index]; continue; - case "-channel": + case "-CHANNEL": _treatAsChannelNumber = true; continue; - case "-pad": + case "-PAD": int.TryParse(args[++index], out _padChannelNumber); continue; 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-11-12 20:48:32 UTC (rev 1049) +++ trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2007-11-13 05:04:36 UTC (rev 1050) @@ -54,21 +54,21 @@ for (int index = 0; index < args.Length; index++) { - switch (args[index].ToLowerInvariant()) + switch (args[index].ToUpperInvariant()) { - case "-host": + case "-HOST": _serverHost = args[++index]; continue; - case "-port": + case "-PORT": _blastPort = args[++index]; continue; - case "-channel": + case "-CHANNEL": _treatAsChannelNumber = true; continue; - case "-pad": + case "-PAD": int.TryParse(args[++index], out _padChannelNumber); continue; Added: trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.resx =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.resx (rev 0) +++ trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.resx 2007-11-13 05:04:36 UTC (rev 1050) @@ -0,0 +1,120 @@ +<?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/IR Server/Advanced.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Advanced.cs 2007-11-12 20:48:32 UTC (rev 1049) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Advanced.cs 2007-11-13 05:04:36 UTC (rev 1050) @@ -7,6 +7,8 @@ using System.Text; using System.Windows.Forms; +using IrssUtils; + namespace IRServer { @@ -58,9 +60,9 @@ { InitializeComponent(); - string[] networkPCs = IrssUtils.Win32.GetNetworkComputers(false); + List<string> networkPCs = Network.GetComputers(false); if (networkPCs != null) - comboBoxComputer.Items.AddRange(networkPCs); + comboBoxComputer.Items.AddRange(networkPCs.ToArray()); } #endregion Constructor Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs 2007-11-12 20:48:32 UTC (rev 1049) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs 2007-11-13 05:04:36 UTC (rev 1050) @@ -100,7 +100,7 @@ if (checkBox == null) continue; - if (gridPlugins[row, 0].DisplayText.Equals(value, StringComparison.InvariantCultureIgnoreCase)) + if (gridPlugins[row, 0].DisplayText.Equals(value, StringComparison.OrdinalIgnoreCase)) checkBox.Checked = true; else checkBox.Checked = false; @@ -263,7 +263,7 @@ string plugin = gridPlugins[cell.Row.Index, 0].DisplayText; foreach (IRServerPluginBase transceiver in _transceivers) - if (transceiver.Name == plugin) + if (transceiver.Name.Equals(plugin, StringComparison.OrdinalIgnoreCase)) (transceiver as IConfigure).Configure(); } /* @@ -280,7 +280,7 @@ for (int row = 1; row < gridPlugins.RowsCount; row++) { SourceGrid.Cells.CheckBox checkBox = gridPlugins[row, 1] as SourceGrid.Cells.CheckBox; - if (checkBox != null && checkBox.Checked && !gridPlugins[row, 0].DisplayText.Equals(plugin, StringComparison.InvariantCultureIgnoreCase)) + if (checkBox != null && checkBox.Checked && !gridPlugins[row, 0].DisplayText.Equals(plugin, StringComparison.OrdinalIgnoreCase)) checkBox.Checked = false; } } @@ -298,7 +298,7 @@ for (int row = 1; row < gridPlugins.RowsCount; row++) { SourceGrid.Cells.CheckBox checkBox = gridPlugins[row, 2] as SourceGrid.Cells.CheckBox; - if (checkBox != null && checkBox.Checked && !gridPlugins[row, 0].DisplayText.Equals(plugin, StringComparison.InvariantCultureIgnoreCase)) + if (checkBox != null && checkBox.Checked && !gridPlugins[row, 0].DisplayText.Equals(plugin, StringComparison.OrdinalIgnoreCase)) checkBox.Checked = false; } } Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-11-12 20:48:32 UTC (rev 1049) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-11-13 05:04:36 UTC (rev 1050) @@ -73,7 +73,7 @@ string _pluginNameTransmit; IRServerPluginBase _pluginTransmit; - bool _inConfiguration = false; + bool _inConfiguration; #endregion Variables @@ -1115,8 +1115,7 @@ } else { - byte[] bytes = null; - + byte[] bytes; LearnStatus status = LearnIR(out bytes); switch (status) Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2007-11-12 20:48:32 UTC (rev 1049) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2007-11-13 05:04:36 UTC (rev 1050) @@ -145,7 +145,7 @@ throw new FileNotFoundException("No available plugins found"); foreach (IRServerPluginBase plugin in serverPlugins) - if (plugin.Name.Equals(pluginName, StringComparison.InvariantCultureIgnoreCase)) + if (plugin.Name.Equals(pluginName, StringComparison.OrdinalIgnoreCase)) return plugin; return null; Modified: trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.cs 2007-11-12 20:48:32 UTC (rev 1049) +++ trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.cs 2007-11-13 05:04:36 UTC (rev 1050) @@ -24,7 +24,7 @@ private void FormMain_Load(object sender, EventArgs e) { - string[] networkPCs = Win32.GetNetworkComputers(false); + List<string> networkPCs = Network.GetComputers(false); if (networkPCs == null) { MessageBox.Show(this, "No server names detected.", "Network Error", MessageBoxButtons.OK, MessageBoxIcon.Error); @@ -33,7 +33,7 @@ } else { - comboBoxComputer.Items.AddRange(networkPCs); + comboBoxComputer.Items.AddRange(networkPCs.ToArray()); } _irBlastLocation = SystemRegistry.GetInstallFolder(); Modified: trunk/plugins/IR Server Suite/Applications/Translator/Configuration.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Configuration.cs 2007-11-12 20:48:32 UTC (rev 1049) +++ trunk/plugins/IR Server Suite/Applications/Translator/Configuration.cs 2007-11-13 05:04:36 UTC (rev 1050) @@ -46,7 +46,6 @@ public List<ButtonMapping> SystemWideMappings { get { return _systemWideMappings; } - set { _systemWideMappings = value; } } /// <summary> @@ -56,7 +55,6 @@ public List<ProgramSettings> Programs { get { return _programSettings; } - set { _programSettings = value; } } /// <summary> @@ -66,7 +64,6 @@ public List<MappedEvent> Events { get { return _mappedEvents; } - set { _mappedEvents = value; } } #endregion Properties Modified: trunk/plugins/IR Server Suite/Applications/Translator/CopyDataWM.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/CopyDataWM.cs 2007-11-12 20:48:32 UTC (rev 1049) +++ trunk/plugins/IR Server Suite/Applications/Translator/CopyDataWM.cs 2007-11-13 05:04:36 UTC (rev 1050) @@ -30,9 +30,7 @@ /// <summary> /// Initializes a new instance of the <see cref="CopyDataWM"/> class. /// </summary> - public CopyDataWM() - { - } + public CopyDataWM() { } /// <summary> /// Releases unmanaged resources and performs other cleanup operations before the Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs 2007-11-12 20:48:32 UTC (rev 1049) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs 2007-11-13 05:04:36 UTC (rev 1050) @@ -215,24 +215,16 @@ string[] commands = Common.SplitWindowMessageCommand(suffix); tabControl.SelectTab(tabPageMessage); - switch (commands[0].ToLowerInvariant()) + switch (commands[0].ToUpperInvariant()) { - case "active": - radioButtonActiveWindow.Checked = true; - break; - case "application": - radioButtonApplication.Checked = true; - break; - case "class": - radioButtonClass.Checked = true; - break; - case "window": - radioButtonWindowTitle.Checked = true; - break; + case Common.WMTargetActive: radioButtonActiveWindow.Checked = true; break; + case Common.WMTargetApplication: radioButtonApplication.Checked = true; break; + case Common.WMTargetClass: radioButtonClass.Checked = true; break; + case Common.WMTargetWindow: radioButtonWindowTitle.Checked = true; break; } - textBoxMsgTarget.Text = commands[1]; - numericUpDownMsg.Value = decimal.Parse(commands[2]); + textBoxMsgTarget.Text = commands[1]; + numericUpDownMsg.Value = decimal.Parse(commands[2]); numericUpDownWParam.Value = decimal.Parse(commands[3]); numericUpDownLParam.Value = decimal.Parse(commands[4]); break; @@ -262,7 +254,7 @@ else if (suffix.StartsWith(Common.MouseMoveRight)) checkBoxMouseMoveRight.Checked = true; else if (suffix.StartsWith(Common.MouseMoveUp)) checkBoxMouseMoveUp.Checked = true; - numericUpDownMouseMove.Value = Decimal.Parse(suffix.Substring(suffix.IndexOf(" "))); + numericUpDownMouseMove.Value = Decimal.Parse(suffix.Substring(suffix.IndexOf(' '))); break; } break; @@ -294,7 +286,7 @@ break; default: - if (prefix.Equals(Common.CmdPrefixEject, StringComparison.InvariantCultureIgnoreCase)) + if (prefix.Equals(Common.CmdPrefixEject, StringComparison.OrdinalIgnoreCase)) comboBoxMiscCommand.SelectedItem = Common.UITextEject; //else break; @@ -382,24 +374,24 @@ case "tabPageMessage": { - string target = "error"; + string target = "ERROR"; if (radioButtonActiveWindow.Checked) { - target = "active"; + target = Common.WMTargetActive; textBoxMsgTarget.Text = "*"; } else if (radioButtonApplication.Checked) { - target = "application"; + target = Common.WMTargetApplication; } else if (radioButtonClass.Checked) { - target = "class"; + target = Common.WMTargetClass; } else if (radioButtonWindowTitle.Checked) { - target = "window"; + target = Common.WMTargetWindow; } textBoxCommand.Text = _command = Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.cs 2007-11-12 20:48:32 UTC (rev 1049) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.cs 2007-11-13 05:04:36 UTC (rev 1050) @@ -73,7 +73,7 @@ if (progSettings != null) { DisplayName = progSettings.Name; - Filename = progSettings.Filename; + Filename = progSettings.FileName; StartupFolder = progSettings.Folder; Parameters = progSettings.Arguments; StartState = progSettings.WindowState; @@ -100,7 +100,7 @@ if (String.IsNullOrEmpty(textBoxAppStartFolder.Text)) textBoxAppStartFolder.Text = Path.GetDirectoryName(find.FileName); - if (String.IsNullOrEmpty(textBoxDisplayName.Text) || textBoxDisplayName.Text == "New Program") + if (String.IsNullOrEmpty(textBoxDisplayName.Text) || textBoxDisplayName.Text.Equals("New Program", StringComparison.Ordinal)) textBoxDisplayName.Text = Path.GetFileNameWithoutExtension(find.FileName); } } Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MacroEditor.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MacroEditor.cs 2007-11-12 20:48:32 UTC (rev 1049) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MacroEditor.cs 2007-11-13 05:04:36 UTC (rev 1050) @@ -284,73 +284,71 @@ string selected = comboBoxCommands.SelectedItem as string; - if (selected == Common.UITextRun) + if (selected.Equals(Common.UITextRun, StringComparison.OrdinalIgnoreCase)) { ExternalProgram externalProgram = new ExternalProgram(false); if (externalProgram.ShowDialog(this) == DialogResult.OK) listBoxMacro.Items.Add(Common.CmdPrefixRun + externalProgram.CommandString); } - else if (selected == Common.UITextPause) + else if (selected.Equals(Common.UITextPause, StringComparison.OrdinalIgnoreCase)) { PauseTime pauseTime = new PauseTime(); if (pauseTime.ShowDialog(this) == DialogResult.OK) listBoxMacro.Items.Add(Common.CmdPrefixPause + pauseTime.Time.ToString()); } - else if (selected == Common.UITextSerial) + else if (selected.Equals(Common.UITextSerial, StringComparison.OrdinalIgnoreCase)) { SerialCommand serialCommand = new SerialCommand(); if (serialCommand.ShowDialog(this) == DialogResult.OK) listBoxMacro.Items.Add(Common.CmdPrefixSerial + serialCommand.CommandString); } - else if (selected == Common.UITextWindowMsg) + else if (selected.Equals(Common.UITextWindowMsg, StringComparison.OrdinalIgnoreCase)) { MessageCommand messageCommand = new MessageCommand(); if (messageCommand.ShowDialog(this) == DialogResult.OK) listBoxMacro.Items.Add(Common.CmdPrefixWindowMsg + messageCommand.CommandString); } - else if (selected == Common.UITextTcpMsg) + else if (selected.Equals(Common.UITextTcpMsg, StringComparison.OrdinalIgnoreCase)) { TcpMessageCommand tcpMessageCommand = new TcpMessageCommand(); - if (tcpMessageCommand.ShowDialog(this) == DialogResult.Cancel) - return; - - listBoxMacro.Items.Add(Common.CmdPrefixTcpMsg + tcpMessageCommand.CommandString); + if (tcpMessageCommand.ShowDialog(this) == DialogResult.OK) + listBoxMacro.Items.Add(Common.CmdPrefixTcpMsg + tcpMessageCommand.CommandString); } - else if (selected == Common.UITextKeys) + else if (selected.Equals(Common.UITextKeys, StringComparison.OrdinalIgnoreCase)) { KeysCommand keysCommand = new KeysCommand(); if (keysCommand.ShowDialog(this) == DialogResult.OK) listBoxMacro.Items.Add(Common.CmdPrefixKeys + keysCommand.CommandString); } - else if (selected == Common.UITextMouse) + else if (selected.Equals(Common.UITextMouse, StringComparison.OrdinalIgnoreCase)) { MouseCommand mouseCommand = new MouseCommand(); if (mouseCommand.ShowDialog(this) == DialogResult.OK) listBoxMacro.Items.Add(Common.CmdPrefixMouse + mouseCommand.CommandString); } - else if (selected == Common.UITextEject) + else if (selected.Equals(Common.UITextEject, StringComparison.OrdinalIgnoreCase)) { EjectCommand ejectCommand = new EjectCommand(); if (ejectCommand.ShowDialog(this) == DialogResult.OK) listBoxMacro.Items.Add(Common.CmdPrefixEject + ejectCommand.CommandString); } - else if (selected == Common.UITextStandby) + else if (selected.Equals(Common.UITextStandby, StringComparison.OrdinalIgnoreCase)) { listBoxMacro.Items.Add(Common.CmdPrefixStandby); } - else if (selected == Common.UITextHibernate) + else if (selected.Equals(Common.UITextHibernate, StringComparison.OrdinalIgnoreCase)) { listBoxMacro.Items.Add(Common.CmdPrefixHibernate); } - else if (selected == Common.UITextReboot) + else if (selected.Equals(Common.UITextReboot, StringComparison.OrdinalIgnoreCase)) { listBoxMacro.Items.Add(Common.CmdPrefixReboot); } - else if (selected == Common.UITextShutdown) + else if (selected.Equals(Common.UITextShutdown, StringComparison.OrdinalIgnoreCase)) { listBoxMacro.Items.Add(Common.CmdPrefixShutdown); } - else if (selected.StartsWith(Common.CmdPrefixBlast)) + else if (selected.StartsWith(Common.CmdPrefixBlast, StringComparison.OrdinalIgnoreCase)) { BlastCommand blastCommand = new BlastCommand( new BlastIrDelegate(Program.BlastIR), @@ -361,7 +359,7 @@ if (blastCommand.ShowDialog(this) == DialogResult.OK) listBoxMacro.Items.Add(Common.CmdPrefixBlast + blastCommand.CommandString); } - else if (selected.StartsWith(Common.CmdPrefixMacro)) + else if (selected.StartsWith(Common.CmdPrefixMacro, StringComparison.OrdinalIgnoreCase)) { listBoxMacro.Items.Add(selected); } @@ -471,7 +469,7 @@ string selected = listBoxMacro.SelectedItem as string; - if (selected.StartsWith(Common.CmdPrefixPause)) + if (selected.StartsWith(Common.CmdPrefixPause, StringComparison.OrdinalIgnoreCase)) { PauseTime pauseTime = new PauseTime(int.Parse(selected.Substring(Common.CmdPrefixPause.Length))); if (pauseTime.ShowDialog(this) == DialogResult.Cancel) @@ -482,7 +480,7 @@ listBoxMacro.Items.Insert(index, Common.CmdPrefixPause + pauseTime.Time.ToString()); listBoxMacro.SelectedIndex = index; } - else if (selected.StartsWith(Common.CmdPrefixRun)) + else if (selected.StartsWith(Common.CmdPrefixRun, StringComparison.OrdinalIgnoreCase)) { string[] commands = Common.SplitRunCommand(selected.Substring(Common.CmdPrefixRun.Length)); @@ -495,7 +493,7 @@ listBoxMacro.Items.Insert(index, Common.CmdPrefixRun + executeProgram.CommandString); listBoxMacro.SelectedIndex = index; } - else if (selected.StartsWith(Common.CmdPrefixSerial)) + else if (selected.StartsWith(Common.CmdPrefixSerial, StringComparison.OrdinalIgnoreCase)) { string[] commands = Common.SplitSerialCommand(selected.Substring(Common.CmdPrefixSerial.Length)); @@ -508,7 +506,7 @@ listBoxMacro.Items.Insert(index, Common.CmdPrefixSerial + serialCommand.CommandString); listBoxMacro.SelectedIndex = index; } - else if (selected.StartsWith(Common.CmdPrefixWindowMsg)) + else if (selected.StartsWith(Common.CmdPrefixWindowMsg, StringComparison.OrdinalIgnoreCase)) { string[] commands = Common.SplitWindowMessageCommand(selected.Substring(Common.CmdPrefixWindowMsg.Length)); @@ -521,7 +519,7 @@ listBoxMacro.Items.Insert(index, Common.CmdPrefixWindowMsg + messageCommand.CommandString); listBoxMacro.SelectedIndex = index; } - else if (selected.StartsWith(Common.CmdPrefixTcpMsg)) + else if (selected.StartsWith(Common.CmdPrefixTcpMsg, StringComparison.OrdinalIgnoreCase)) { string[] commands = Common.SplitTcpMessageCommand(selected.Substring(Common.CmdPrefixTcpMsg.Length)); TcpMessageCommand tcpMessageCommand = new TcpMessageCommand(commands); @@ -533,7 +531,7 @@ listBoxMacro.Items.Insert(index, Common.CmdPrefixTcpMsg + tcpMessageCommand.CommandString); listBoxMacro.SelectedIndex = index; } - else if (selected.StartsWith(Common.CmdPrefixKeys)) + else if (selected.StartsWith(Common.CmdPrefixKeys, StringComparison.OrdinalIgnoreCase)) { KeysCommand keysCommand = new KeysCommand(selected.Substring(Common.CmdPrefixKeys.Length)); if (keysCommand.ShowDialog(this) == DialogResult.Cancel) @@ -544,7 +542,7 @@ listBoxMacro.Items.Insert(index, Common.CmdPrefixKeys + keysCommand.CommandString); listBoxMacro.SelectedIndex = index; } - else if (selected.StartsWith(Common.CmdPrefixMouse)) + else if (selected.StartsWith(Common.CmdPrefixMouse, StringComparison.OrdinalIgnoreCase)) { MouseCommand mouseCommand = new MouseCommand(selected.Substring(Common.CmdPrefixMouse.Length)); if (mouseCommand.ShowDialog(this) == DialogResult.Cancel) @@ -555,7 +553,7 @@ listBoxMacro.Items.Insert(index, Common.CmdPrefixMouse + mouseCommand.CommandString); listBoxMacro.SelectedIndex = index; } - else if (selected.StartsWith(Common.CmdPrefixEject)) + else if (selected.StartsWith(Common.CmdPrefixEject, StringComparison.OrdinalIgnoreCase)) { EjectCommand ejectCommand = new EjectCommand(selected.Substring(Common.CmdPrefixEject.Length)); if (ejectCommand.ShowDialog(this) == DialogResult.Cancel) @@ -566,7 +564,7 @@ listBoxMacro.Items.Insert(index, Common.CmdPrefixEject + ejectCommand.CommandString); listBoxMacro.SelectedIndex = index; } - else if (selected.StartsWith(Common.CmdPrefixBlast)) + else if (selected.StartsWith(Common.CmdPrefixBlast, StringComparison.OrdinalIgnoreCase)) { string[] commands = Common.SplitBlastCommand(selected.Substring(Common.CmdPrefixBlast.Length)); Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2007-11-12 20:48:32 UTC (rev 1049) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2007-11-13 05:04:36 UTC (rev 1050) @@ -147,8 +147,18 @@ { imageListPrograms.Images.Clear(); imageListPrograms.Images.Add(Properties.Resources.WinLogo); - imageListPrograms.Images.Add(Properties.Resources.NoIcon); + Icon large; + Icon small; + + string folder = Environment.GetFolderPath(Environment.SpecialFolder.System); + string file = folder + "\\user32.dll"; + Win32.ExtractIcons(file, 1, out large, out small); + imageListPrograms.Images.Add(large); + + + //imageListPrograms.Images.Add(Properties.Resources.NoIcon); + string wasSelected = string.Empty; if (listViewPrograms.Items.Count > 0) wasSelected = listViewPrograms.Items[_selectedProgram].Text; @@ -165,13 +175,13 @@ int imageIndex = 2; foreach (ProgramSettings progSettings in Program.Config.Programs) { - Icon icon = Win32.GetIconFor(progSettings.Filename); + Icon icon = Win32.GetIconFor(progSettings.FileName); if (icon != null) { imageListPrograms.Images.Add(icon); newItem = new ListViewItem(progSettings.Name, imageIndex++); - newItem.ToolTipText = progSettings.Filename; + newItem.ToolTipText = progSettings.FileName; } else { @@ -222,7 +232,7 @@ comboBoxEvents.Items.Clear(); foreach (string eventName in Enum.GetNames(typeof(MappingEvent))) - if (eventName != "None") + if (!eventName.Equals("None", StringComparison.OrdinalIgnoreCase)) comboBoxEvents.Items.Add(eventName); comboBoxEvents.SelectedIndex = 0; @@ -372,7 +382,7 @@ if (editProg.ShowDialog(this) == DialogResult.OK) { progSettings.Name = editProg.DisplayName; - progSettings.Filename = editProg.Filename; + progSettings.FileName = editProg.Filename; progSettings.Folder = editProg.StartupFolder; progSettings.Arguments = editProg.Parameters; progSettings.WindowState = editProg.StartState; @@ -473,7 +483,7 @@ foreach (ButtonMapping test in currentMappings) { - if (keyCode == test.KeyCode) + if (keyCode.Equals(test.KeyCode, StringComparison.Ordinal)) { existing = test; map = new ButtonMappingForm(test.KeyCode, test.Description, test.Command); @@ -512,7 +522,7 @@ { for (int index = 0; index < listViewButtons.Items.Count; index++) { - if (listViewButtons.Items[index].SubItems[0].Text == map.KeyCode) + if (listViewButtons.Items[index].SubItems[0].Text.Equals(map.KeyCode, StringComparison.Ordinal)) { listViewButtons.Items[index].SubItems[1].Text = map.Description; listViewButtons.Items[index].SubItems[2].Text = map.Command; @@ -540,7 +550,7 @@ ButtonMapping toRemove = null; foreach (ButtonMapping test in currentMappings) { - if (test.KeyCode == item.SubItems[0].Text) + if (test.KeyCode.Equals(item.SubItems[0].Text, StringComparison.Ordinal)) { toRemove = test; break; @@ -563,7 +573,7 @@ foreach (ButtonMapping test in currentMappings) { - if (item.SubItems[0].Text == test.KeyCode) + if (item.SubItems[0].Text.Equals(test.KeyCode, StringComparison.Ordinal)) { ButtonMappingForm map = new ButtonMappingForm(test.KeyCode, test.Description, test.Command); @@ -613,7 +623,7 @@ foreach (ProgramSettings programSettings in Program.Config.Programs) { - if (programSettings.Name == programName) + if (programSettings.Name.Equals(programName, StringComparison.OrdinalIgnoreCase)) { ImportButtons(programSettings.ButtonMappings); return; @@ -633,7 +643,7 @@ foreach (ButtonMapping existingMapping in currentMappings) { - if (existingMapping.KeyCode == newMapping.KeyCode) + if (existingMapping.KeyCode.Equals(newMapping.KeyCode, StringComparison.Ordinal)) { // Change the existing mapping to the new one existingMapping.Description = newMapping.Description; @@ -952,7 +962,7 @@ string selected = comboBoxCommands.SelectedItem as string; string command = String.Empty; - if (selected == Common.UITextRun) + if (selected.Equals(Common.UITextRun, StringComparison.OrdinalIgnoreCase)) { ExternalProgram externalProgram = new ExternalProgram(false); @@ -961,7 +971,7 @@ command = Common.CmdPrefixRun + externalProgram.CommandString; } - else if (selected == Common.UITextSerial) + else if (selected.Equals(Common.UITextSerial, StringComparison.OrdinalIgnoreCase)) { SerialCommand serialCommand = new SerialCommand(); if (serialCommand.ShowDialog(this) == DialogResult.Cancel) @@ -969,7 +979,7 @@ command = Common.CmdPrefixSerial + serialCommand.CommandString; } - else if (selected == Common.UITextWindowMsg) + else if (selected.Equals(Common.UITextWindowMsg, StringComparison.OrdinalIgnoreCase)) { MessageCommand messageCommand = new MessageCommand(); if (messageCommand.ShowDialog(this) == DialogResult.Cancel) @@ -977,7 +987,7 @@ command = Common.CmdPrefixWindowMsg + messageCommand.CommandString; } - else if (selected == Common.UITextKeys) + else if (selected.Equals(Common.UITextKeys, StringComparison.OrdinalIgnoreCase)) { KeysCommand keysCommand = new KeysCommand(); if (keysCommand.ShowDialog(this) == DialogResult.Cancel) @@ -985,7 +995,7 @@ command = Common.CmdPrefixKeys + keysCommand.CommandString; } - else if (selected.StartsWith(Common.CmdPrefixBlast)) + else if (selected.StartsWith(Common.CmdPrefixBlast, StringComparison.OrdinalIgnoreCase)) { BlastCommand blastCommand = new BlastCommand( new BlastIrDelegate(Program.BlastIR), @@ -998,7 +1008,7 @@ command = Common.CmdPrefixBlast + blastCommand.CommandString; } - else if (selected.StartsWith(Common.CmdPrefixMacro)) + else if (selected.StartsWith(Common.CmdPrefixMacro, StringComparison.OrdinalIgnoreCase)) { command = selected; } @@ -1025,7 +1035,7 @@ string command = listViewEventMap.SelectedItems[0].SubItems[1].Text; - if (command.StartsWith(Common.CmdPrefixRun)) + if (command.StartsWith(Common.CmdPrefixRun, StringComparison.OrdinalIgnoreCase)) { string[] commands = Common.SplitRunCommand(command.Substring(Common.CmdPrefixRun.Length)); ExternalProgram externalProgram = new ExternalProgram(commands, false); @@ -1034,7 +1044,7 @@ command = Common.CmdPrefixRun + externalProgram.CommandString; } - else if (command.StartsWith(Common.CmdPrefixSerial)) + else if (command.StartsWith(Common.CmdPrefixSerial, StringComparison.OrdinalIgnoreCase)) { string[] commands = Common.SplitSerialCommand(command.Substring(Common.CmdPrefixSerial.Length)); SerialCommand serialCommand = new SerialCommand(commands); @@ -1043,7 +1053,7 @@ command = Common.CmdPrefixSerial + serialCommand.CommandString; } - else if (command.StartsWith(Common.CmdPrefixWindowMsg)) + else if (command.StartsWith(Common.CmdPrefixWindowMsg, StringComparison.OrdinalIgnoreCase)) { string[] commands = Common.SplitWindowMessageCommand(command.Substring(Common.CmdPrefixWindowMsg.Length)); MessageCommand messageCommand = new MessageCommand(commands); @@ -1052,7 +1062,7 @@ command = Common.CmdPrefixWindowMsg + messageCommand.CommandString; } - else if (command.StartsWith(Common.CmdPrefixKeys)) + else if (command.StartsWith(Common.CmdPrefixKeys, StringComparison.OrdinalIgnoreCase)) { KeysCommand keysCommand = new KeysCommand(command.Substring(Common.CmdPrefixKeys.Length)); if (keysCommand.ShowDialog(this) == DialogResult.Cancel) @@ -1060,7 +1070,7 @@ command = Common.CmdPrefixKeys + keysCommand.CommandString; } - else if (command.StartsWith(Common.CmdPrefixBlast)) + else if (command.StartsWith(Common.CmdPrefixBlast, StringComparison.OrdinalIgnoreCase)) { string[] commands = Common.SplitBlastCommand(command.Substring(Common.CmdPrefixBlast.Length)); @@ -1256,7 +1266,7 @@ if (programSettings.Name.Equals(selectedItem)) continue; - Icon icon = Win32.GetIconFor(programSettings.Filename); + Icon icon = Win32.GetIconFor(programSettings.FileName); Image image = null; if (icon != null) image = icon.ToBitmap(); Added: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MenuForm.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MenuForm.Designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MenuForm.Designer.cs 2007-11-13 05:04:36 UTC (rev 1050) @@ -0,0 +1,115 @@ +namespace Translator +{ + partial class MenuForm + { + /// <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.components = new System.ComponentModel.Container(); + this.listViewMenu = new System.Windows.Forms.ListView(); + this.toolTips = new System.Windows.Forms.ToolTip(this.components); + this.labelHeader = new System.Windows.Forms.Label(); + this.columnHeader = new System.Windows.Forms.ColumnHeader(); + this.SuspendLayout(); + // + // listViewMenu + // + this.listViewMenu.Activation = System.Windows.Forms.ItemActivation.OneClick; + this.listViewMenu.Alignment = System.Windows.Forms.ListViewAlignment.Left; + this.listViewMenu.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.listViewMenu.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeader}); + this.listViewMenu.Dock = System.Windows.Forms.DockStyle.Fill; + this.listViewMenu.FullRowSelect = true; + this.listViewMenu.GridLines = true; + this.listViewMenu.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; + this.listViewMenu.HideSelection = false; + this.listViewMenu.HotTracking = true; + this.listViewMenu.HoverSelection = true; + this.listViewMenu.Location = new System.Drawing.Point(0, 20); + this.listViewMenu.MultiSelect = false; + this.listViewMenu.Name = "listViewMenu"; + this.listViewMenu.Scrollable = false; + this.listViewMenu.ShowGroups = false; + this.listViewMenu.ShowItemToolTips = true; + this.listViewMenu.Size = new System.Drawing.Size(256, 108); + this.listViewMenu.TabIndex = 1; + this.listViewMenu.TileSize = new System.Drawing.Size(128, 96); + this.listViewMenu.UseCompatibleStateImageBehavior = false; + this.listViewMenu.ItemActivate += new System.EventHandler(this.listViewMenu_ItemActivate); + this.listViewMenu.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.listViewMenu_KeyPress); + // + // labelHeader + // + this.labelHeader.BackColor = System.Drawing.SystemColors.GradientActiveCaption; + this.labelHeader.Dock = System.Windows.Forms.DockStyle.Top; + this.labelHeader.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.labelHeader.Location = new System.Drawing.Point(0, 0); + this.labelHeader.Name = "labelHeader"; + this.labelHeader.Size = new System.Drawing.Size(256, 20); + this.labelHeader.TabIndex = 0; + this.labelHeader.Text = "Translator OSD"; + this.labelHeader.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // columnHeader + // + this.columnHeader.Width = 232; + // + // MenuForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(256, 128); + this.ControlBox = false; + this.Controls.Add(this.listViewMenu); + this.Controls.Add(this.labelHeader); + this.DoubleBuffered = true; + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.MaximizeBox = false; + this.MaximumSize = new System.Drawing.Size(512, 256); + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(256, 128); + this.Name = "MenuForm"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "MenuForm"; + this.TopMost = true; + this.Deactivate += new System.EventHandler(this.MenuForm_Deactivate); + this.Shown += new System.EventHandler(this.MenuForm_Shown); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.ListView listViewMenu; + private System.Windows.Forms.ToolTip toolTips; + private System.Windows.Forms.Label labelHeader; + private System.Windows.Forms.ColumnHeader columnHeader; + } +} \ No newline at end of file Added: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MenuForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MenuForm.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MenuForm.cs 2007-11-13 05:04:36 UTC (rev 1050) @@ -0,0 +1,786 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Diagnostics; +using System.Drawing; +using System.IO; +using System.Text; +using System.Windows.Forms; + +using IrssUtils; + +namespace Translator +{ + + /// <summary> + /// Translator Menu. + /// </summary> + public partial class MenuForm : Form + { + + #region Constants + + const string WindowTitle = "Translator OSD"; + + // Menus + const string MenuMain = "Main"; + const string MenuLaunch = "Launch"; + const string MenuTasks = "Tasks"; + const string MenuMacros = "Macros"; + const string MenuSystem = "System"; + const string MenuWindows = "Windows"; + const string MenuPower = "Power"; + const string MenuAudio = "Audio"; + const string MenuEject = "Eject"; + + // Menu UI Text + const string UITextMain = "Main Menu"; + const string UITextLaunch = "Launch App"; + const string UITextTasks = "Task Swap"; + const string UITextMacros = "Macros"; + const string UITextSystem = "System Commands"; + const string UITextWindows = "Window Management"; + const string UITextPower = "Power"; + const string UITextAudio = "Audio"; + const string UITextEject = "Eject"; + + // Menu descriptions + const string DescLaunch = "Launch an application"; + const string DescTasks = "Switch between running programs"; + const string DescMacros = "Run a macro"; + const string DescSystem = "Perform a system command"; + const string DescWindows = "Manage open windows"; + const string DescPower = "Modify the computer's power state"; + const string DescAudio = "Adjust the system volume"; + const string DescEject = "Eject a disc"; + + // Tags + const string TagMenu = "Menu: "; + const string TagMacro = "Macro: "; + const string TagLaunch = "Launch: "; + const string TagCommand = "Command: "; + const string TagEject = "Eject: "; + + // Commands + const string CommandShutdown = "Shutdown"; + const string CommandReboot = "Reboot"; + const string CommandLogOff = "LogOff"; + const string CommandStandby = "Standby"; + const string CommandHibernate = "Hibernate"; + + // Icon indexes + const int IconLaunch = 24; + const int IconTasks = 98; + const int IconMacros = 70; + const int IconDesktop = 34; + const int IconWindows = 15; + const int IconPower = 27; + const int IconAudio = 168; + const int IconEject = 188; + + #endregion Constants + + #region Variables + + ImageList _listMain; + + ListViewItem _launch; + ListViewItem _taskSwitch; + ListViewItem _macro; + ListViewItem _system; + + List<string> _menuStack; + + string _startMenu = "Main"; + + #endregion Variables + + /// <summary> + /// Initializes a new instance of the <see cref="MenuForm"/> class. + /// </summary> + public MenuForm() + { + InitializeComponent(); + + CreateMainImageList(); + + _launch = new ListViewItem(UITextLaunch, 0); + _launch.ToolTipText = DescLaunch; + _launch.Tag = TagMenu + MenuLaunch; + + _taskSwitch = new ListViewItem(UITextTasks, 1); + _taskSwitch.ToolTipText = DescTasks; + _taskSwitch.Tag = TagMenu + MenuTasks; + + _macro = new ListViewItem(UITextMacros, 2); + _macro.ToolTipText = DescMacros; + _macro.Tag = TagMenu + MenuMacros; + + _system = new ListViewItem(UITextSystem, 3); + _system.ToolTipText = DescSystem; + _system.Tag = TagMenu + MenuSystem; + + _menuStack = new List<string>(); + } + + private void MenuForm_Shown(object sender, EventArgs e) + { + SwitchMenu(_startMenu); + _startMenu = MenuMain; + + Win32.SetForegroundWindow(this.Handle, true); + + //listViewMenu.Select(); + } + + private void MenuForm_Deactivate(object sender, EventArgs e) + { + this.Close(); + } + + + + void CreateMainImageList() + { + _listMain = new ImageList(); + _listMain.ColorDepth = ColorDepth.Depth32Bit; + _listMain.ImageSize = new Size(32, 32); + + Icon large; + Icon small; + + string folder = Environment.GetFolderPath(Environment.SpecialFolder.System); + string file = folder + "\\shell32.dll"; + + Win32.ExtractIcons(file, IconLaunch, out large, out small); + _listMain.Images.Add(large); + + Win32.ExtractIcons(file, IconTasks, out large, out small); + _listMain.Images.Add(large); + + Win32.ExtractIcons(file, IconMacros, out large, out small); + _listMain.Images.Add(large); + + _listMain.Images.Add(Properties.Resources.WinLogo); + } + + void SetToIconStyle() + { + listViewMenu.View = View.LargeIcon; + listViewMenu.Alignment = ListViewAlignment.Left; + listViewMenu.Scrollable = true; + + } + void SetToListStyle() + { + listViewMenu.View = View.Details; + listViewMenu.Alignment = ListViewAlignment.Top; + listViewMenu.Scrollable = true; + + } + + void SetWindowTitle(string subMenuName) + { + if (String.IsNullOrEmpty(subMenuName)) + labelHeader.Text = WindowTitle; + else + labelHeader.Text = WindowTitle + " - " + subMenuName; + } + + + void LoadMenuMain() + { + SetWindowTitle(UITextMain); + + listViewMenu.LargeImageList = _listMain; + + //listViewMenu.SelectedItems.Clear(); + listViewMenu.Items.Clear(); + + SetToIconStyle(); + + listViewMenu.Items.Add(_launch); + listViewMenu.Items.Add(_taskSwitch); + listViewMenu.Items.Add(_macro); + listViewMenu.Items.Add(_system); + + _launch.Selected = true; + } + + void LoadMenuLaunch() + { + SetWindowTitle(UITextLaunch); + + //listViewMenu.SelectedItems.Clear(); + listViewMenu.Items.Clear(); + + ImageList newList = new ImageList(); + newList.ColorDepth = ColorDepth.Depth32Bit; + newList.ImageSize = new Size(32, 32); + + listViewMenu.LargeImageList = newList; + + SetToIconStyle(); + + int index = 0; + foreach (ProgramSettings program in Program.Config.Programs) + { + newList.Images.Add(Win32.GetIconFor(program.FileName)); + ListViewItem item = new ListViewItem(program.Name, index++); + item.ToolTipText = program.FileName; + item.Tag = TagLaunch + program.FileName; + + listViewMenu.Items.Add(item); + } + + listViewMenu.Items[0].Selected = true; + } + void LoadMenuTasks() + { + SetWindowTitle(UITextTasks); + + //listViewMenu.SelectedItems.Clear(); + listViewMenu.Items.Clear(); + + ImageList newList = new ImageList(); + newList.ColorDepth = ColorDepth.Depth32Bit; + newList.ImageSize = new Size(32, 32); + + listViewMenu.LargeImageList = newList; + + SetToIconStyle(); + + Icon large; + Icon small; + + string folder = Environment.GetFolderPath(Environment.SpecialFolder.System); + string file = folder + "\\shell32.dll"; + + Win32.ExtractIcons(file, IconDesktop, out large, out small); + newList.Images.Add(large); + + ListViewItem desktop = new ListViewItem("Desktop", 0); + desktop.ToolTipText = "Show the Desktop"; + desktop.Tag = IntPtr.Zero; + d... [truncated message content] |