From: <che...@us...> - 2009-06-03 10:04:09
|
Revision: 2891 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2891&view=rev Author: chef_koch Date: 2009-06-03 10:03:58 +0000 (Wed, 03 Jun 2009) Log Message: ----------- resharped complete IRSS solution Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/LogTimeCodeExtractor/Program.cs trunk/plugins/IR Server Suite/Applications/LogTimeCodeExtractor/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/MacroScope/FormMain.cs trunk/plugins/IR Server Suite/Applications/MacroScope/Program.cs trunk/plugins/IR Server Suite/Applications/MacroScope/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Media Center Blaster/ExternalChannelConfig.cs trunk/plugins/IR Server Suite/Applications/Media Center Blaster/Forms/ExternalChannels.cs trunk/plugins/IR Server Suite/Applications/Media Center Blaster/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/Applications/Media Center Blaster/Forms/SetupForm.cs trunk/plugins/IR Server Suite/Applications/Media Center Blaster/Forms/StbSetup.cs trunk/plugins/IR Server Suite/Applications/Media Center Blaster/Program.cs trunk/plugins/IR Server Suite/Applications/Media Center Blaster/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Media Center Blaster/Tray.cs trunk/plugins/IR Server Suite/Applications/Translator/Program.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote (Smartphone2003)/FormMain.cs trunk/plugins/IR Server Suite/Applications/Web Remote/WebServer.cs trunk/plugins/IR Server Suite/Common/IrssComms/IrssMessage.cs trunk/plugins/IR Server Suite/Common/IrssScheduler/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Common/IrssScheduler/ScheduleEvent.cs trunk/plugins/IR Server Suite/Common/IrssScheduler/Scheduler.cs trunk/plugins/IR Server Suite/IR Server Plugins/Imon Receiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/Imon Receiver/DeviceIoOverlapped.cs trunk/plugins/IR Server Suite/IR Server Plugins/Imon Receiver/Imon Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Imon Receiver/Keyboard.cs trunk/plugins/IR Server Suite/IR Server Plugins/Imon Receiver/Mouse.cs trunk/plugins/IR Server Suite/IR Server Plugins/Imon Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Imon USB Receivers.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Speech Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/Speech Receiver/SpeechReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/WiimoteLib/Wiimote.cs trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10Transceiver.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/ExternalChannels.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs Modified: trunk/plugins/IR Server Suite/Applications/LogTimeCodeExtractor/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/LogTimeCodeExtractor/Program.cs 2009-06-03 00:31:12 UTC (rev 2890) +++ trunk/plugins/IR Server Suite/Applications/LogTimeCodeExtractor/Program.cs 2009-06-03 10:03:58 UTC (rev 2891) @@ -1,15 +1,12 @@ using System; using System.Collections.Generic; using System.IO; -using System.Text; namespace LogTimeCodeExtractor { - - class Program + internal class Program { - - static void Main(string[] args) + private static void Main(string[] args) { if (args.Length != 1) { @@ -26,7 +23,7 @@ { if (line.StartsWith("+") || line.StartsWith("-")) { - string[] timesStrings = line.Split(new char[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries); + string[] timesStrings = line.Split(new char[] {',', ' '}, StringSplitOptions.RemoveEmptyEntries); foreach (string time in timesStrings) { @@ -42,7 +39,5 @@ Console.Write(", "); } } - } - -} +} \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Applications/LogTimeCodeExtractor/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/LogTimeCodeExtractor/Properties/AssemblyInfo.cs 2009-06-03 00:31:12 UTC (rev 2890) +++ trunk/plugins/IR Server Suite/Applications/LogTimeCodeExtractor/Properties/AssemblyInfo.cs 2009-06-03 10:03:58 UTC (rev 2891) @@ -1,11 +1,11 @@ using System.Reflection; -using System.Runtime.CompilerServices; +using System.Resources; using System.Runtime.InteropServices; -using System.Resources; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. + [assembly: AssemblyTitle("LogTimeCodeExtractor")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] @@ -18,9 +18,11 @@ // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. + [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM + [assembly: Guid("a20b9b41-55a2-454d-a461-9b4a77abdcf3")] // Version information for an assembly consists of the following four values: @@ -30,6 +32,7 @@ // Build Number // Revision // + [assembly: AssemblyVersion("1.4.2.0")] [assembly: AssemblyFileVersion("1.4.2.0")] -[assembly: NeutralResourcesLanguageAttribute("en")] +[assembly: NeutralResourcesLanguage("en")] \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Applications/MacroScope/FormMain.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/MacroScope/FormMain.cs 2009-06-03 00:31:12 UTC (rev 2890) +++ trunk/plugins/IR Server Suite/Applications/MacroScope/FormMain.cs 2009-06-03 10:03:58 UTC (rev 2891) @@ -1,31 +1,22 @@ using System; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.IO; using System.Text; using System.Windows.Forms; using System.Xml; - using IrssUtils; using IrssUtils.Forms; +using VariableList=Commands.VariableList; namespace MacroScope { - - public partial class FormMain : Form { - #region Variables - string _macroFile; - Commands.VariableList _variables; + private string _macroFile; + private readonly VariableList _variables; - bool _isDebugging; - int _debugLine; + private bool _isDebugging; + private int _debugLine; #endregion Variables @@ -37,17 +28,16 @@ PopulateCommandList(); - _variables = new Commands.VariableList(); + _variables = new VariableList(); } #endregion Constructor - /// <summary> /// Write the macro in the RichTextBox to a macro name provided. /// </summary> /// <param name="fileName">Name of Macro to write (macro name, not file path).</param> - void WriteToFile(string fileName) + private void WriteToFile(string fileName) { _macroFile = fileName; @@ -83,7 +73,7 @@ /// Read a macro into the listBox from the macro name provided. /// </summary> /// <param name="fileName">Name of Macro to read (macro name, not file path).</param> - void ReadFromFile(string fileName) + private void ReadFromFile(string fileName) { _macroFile = fileName; @@ -106,29 +96,27 @@ } - void ResetVariables() + private void ResetVariables() { _variables.VariableClear(); listViewVariables.Clear(); } - void LoadVariables(string fileName) + private void LoadVariables(string fileName) { // Dictionary<string, string>.Enumerator enumerator = _variables.GetEnumerator(); } - void SaveVariables(string fileName) + private void SaveVariables(string fileName) { - } - void ProcessCurrentLine() + private void ProcessCurrentLine() { - } - void DebugStep() + private void DebugStep() { if (_isDebugging) { @@ -137,9 +125,6 @@ _debugLine++; HighlightDebugLine(); - - - } else { @@ -150,7 +135,7 @@ } } - void DebugReset() + private void DebugReset() { _isDebugging = true; _debugLine = 0; @@ -158,7 +143,7 @@ HighlightDebugLine(); } - void DebugEnd() + private void DebugEnd() { _isDebugging = false; @@ -166,21 +151,18 @@ } - void HighlightDebugLine() + private void HighlightDebugLine() { if (_isDebugging) { - } else { - } - } - void PopulateCommandList() + private void PopulateCommandList() { TreeNode macroCommands = new TreeNode("Macro Commands"); macroCommands.Nodes.Add(Common.UITextSetVar); @@ -222,11 +204,11 @@ mediaPortalCommands.Nodes.Add(Common.UITextMultiMap); mediaPortalCommands.Nodes.Add(Common.UITextSendMPAction); mediaPortalCommands.Nodes.Add(Common.UITextSendMPMsg); - treeViewCommandList.Nodes.Add(mediaPortalCommands); + treeViewCommandList.Nodes.Add(mediaPortalCommands); } - void InsertCommand(string commandUiText) + private void InsertCommand(string commandUiText) { string newCommand = String.Empty; @@ -238,22 +220,18 @@ InsertText(beepCommand.CommandString); break; - - - - } if (!String.IsNullOrEmpty(newCommand)) InsertText(newCommand); } - void InsertText(string text) + private void InsertText(string text) { richTextBoxMacro.Text.Insert(richTextBoxMacro.SelectionStart, text); } - void UpdateStatus(string text) + private void UpdateStatus(string text) { toolStripStatusLabel.Text = text; } @@ -273,17 +251,14 @@ private void saveAsToolStripMenuItem_Click(object sender, EventArgs e) { - } private void saveToolStripMenuItem_Click(object sender, EventArgs e) { - } private void closeToolStripMenuItem_Click(object sender, EventArgs e) { - } private void quitToolStripMenuItem_Click(object sender, EventArgs e) @@ -293,12 +268,10 @@ private void contentsToolStripMenuItem_Click(object sender, EventArgs e) { - } private void aboutToolStripMenuItem_Click(object sender, EventArgs e) { - } private void treeViewCommandList_DoubleClick(object sender, EventArgs e) @@ -321,8 +294,5 @@ { DebugEnd(); } - - } - -} +} \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Applications/MacroScope/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/MacroScope/Program.cs 2009-06-03 00:31:12 UTC (rev 2890) +++ trunk/plugins/IR Server Suite/Applications/MacroScope/Program.cs 2009-06-03 10:03:58 UTC (rev 2891) @@ -1,21 +1,17 @@ using System; -using System.Collections.Generic; using System.Threading; using System.Windows.Forms; - using IrssUtils; namespace MacroScope { - - static class Program + internal static class Program { - /// <summary> /// The main entry point for the application. /// </summary> [STAThread] - static void Main() + private static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); @@ -41,11 +37,9 @@ /// </summary> /// <param name="sender">Sender.</param> /// <param name="e">Event args.</param> - static void Application_ThreadException(object sender, ThreadExceptionEventArgs e) + private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e) { IrssLog.Error(e.Exception); } - } - -} +} \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Applications/MacroScope/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/MacroScope/Properties/AssemblyInfo.cs 2009-06-03 00:31:12 UTC (rev 2890) +++ trunk/plugins/IR Server Suite/Applications/MacroScope/Properties/AssemblyInfo.cs 2009-06-03 10:03:58 UTC (rev 2891) @@ -1,14 +1,14 @@ using System; using System.Reflection; -using System.Runtime.CompilerServices; +using System.Resources; using System.Runtime.InteropServices; -using System.Resources; // // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. // + [assembly: AssemblyTitle("MacroScope")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] @@ -21,9 +21,11 @@ // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. + [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM + [assembly: Guid("3b4dbc18-a931-42eb-aa55-fc96a32f215f")] // Version information for an assembly consists of the following four values: @@ -33,8 +35,8 @@ // Build Number // Revision // + [assembly: AssemblyVersion("1.4.2.0")] [assembly: AssemblyFileVersion("1.4.2.0")] - [assembly: CLSCompliant(true)] -[assembly: NeutralResourcesLanguageAttribute("en")] +[assembly: NeutralResourcesLanguage("en")] \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Applications/Media Center Blaster/ExternalChannelConfig.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Media Center Blaster/ExternalChannelConfig.cs 2009-06-03 00:31:12 UTC (rev 2890) +++ trunk/plugins/IR Server Suite/Applications/Media Center Blaster/ExternalChannelConfig.cs 2009-06-03 10:03:58 UTC (rev 2891) @@ -1,49 +1,45 @@ using System; -using System.Collections.Generic; -using System.IO; using System.Text; using System.Xml; namespace MediaCenterBlaster { - /// <summary> /// External Channel Changing configuration file for tuning Set Top Boxes. /// </summary> public class ExternalChannelConfig { - #region Constants - const int DefaultCardID = 0; + private const int DefaultCardID = 0; - const int DefaultPauseTime = 500; - const bool DefaultSendSelect = false; - const bool DefaultDoubleChannelSelect = false; - const int DefaultRepeatChannelCommands = 0; - const int DefaultChannelDigits = 0; - const int DefaultRepeatPauseTime = 2000; - const bool DefaultUsePreChangeCommand = false; + private const int DefaultPauseTime = 500; + private const bool DefaultSendSelect = false; + private const bool DefaultDoubleChannelSelect = false; + private const int DefaultRepeatChannelCommands = 0; + private const int DefaultChannelDigits = 0; + private const int DefaultRepeatPauseTime = 2000; + private const bool DefaultUsePreChangeCommand = false; #endregion Constants #region Variables - string _fileName; + private readonly string _fileName; - int _cardID; + private int _cardID; - int _pauseTime; - bool _sendSelect; - bool _doubleChannelSelect; - int _repeatChannelCommands; - int _channelDigits; - int _repeatPauseTime; - bool _usePreChangeCommand; + private int _pauseTime; + private bool _sendSelect; + private bool _doubleChannelSelect; + private int _repeatChannelCommands; + private int _channelDigits; + private int _repeatPauseTime; + private bool _usePreChangeCommand; - string _selectCommand; - string _preChangeCommand; - string[] _digits; + private string _selectCommand; + private string _preChangeCommand; + private string[] _digits; #endregion Variables @@ -77,6 +73,7 @@ get { return _pauseTime; } set { _pauseTime = value; } } + /// <summary> /// Gets or sets a value indicating whether to send a select command. /// </summary> @@ -86,6 +83,7 @@ get { return _sendSelect; } set { _sendSelect = value; } } + /// <summary> /// Gets or sets a value indicating whether to send the select command twice. /// </summary> @@ -95,6 +93,7 @@ get { return _doubleChannelSelect; } set { _doubleChannelSelect = value; } } + /// <summary> /// Gets or sets the flag to repeat channel commands. /// </summary> @@ -104,6 +103,7 @@ get { return _repeatChannelCommands; } set { _repeatChannelCommands = value; } } + /// <summary> /// Gets or sets the channel digit count. /// </summary> @@ -113,6 +113,7 @@ get { return _channelDigits; } set { _channelDigits = value; } } + /// <summary> /// Gets or sets the pause time between repeats. /// </summary> @@ -122,6 +123,7 @@ get { return _repeatPauseTime; } set { _repeatPauseTime = value; } } + /// <summary> /// Gets or sets a value indicating whether to use a pre-change command. /// </summary> @@ -143,6 +145,7 @@ get { return _digits; } set { _digits = value; } } + /// <summary> /// Gets or sets the select command. /// </summary> @@ -152,6 +155,7 @@ get { return _selectCommand; } set { _selectCommand = value; } } + /// <summary> /// Gets or sets the pre-change command. /// </summary> @@ -161,7 +165,7 @@ get { return _preChangeCommand; } set { _preChangeCommand = value; } } - + #endregion Properties #region Constructor @@ -172,21 +176,21 @@ /// <param name="fileName">Name of the configuration file.</param> public ExternalChannelConfig(string fileName) { - _fileName = fileName; + _fileName = fileName; - _cardID = DefaultCardID; + _cardID = DefaultCardID; - _pauseTime = DefaultPauseTime; - _sendSelect = DefaultSendSelect; - _doubleChannelSelect = DefaultDoubleChannelSelect; - _repeatChannelCommands = DefaultRepeatChannelCommands; - _channelDigits = DefaultChannelDigits; - _repeatPauseTime = DefaultRepeatPauseTime; - _usePreChangeCommand = DefaultUsePreChangeCommand; + _pauseTime = DefaultPauseTime; + _sendSelect = DefaultSendSelect; + _doubleChannelSelect = DefaultDoubleChannelSelect; + _repeatChannelCommands = DefaultRepeatChannelCommands; + _channelDigits = DefaultChannelDigits; + _repeatPauseTime = DefaultRepeatPauseTime; + _usePreChangeCommand = DefaultUsePreChangeCommand; - _selectCommand = String.Empty; - _preChangeCommand = String.Empty; - _digits = new string[10]; + _selectCommand = String.Empty; + _preChangeCommand = String.Empty; + _digits = new string[10]; for (int i = 0; i < 10; i++) _digits[i] = String.Empty; @@ -203,7 +207,7 @@ { writer.Formatting = Formatting.Indented; writer.Indentation = 1; - writer.IndentChar = (char)9; + writer.IndentChar = (char) 9; writer.WriteStartDocument(true); writer.WriteStartElement("config"); // <config> @@ -226,18 +230,19 @@ } } - static string GetString(XmlDocument doc, string element, string defaultValue) + private static string GetString(XmlDocument doc, string element, string defaultValue) { if (String.IsNullOrEmpty(element)) return defaultValue; - + XmlNode node = doc.DocumentElement.SelectSingleNode(element); if (node == null) return defaultValue; return node.InnerText; } - static int GetInt(XmlDocument doc, string element, int defaultValue) + + private static int GetInt(XmlDocument doc, string element, int defaultValue) { if (String.IsNullOrEmpty(element)) return defaultValue; @@ -252,7 +257,8 @@ return defaultValue; } - static bool GetBool(XmlDocument doc, string element, bool defaultValue) + + private static bool GetBool(XmlDocument doc, string element, bool defaultValue) { if (String.IsNullOrEmpty(element)) return defaultValue; @@ -280,23 +286,21 @@ XmlDocument doc = new XmlDocument(); doc.Load(fileName); - newECC.PauseTime = GetInt(doc, "PauseTime", DefaultPauseTime); - newECC.UsePreChangeCommand = GetBool(doc, "UsePreChangeCommand", DefaultUsePreChangeCommand); - newECC.SendSelect = GetBool(doc, "SendSelect", DefaultSendSelect); - newECC.DoubleChannelSelect = GetBool(doc, "DoubleChannelSelect", DefaultDoubleChannelSelect); - newECC.RepeatChannelCommands = GetInt(doc, "RepeatChannelCommands", DefaultRepeatChannelCommands); - newECC.ChannelDigits = GetInt(doc, "ChannelDigits", DefaultChannelDigits); - newECC.RepeatPauseTime = GetInt(doc, "RepeatDelay", DefaultRepeatPauseTime); + newECC.PauseTime = GetInt(doc, "PauseTime", DefaultPauseTime); + newECC.UsePreChangeCommand = GetBool(doc, "UsePreChangeCommand", DefaultUsePreChangeCommand); + newECC.SendSelect = GetBool(doc, "SendSelect", DefaultSendSelect); + newECC.DoubleChannelSelect = GetBool(doc, "DoubleChannelSelect", DefaultDoubleChannelSelect); + newECC.RepeatChannelCommands = GetInt(doc, "RepeatChannelCommands", DefaultRepeatChannelCommands); + newECC.ChannelDigits = GetInt(doc, "ChannelDigits", DefaultChannelDigits); + newECC.RepeatPauseTime = GetInt(doc, "RepeatDelay", DefaultRepeatPauseTime); - newECC.SelectCommand = GetString(doc, "SelectCommand", String.Empty); - newECC.PreChangeCommand = GetString(doc, "PreChangeCommand", String.Empty); - + newECC.SelectCommand = GetString(doc, "SelectCommand", String.Empty); + newECC.PreChangeCommand = GetString(doc, "PreChangeCommand", String.Empty); + for (int index = 0; index < 10; index++) - newECC.Digits[index] = GetString(doc, "Digit" + index.ToString(), String.Empty); + newECC.Digits[index] = GetString(doc, "Digit" + index.ToString(), String.Empty); return newECC; } - } - -} +} \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Applications/Media Center Blaster/Forms/ExternalChannels.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Media Center Blaster/Forms/ExternalChannels.cs 2009-06-03 00:31:12 UTC (rev 2890) +++ trunk/plugins/IR Server Suite/Applications/Media Center Blaster/Forms/ExternalChannels.cs 2009-06-03 10:03:58 UTC (rev 2891) @@ -1,30 +1,21 @@ using System; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel; -#if TRACE -using System.Diagnostics; -#endif -using System.Drawing; using System.IO; -using System.Text; using System.Threading; using System.Windows.Forms; -using System.Xml; - using IrssUtils; +#if TRACE +using System.Diagnostics; +#endif namespace MediaCenterBlaster { - - partial class ExternalChannels : Form + internal partial class ExternalChannels : Form { - #region Variables - TabPage _tvCardTab; - StbSetup _tvCardStbSetup; - + private TabPage _tvCardTab; + private StbSetup _tvCardStbSetup; + #endregion Variables #region Constructor @@ -45,7 +36,7 @@ _tvCardTab = new TabPage("STB"); _tvCardTab.Controls.Add(_tvCardStbSetup); - this.tabControlTVCards.TabPages.Add(_tvCardTab); + tabControlTVCards.TabPages.Add(_tvCardTab); // Setup quick setup combo box string[] quickSetupFiles = Directory.GetFiles(Common.FolderSTB, "*.xml", SearchOption.TopDirectoryOnly); @@ -55,7 +46,8 @@ comboBoxQuickSetup.Items.Add("Clear all"); } - static void ProcessExternalChannelProgram(string runCommand, int currentChannelDigit, string fullChannelString) + private static void ProcessExternalChannelProgram(string runCommand, int currentChannelDigit, + string fullChannelString) { string[] commands = Common.SplitRunCommand(runCommand); @@ -65,7 +57,7 @@ Common.ProcessRunCommand(commands); } - static void ProcessSerialCommand(string serialCommand, int currentChannelDigit, string fullChannelString) + private static void ProcessSerialCommand(string serialCommand, int currentChannelDigit, string fullChannelString) { string[] commands = Common.SplitSerialCommand(serialCommand); @@ -86,11 +78,12 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString(), "Failed to save external channel setup", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show(ex.ToString(), "Failed to save external channel setup", MessageBoxButtons.OK, + MessageBoxIcon.Error); } - this.DialogResult = DialogResult.OK; - this.Close(); + DialogResult = DialogResult.OK; + Close(); } private void buttonTest_Click(object sender, EventArgs e) @@ -135,7 +128,7 @@ if (setup.PauseTime > 0) Thread.Sleep(setup.PauseTime); } - + foreach (char digit in channel) { charVal = digit - 48; @@ -183,18 +176,17 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString(), "Failed to quick-set external channel setup", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show(ex.ToString(), "Failed to quick-set external channel setup", MessageBoxButtons.OK, + MessageBoxIcon.Error); } } private void buttonCancel_Click(object sender, EventArgs e) { - this.DialogResult = DialogResult.Cancel; - this.Close(); + DialogResult = DialogResult.Cancel; + Close(); } #endregion Buttons - } - -} +} \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Applications/Media Center Blaster/Forms/MacroEditor.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Media Center Blaster/Forms/MacroEditor.cs 2009-06-03 00:31:12 UTC (rev 2890) +++ trunk/plugins/IR Server Suite/Applications/Media Center Blaster/Forms/MacroEditor.cs 2009-06-03 10:03:58 UTC (rev 2891) @@ -1,24 +1,19 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -#if TRACE -using System.Diagnostics; -#endif -using System.Drawing; using System.IO; using System.Text; using System.Windows.Forms; using System.Xml; - using IrssUtils; +using IrssUtils.Exceptions; using IrssUtils.Forms; +#if TRACE +using System.Diagnostics; +#endif namespace MediaCenterBlaster { - - partial class MacroEditor : Form + internal partial class MacroEditor : Form { - #region Constructor /// <summary> @@ -28,7 +23,7 @@ { InitializeComponent(); - textBoxName.Text = "New"; + textBoxName.Text = "New"; textBoxName.Enabled = true; } @@ -42,7 +37,7 @@ if (String.IsNullOrEmpty(name)) throw new ArgumentNullException("name"); - textBoxName.Text = name; + textBoxName.Text = name; textBoxName.Enabled = false; string fileName = Path.Combine(Tray.FolderMacros, name + Common.FileExtensionMacro); @@ -53,7 +48,7 @@ #region Implementation - void RefreshCommandList() + private void RefreshCommandList() { comboBoxCommands.Items.Clear(); @@ -88,7 +83,7 @@ /// Write the macro in the listBox to a macro name provided. /// </summary> /// <param name="fileName">Name of Macro to write (macro name, not file path).</param> - void WriteToFile(string fileName) + private void WriteToFile(string fileName) { try { @@ -119,7 +114,7 @@ /// Read a macro into the listBox from the macro name provided. /// </summary> /// <param name="fileName">Name of Macro to read (macro name, not file path).</param> - void ReadFromFile(string fileName) + private void ReadFromFile(string fileName) { try { @@ -214,7 +209,7 @@ if (popupMessage.ShowDialog(this) == DialogResult.OK) newCommand = Common.CmdPrefixPopup + popupMessage.CommandString; } - /* + /* else if (selected.Equals(Common.UITextWindowState, StringComparison.OrdinalIgnoreCase)) { newCommand = Common.CmdPrefixWindowState; @@ -261,7 +256,7 @@ } else { - throw new IrssUtils.Exceptions.CommandStructureException(String.Format("Unknown command in macro command list \"{0}\"", selected)); + throw new CommandStructureException(String.Format("Unknown command in macro command list \"{0}\"", selected)); } if (!String.IsNullOrEmpty(newCommand)) @@ -285,6 +280,7 @@ listBoxMacro.SelectedIndex = selected - 1; } } + private void buttonMoveDown_Click(object sender, EventArgs e) { int selected = listBoxMacro.SelectedIndex; @@ -309,14 +305,16 @@ if (name.Length == 0) { - MessageBox.Show(this, "You must supply a name for this Macro", "Name missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + MessageBox.Show(this, "You must supply a name for this Macro", "Name missing", MessageBoxButtons.OK, + MessageBoxIcon.Exclamation); textBoxName.Focus(); return; } if (!Common.IsValidFileName(name)) { - MessageBox.Show(this, "You must supply a valid name for this Macro", "Invalid name", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + MessageBox.Show(this, "You must supply a valid name for this Macro", "Invalid name", MessageBoxButtons.OK, + MessageBoxIcon.Exclamation); textBoxName.Focus(); return; } @@ -337,8 +335,8 @@ private void buttonCancel_Click(object sender, EventArgs e) { - this.DialogResult = DialogResult.Cancel; - this.Close(); + DialogResult = DialogResult.Cancel; + Close(); } private void buttonOK_Click(object sender, EventArgs e) @@ -347,14 +345,16 @@ if (name.Length == 0) { - MessageBox.Show(this, "You must supply a name for this Macro", "Name missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + MessageBox.Show(this, "You must supply a name for this Macro", "Name missing", MessageBoxButtons.OK, + MessageBoxIcon.Exclamation); textBoxName.Focus(); return; } if (!Common.IsValidFileName(name)) { - MessageBox.Show(this, "You must supply a valid name for this Macro", "Invalid name", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + MessageBox.Show(this, "You must supply a valid name for this Macro", "Invalid name", MessageBoxButtons.OK, + MessageBoxIcon.Exclamation); textBoxName.Focus(); return; } @@ -370,8 +370,8 @@ MessageBox.Show(this, ex.Message, "Failed writing macro to file", MessageBoxButtons.OK, MessageBoxIcon.Error); } - this.DialogResult = DialogResult.OK; - this.Close(); + DialogResult = DialogResult.OK; + Close(); } private void listBoxCommandSequence_DoubleClick(object sender, EventArgs e) @@ -425,7 +425,7 @@ else if (selected.StartsWith(Common.CmdPrefixHttpMsg, StringComparison.OrdinalIgnoreCase)) { string[] commands = Common.SplitHttpMessageCommand(selected.Substring(Common.CmdPrefixHttpMsg.Length)); - + HttpMessageCommand httpMessageCommand = new HttpMessageCommand(commands); if (httpMessageCommand.ShowDialog(this) == DialogResult.OK) newCommand = Common.CmdPrefixHttpMsg + httpMessageCommand.CommandString; @@ -486,7 +486,5 @@ } #endregion Implementation - } - -} +} \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Applications/Media Center Blaster/Forms/SetupForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Media Center Blaster/Forms/SetupForm.cs 2009-06-03 00:31:12 UTC (rev 2890) +++ trunk/plugins/IR Server Suite/Applications/Media Center Blaster/Forms/SetupForm.cs 2009-06-03 10:03:58 UTC (rev 2891) @@ -1,27 +1,18 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; using System.IO; using System.Net; -using System.Text; -using System.Threading; using System.Windows.Forms; -using System.Xml; - using IrssComms; using IrssUtils; using IrssUtils.Forms; namespace MediaCenterBlaster { - - partial class SetupForm : Form + internal partial class SetupForm : Form { - #region Variables - LearnIR _learnIR; + private LearnIR _learnIR; #endregion Variables @@ -33,7 +24,7 @@ } #endregion Constructor - + private void SetupForm_Load(object sender, EventArgs e) { RefreshIRList(); @@ -49,7 +40,7 @@ #region Local Methods - void ReceivedMessage(IrssMessage received) + private void ReceivedMessage(IrssMessage received) { if (_learnIR != null && received.Type == MessageType.LearnIR) { @@ -68,7 +59,7 @@ } } - void RefreshIRList() + private void RefreshIRList() { listViewIR.Items.Clear(); @@ -77,7 +68,8 @@ foreach (string irFile in irList) listViewIR.Items.Add(irFile); } - void RefreshMacroList() + + private void RefreshMacroList() { listViewMacro.Items.Clear(); @@ -87,7 +79,7 @@ listViewMacro.Items.Add(macroFile); } - void EditIR() + private void EditIR() { if (listViewIR.SelectedItems.Count != 1) return; @@ -122,7 +114,8 @@ MessageBox.Show(this, ex.Message, "Failed to edit IR file", MessageBoxButtons.OK, MessageBoxIcon.Error); } } - void EditMacro() + + private void EditMacro() { if (listViewMacro.SelectedItems.Count != 1) return; @@ -182,10 +175,12 @@ RefreshIRList(); } + private void buttonEditIR_Click(object sender, EventArgs e) { EditIR(); } + private void buttonDeleteIR_Click(object sender, EventArgs e) { if (listViewIR.SelectedItems.Count != 1) @@ -195,12 +190,15 @@ string fileName = Path.Combine(Common.FolderIRCommands, file + Common.FileExtensionIR); if (File.Exists(fileName)) { - if (MessageBox.Show(this, String.Format("Are you sure you want to delete \"{0}\"?", file), "Confirm delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) + if ( + MessageBox.Show(this, String.Format("Are you sure you want to delete \"{0}\"?", file), "Confirm delete", + MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) File.Delete(fileName); } else { - MessageBox.Show(this, "File not found: " + fileName, "IR file missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + MessageBox.Show(this, "File not found: " + fileName, "IR file missing", MessageBoxButtons.OK, + MessageBoxIcon.Exclamation); } RefreshIRList(); @@ -213,10 +211,12 @@ RefreshMacroList(); } + private void buttonEditMacro_Click(object sender, EventArgs e) { EditMacro(); } + private void buttonDeleteMacro_Click(object sender, EventArgs e) { if (listViewMacro.SelectedItems.Count != 1) @@ -226,16 +226,20 @@ string fileName = Path.Combine(Tray.FolderMacros, file + Common.FileExtensionMacro); if (File.Exists(fileName)) { - if (MessageBox.Show(this, String.Format("Are you sure you want to delete \"{0}\"?", file), "Confirm delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) + if ( + MessageBox.Show(this, String.Format("Are you sure you want to delete \"{0}\"?", file), "Confirm delete", + MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) File.Delete(fileName); } else { - MessageBox.Show(this, "File not found: " + fileName, "Macro file missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + MessageBox.Show(this, "File not found: " + fileName, "Macro file missing", MessageBoxButtons.OK, + MessageBoxIcon.Exclamation); } RefreshMacroList(); } + private void buttonTestMacro_Click(object sender, EventArgs e) { if (listViewMacro.SelectedItems.Count != 1) @@ -251,17 +255,19 @@ MessageBox.Show(this, ex.Message, "Test failed", MessageBoxButtons.OK, MessageBoxIcon.Error); } } + private void buttonOK_Click(object sender, EventArgs e) { Tray.LogVerbose = checkBoxLogVerbose.Checked; - - this.DialogResult = DialogResult.OK; - this.Close(); + + DialogResult = DialogResult.OK; + Close(); } + private void buttonCancel_Click(object sender, EventArgs e) { - this.DialogResult = DialogResult.Cancel; - this.Close(); + DialogResult = DialogResult.Cancel; + Close(); } private void buttonChangeServer_Click(object sender, EventArgs e) @@ -274,7 +280,7 @@ Tray.ServerHost = serverAddress.ServerHost; IPAddress serverIP = Client.GetIPFromName(Tray.ServerHost); - IPEndPoint endPoint = new IPEndPoint(serverIP, IrssComms.Server.DefaultPort); + IPEndPoint endPoint = new IPEndPoint(serverIP, Server.DefaultPort); Tray.StartClient(endPoint); } @@ -293,6 +299,7 @@ { EditIR(); } + private void listViewMacro_DoubleClick(object sender, EventArgs e) { EditMacro(); @@ -318,7 +325,8 @@ string oldFileName = Path.Combine(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); + MessageBox.Show("File not found: " + oldFileName, "Cannot rename, Original file not found", MessageBoxButtons.OK, + MessageBoxIcon.Error); e.CancelEdit = true; return; } @@ -327,7 +335,8 @@ if (!Common.IsValidFileName(name)) { - MessageBox.Show("File name not valid: " + name, "Cannot rename, New file name not valid", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show("File name not valid: " + name, "Cannot rename, New file name not valid", MessageBoxButtons.OK, + MessageBoxIcon.Error); e.CancelEdit = true; return; } @@ -344,6 +353,7 @@ MessageBox.Show(ex.Message, "Failed to rename file", MessageBoxButtons.OK, MessageBoxIcon.Error); } } + private void listViewMacro_AfterLabelEdit(object sender, LabelEditEventArgs e) { ListView origin = sender as ListView; @@ -364,7 +374,8 @@ string oldFileName = Path.Combine(Tray.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); + MessageBox.Show("File not found: " + oldFileName, "Cannot rename, Original file not found", MessageBoxButtons.OK, + MessageBoxIcon.Error); e.CancelEdit = true; return; } @@ -373,7 +384,8 @@ if (!Common.IsValidFileName(name)) { - MessageBox.Show("File name not valid: " + name, "Cannot rename, New file name not valid", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show("File name not valid: " + name, "Cannot rename, New file name not valid", MessageBoxButtons.OK, + MessageBoxIcon.Error); e.CancelEdit = true; return; } @@ -397,11 +409,8 @@ SystemRegistry.SetAutoRun("Media Center Blaster", Application.ExecutablePath); else SystemRegistry.RemoveAutoRun("Media Center Blaster"); - } #endregion Other Controls - } - -} +} \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Applications/Media Center Blaster/Forms/StbSetup.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Media Center Blaster/Forms/StbSetup.cs 2009-06-03 00:31:12 UTC (rev 2890) +++ trunk/plugins/IR Server Suite/Applications/Media Center Blaster/Forms/StbSetup.cs 2009-06-03 10:03:58 UTC (rev 2891) @@ -1,32 +1,26 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; using System.IO; -using System.Text; using System.Windows.Forms; using System.Xml; - using IrssUtils; +using IrssUtils.Exceptions; using IrssUtils.Forms; namespace MediaCenterBlaster { - - partial class StbSetup : UserControl + internal partial class StbSetup : UserControl { - #region Constants - const string ParameterInfo = -@"%1 = Current channel number digit (-1 for Select/Pre-Change) + private const string ParameterInfo = + @"%1 = Current channel number digit (-1 for Select/Pre-Change) %2 = Full channel number string"; #endregion Constants #region Variables - int _cardId; + private readonly int _cardId; #endregion Variables @@ -41,18 +35,22 @@ { get { return Decimal.ToInt32(numericUpDownPauseTime.Value); } } + public bool SendSelect { get { return checkBoxSendSelect.Checked; } } + public bool DoubleChannelSelect { get { return checkBoxDoubleSelect.Checked; } } + public int RepeatChannelCommands { get { return Decimal.ToInt32(numericUpDownRepeat.Value); } } + public int ChannelDigits { get @@ -63,10 +61,12 @@ return chDigits; } } + public int RepeatPauseTime { get { return Decimal.ToInt32(numericUpDownRepeatDelay.Value); } } + public bool UsePreChangeCommand { get { return checkBoxUsePreChange.Checked; } @@ -79,13 +79,15 @@ string[] _digits = new string[10]; for (int i = 0; i < 10; i++) _digits[i] = listViewExternalCommands.Items[i].SubItems[1].Text; - return _digits; + return _digits; } } + public string SelectCommand { get { return listViewExternalCommands.Items[10].SubItems[1].Text; } } + public string PreChangeCommand { get { return listViewExternalCommands.Items[11].SubItems[1].Text; } @@ -151,26 +153,26 @@ // Setup command list. for (int i = 0; i < 10; i++) - listViewExternalCommands.Items[i].SubItems[1].Text = config.Digits[i]; + listViewExternalCommands.Items[i].SubItems[1].Text = config.Digits[i]; - listViewExternalCommands.Items[10].SubItems[1].Text = config.SelectCommand; - listViewExternalCommands.Items[11].SubItems[1].Text = config.PreChangeCommand; + listViewExternalCommands.Items[10].SubItems[1].Text = config.SelectCommand; + listViewExternalCommands.Items[11].SubItems[1].Text = config.PreChangeCommand; // Setup options. - numericUpDownPauseTime.Value = config.PauseTime; - checkBoxSendSelect.Checked = config.SendSelect; - checkBoxDoubleSelect.Checked = config.DoubleChannelSelect; - numericUpDownRepeat.Value = config.RepeatChannelCommands; + numericUpDownPauseTime.Value = config.PauseTime; + checkBoxSendSelect.Checked = config.SendSelect; + checkBoxDoubleSelect.Checked = config.DoubleChannelSelect; + numericUpDownRepeat.Value = config.RepeatChannelCommands; - checkBoxDoubleSelect.Enabled = checkBoxSendSelect.Checked; + checkBoxDoubleSelect.Enabled = checkBoxSendSelect.Checked; int channelDigitsSelect = config.ChannelDigits; if (channelDigitsSelect > 0) channelDigitsSelect--; - comboBoxChDigits.SelectedIndex = channelDigitsSelect; + comboBoxChDigits.SelectedIndex = channelDigitsSelect; - checkBoxUsePreChange.Checked = config.UsePreChangeCommand; - numericUpDownRepeatDelay.Value = new Decimal(config.RepeatPauseTime); + checkBoxUsePreChange.Checked = config.UsePreChangeCommand; + numericUpDownRepeatDelay.Value = new Decimal(config.RepeatPauseTime); } public void SetToConfig() @@ -226,11 +228,11 @@ for (int i = 0; i < 12; i++) { if (i == 10) - command = IrssUtils.XML.GetString(nodeList, "SelectCommand", String.Empty); + command = XML.GetString(nodeList, "SelectCommand", String.Empty); else if (i == 11) - command = IrssUtils.XML.GetString(nodeList, "PreChangeCommand", String.Empty); + command = XML.GetString(nodeList, "PreChangeCommand", String.Empty); else - command = IrssUtils.XML.GetString(nodeList, String.Format("Digit{0}", i), String.Empty); + command = XML.GetString(nodeList, String.Format("Digit{0}", i), String.Empty); if (command.StartsWith(Common.CmdPrefixSTB, StringComparison.OrdinalIgnoreCase)) blastCommandCount++; @@ -239,11 +241,11 @@ for (int i = 0; i < 12; i++) { if (i == 10) - command = IrssUtils.XML.GetString(nodeList, "SelectCommand", String.Empty); + command = XML.GetString(nodeList, "SelectCommand", String.Empty); else if (i == 11) - command = IrssUtils.XML.GetString(nodeList, "PreChangeCommand", String.Empty); + command = XML.GetString(nodeList, "PreChangeCommand", String.Empty); else - command = IrssUtils.XML.GetString(nodeList, String.Format("Digit{0}", i), String.Empty); + command = XML.GetString(nodeList, String.Format("Digit{0}", i), String.Empty); if (command.StartsWith(Common.CmdPrefixSTB, StringComparison.OrdinalIgnoreCase)) { @@ -288,17 +290,20 @@ } } - numericUpDownPauseTime.Value = new Decimal(IrssUtils.XML.GetInt(nodeList, "PauseTime", Decimal.ToInt32(numericUpDownPauseTime.Value))); - checkBoxUsePreChange.Checked = IrssUtils.XML.GetBool(nodeList, "UsePreChangeCommand", checkBoxUsePreChange.Checked); - checkBoxSendSelect.Checked = IrssUtils.XML.GetBool(nodeList, "SendSelect", checkBoxSendSelect.Checked); - checkBoxDoubleSelect.Checked = IrssUtils.XML.GetBool(nodeList, "DoubleChannelSelect", checkBoxDoubleSelect.Checked); - numericUpDownRepeat.Value = new Decimal(IrssUtils.XML.GetInt(nodeList, "RepeatChannelCommands", Decimal.ToInt32(numericUpDownRepeat.Value))); - numericUpDownRepeatDelay.Value = new Decimal(IrssUtils.XML.GetInt(nodeList, "RepeatDelay", Decimal.ToInt32(numericUpDownRepeatDelay.Value))); + numericUpDownPauseTime.Value = + new Decimal(XML.GetInt(nodeList, "PauseTime", Decimal.ToInt32(numericUpDownPauseTime.Value))); + checkBoxUsePreChange.Checked = XML.GetBool(nodeList, "UsePreChangeCommand", checkBoxUsePreChange.Checked); + checkBoxSendSelect.Checked = XML.GetBool(nodeList, "SendSelect", checkBoxSendSelect.Checked); + checkBoxDoubleSelect.Checked = XML.GetBool(nodeList, "DoubleChannelSelect", checkBoxDoubleSelect.Checked); + numericUpDownRepeat.Value = + new Decimal(XML.GetInt(nodeList, "RepeatChannelCommands", Decimal.ToInt32(numericUpDownRepeat.Value))); + numericUpDownRepeatDelay.Value = + new Decimal(XML.GetInt(nodeList, "RepeatDelay", Decimal.ToInt32(numericUpDownRepeatDelay.Value))); int digitsWas = comboBoxChDigits.SelectedIndex; if (digitsWas > 0) digitsWas--; - int digits = IrssUtils.XML.GetInt(nodeList, "ChannelDigits", digitsWas); + int digits = XML.GetInt(nodeList, "ChannelDigits", digitsWas); if (digits > 0) digits++; comboBoxChDigits.SelectedIndex = digits; @@ -364,7 +369,7 @@ else if (selected.StartsWith(Common.CmdPrefixRun, StringComparison.OrdinalIgnoreCase)) { string[] commands = Common.SplitRunCommand(selected.Substring(Common.CmdPrefixRun.Length)); - + ExternalProgram executeProgram = new ExternalProgram(commands, ParameterInfo); if (executeProgram.ShowDialog(this) == DialogResult.OK) newCommand = Common.CmdPrefixRun + executeProgram.CommandString; @@ -372,7 +377,7 @@ else if (selected.StartsWith(Common.CmdPrefixSerial, StringComparison.OrdinalIgnoreCase)) { string[] commands = Common.SplitSerialCommand(selected.Substring(Common.CmdPrefixSerial.Length)); - + SerialCommand serialCommand = new SerialCommand(commands, ParameterInfo); if (serialCommand.ShowDialog(this) == DialogResult.OK) newCommand = Common.CmdPrefixSerial + serialCommand.CommandString; @@ -380,7 +385,7 @@ else if (selected.StartsWith(Common.CmdPrefixWindowMsg, StringComparison.OrdinalIgnoreCase)) { string[] commands = Common.SplitWindowMessageCommand(selected.Substring(Common.CmdPrefixWindowMsg.Length)); - + MessageCommand messageCommand = new MessageCommand(commands); if (messageCommand.ShowDialog(this) == DialogResult.OK) newCommand = Common.CmdPrefixWindowMsg + messageCommand.CommandString; @@ -404,7 +409,7 @@ else if (selected.StartsWith(Common.CmdPrefixKeys, StringComparison.OrdinalIgnoreCase)) { KeysCommand keysCommand = new KeysCommand(selected.Substring(Common.CmdPrefixKeys.Length)); - + if (keysCommand.ShowDialog(this) == DialogResult.OK) newCommand = Common.CmdPrefixKeys + keysCommand.CommandString; } @@ -496,7 +501,7 @@ } else { - throw new IrssUtils.Exceptions.CommandStructureException(String.Format("Invalid command in STB Setup: {0}", selected)); + throw new CommandStructureException(String.Format("Invalid command in STB Setup: {0}", selected)); } if (!String.IsNullOrEmpty(newCommand)) @@ -511,7 +516,5 @@ } #endregion Private Methods - } - -} +} \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Applications/Media Center Blaster/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Media Center Blaster/Program.cs 2009-06-03 00:31:12 UTC (rev 2890) +++ trunk/plugins/IR Server Suite/Applications/Media Center Blaster/Program.cs 2009-06-03 10:03:58 UTC (rev 2891) @@ -2,20 +2,17 @@ using System.Diagnostics; using System.Threading; using System.Windows.Forms; - using IrssUtils; namespace MediaCenterBlaster { - - static class Program + internal static class Program { - /// <summary> /// The main entry point for the application. /// </summary> [STAThread] - static void Main() + private static void Main() { // Check for multiple instances. if (Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName).Length != 1) @@ -52,7 +49,5 @@ { IrssLog.Error(e.Exception); } - } - -} +} \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Applications/Media Center Blaster/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Media Center Blaster/Properties/AssemblyInfo.cs 2009-06-03 00:31:12 UTC (rev 2890) +++ trunk/plugins/IR Server Suite/Applications/Media Center Blaster/Properties/AssemblyInfo.cs 2009-06-03 10:03:58 UTC (rev 2891) @@ -1,14 +1,14 @@ using System; using System.Reflection; -using System.Runtime.CompilerServices; +using System.Resources; using System.Runtime.InteropServices; -using System.Resources; // // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. // + [assembly: AssemblyTitle("Media Center Blaster")] [assembly: AssemblyDescription("Runs in the system tray and listens to Media Center events")] [assembly: AssemblyConfiguration("")] @@ -21,6 +21,7 @@ // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. + [assembly: ComVisible(false)] // @@ -36,7 +37,6 @@ [assembly: AssemblyVersion("1.4.2.0")] [assembly: AssemblyFileVersion("1.4.2.0")] - [assembly: CLSCompliant(true)] [assembly: Guid("38C3CDEB-6E99-4c35-BA19-504DA8C7C7E8")] -[assembly: NeutralResourcesLanguageAttribute("en")] +[assembly: NeutralResourcesLanguage("en")] \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Applications/Media Center Blaster/Tray.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Media Center Blaster/Tray.cs 2009-06-03 00:31:12 UTC (rev 2890) +++ trunk/plugins/IR Server Suite/Applications/Media Center Blaster/Tray.cs 2009-06-03 10:03:58 UTC (rev 2891) @@ -1,63 +1,59 @@ using System; using System.ComponentModel; -using System.Diagnostics; using System.Drawing; using System.IO; using System.Net; -using System.Net.Sockets; using System.Text; using System.Threading; using System.Windows.Forms; using System.Xml; - -using Microsoft.MediaCenter.Samples.MediaState; - using IrssComms; using IrssUtils; +using IrssUtils.Forms; +using Microsoft.MediaCenter.Samples.MediaState; namespace MediaCenterBlaster { - /// <summary> /// Media Center Blaster main class. /// </summary> - class Tray + internal class Tray { - #region Constants - static readonly string ConfigurationFile = Path.Combine(Common.FolderAppData, "Media Center Blaster\\Media Center Blaster.xml"); + private static readonly string ConfigurationFile = Path.Combine(Common.FolderAppData, + "Media Center Blaster\\Media Center Blaster.xml"); internal static readonly string FolderMacros = Path.Combine(Common.FolderAppData, "Media Center Blaster\\Macro"); internal static readonly string ExtCfgFolder = Path.Combine(Common.FolderAppData, "Media Center Blaster"); - const string ProcessCommandThreadName = "ProcessCommand"; + private const string ProcessCommandThreadName = "ProcessCommand"; #endregion Constants #region Variables - static ClientMessageSink _handleMessage; + private static ClientMessageSink _handleMessage; - static Client _client; + private static Client _client; - static bool _registered; + private static bool _registered; - static string _serverHost; - static bool _autoRun; - static bool _logVerbose; + private static string _serverHost; + private static bool _autoRun; + private static bool _logVerbose; - static ExternalChannelConfig _externalChannelConfig; + private static ExternalChannelConfig _externalChannelConfig; - static bool _inConfiguration; - static string _learnIRFilename; + private static bool _inConfiguration; + private static string _learnIRFilename; - static IRServerInfo _irServerInfo = new IRServerInfo(); + private static IRServerInfo _irServerInfo = new IRServerInfo(); - static Container _container; - static NotifyIcon _notifyIcon; - static MediaState _mediaState; + private static Container _container; + private static NotifyIcon _notifyIcon; + private static MediaState _mediaState; #endregion Variables @@ -147,22 +143,22 @@ #region Implementation - void OnMSASEvent(object state, MediaStatusEventArgs args) + private void OnMSASEvent(object state, MediaStatusEventArgs args) { //MediaState typedState = (MediaState)state; IrssLog.Info("OnMSASEvent: {0} {1} {2} {3}", args.Session, args.SessionID, args.Tag, args.Value); } - void TV_MediaChanged(object sender, EventArgs e) + private void TV_MediaChanged(object sender, EventArgs e) { IrssLog.Info("TV_MediaChanged"); - MediaStatusEventArgs mediaStatusEventArgs = (MediaStatusEventArgs)e; + MediaStatusEventArgs mediaStatusEventArgs = (MediaStatusEventArgs) e; // MSPROPTAG_TrackNumber IrssLog.Info("Channel: {0}", mediaStatusEventArgs.Value); - + /* if (_externalChannelConfig == null) throw new ApplicationException("Cannot process tune request, no STB settings are loaded"); @@ -182,7 +178,7 @@ } - static void UpdateTrayIcon(string text, Icon icon) + private static void UpdateTrayIcon(string text, Icon icon) { if (String.IsNullOrEmpty(text)) throw new ArgumentNullException("text"); @@ -213,14 +209,15 @@ try { IPAddress serverIP = Client.GetIPFromName(_serverHost); - IPEndPoint endPoint = new IPEndPoint(serverIP, IrssComms.Server.DefaultPort); + IPEndPoint endPoint = new IPEndPoint(serverIP, Server.DefaultPort); clientStarted = StartClient(endPoint); } catch (Exception ex) { IrssLog.Error(ex); - MessageBox.Show("Failed to start IR Server communications, refer to log file for more details.", "Media Center Blaster - Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show("Failed to start IR Server communications, refer to log file for more details.", + "Media Center Blaster - Error", MessageBoxButtons.OK, MessageBoxIcon.Error); clientStarted = false; } @@ -251,7 +248,7 @@ return false; } - void Stop() + private void Stop() { _notifyIcon.Visible = false; @@ -265,8 +262,10 @@ _client.Send(message); } } - catch { } - + catch + { + } + StopClient(); if (_mediaState != null) @@ -276,7 +275,7 @@ } } - void LoadSettings() + private void LoadSettings() { try { @@ -310,7 +309,8 @@ CreateDefaultSettings(); } } - void SaveSettings() + + private void SaveSettings() { try { @@ -330,7 +330,7 @@ { writer.Formatting = Formatting.Indented; writer.Indentation = 1; - writer.IndentChar = (char)9; + writer.IndentChar = (char) 9; writer.WriteStartDocument(true); writer.WriteStartElement("settings"); // <settings> @@ -346,7 +346,8 @@ IrssLog.Error(ex); } } - void CreateDefaultSettings() + + private void CreateDefaultSettings() { _serverHost = "localhost"; _logVerbose = true; @@ -357,7 +358,7 @@ /// <summary> /// Load external channel configuration. /// </summary> - static void LoadExternalConfig() + private static void LoadExternalConfig() { string fileName = Path.Combine(ExtCfgFolder, "ExternalChannelConfig.xml"); @@ -3... [truncated message content] |