From: <an...@us...> - 2007-01-30 02:51:50
|
Revision: 50 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=50&view=rev Author: and-81 Date: 2007-01-29 18:51:49 -0800 (Mon, 29 Jan 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/MCEReplacement/MCEReplacement.csproj trunk/plugins/MCEReplacement/MceIrApi.cs trunk/plugins/MCEReplacement/Win32.cs Added Paths: ----------- trunk/plugins/MCEReplacement/Forms/ trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs trunk/plugins/MCEReplacement/Forms/ExternalChannels.designer.cs trunk/plugins/MCEReplacement/Forms/ExternalChannels.resx trunk/plugins/MCEReplacement/Forms/ExternalProgram.Designer.cs trunk/plugins/MCEReplacement/Forms/ExternalProgram.cs trunk/plugins/MCEReplacement/Forms/ExternalProgram.resx trunk/plugins/MCEReplacement/Forms/GoToScreen.Designer.cs trunk/plugins/MCEReplacement/Forms/GoToScreen.cs trunk/plugins/MCEReplacement/Forms/GoToScreen.resx trunk/plugins/MCEReplacement/Forms/KeysCommand.Designer.cs trunk/plugins/MCEReplacement/Forms/KeysCommand.cs trunk/plugins/MCEReplacement/Forms/KeysCommand.resx trunk/plugins/MCEReplacement/Forms/LearnIR.Designer.cs trunk/plugins/MCEReplacement/Forms/LearnIR.cs trunk/plugins/MCEReplacement/Forms/LearnIR.resx trunk/plugins/MCEReplacement/Forms/MacroEditor.Designer.cs trunk/plugins/MCEReplacement/Forms/MacroEditor.cs trunk/plugins/MCEReplacement/Forms/MacroEditor.resx trunk/plugins/MCEReplacement/Forms/MessageCommand.Designer.cs trunk/plugins/MCEReplacement/Forms/MessageCommand.cs trunk/plugins/MCEReplacement/Forms/MessageCommand.resx trunk/plugins/MCEReplacement/Forms/MultiMapNameBox.Designer.cs trunk/plugins/MCEReplacement/Forms/MultiMapNameBox.cs trunk/plugins/MCEReplacement/Forms/MultiMapNameBox.resx trunk/plugins/MCEReplacement/Forms/PauseTime.Designer.cs trunk/plugins/MCEReplacement/Forms/PauseTime.cs trunk/plugins/MCEReplacement/Forms/PauseTime.resx trunk/plugins/MCEReplacement/Forms/PopupMessage.Designer.cs trunk/plugins/MCEReplacement/Forms/PopupMessage.cs trunk/plugins/MCEReplacement/Forms/PopupMessage.resx trunk/plugins/MCEReplacement/Forms/SelectBlasterPort.Designer.cs trunk/plugins/MCEReplacement/Forms/SelectBlasterPort.cs trunk/plugins/MCEReplacement/Forms/SelectBlasterPort.resx trunk/plugins/MCEReplacement/Forms/SelectBlasterSpeed.Designer.cs trunk/plugins/MCEReplacement/Forms/SelectBlasterSpeed.cs trunk/plugins/MCEReplacement/Forms/SelectBlasterSpeed.resx trunk/plugins/MCEReplacement/Forms/SerialCommand.Designer.cs trunk/plugins/MCEReplacement/Forms/SerialCommand.cs trunk/plugins/MCEReplacement/Forms/SerialCommand.resx trunk/plugins/MCEReplacement/Forms/SetupForm.Designer.cs trunk/plugins/MCEReplacement/Forms/SetupForm.cs trunk/plugins/MCEReplacement/Forms/SetupForm.resx trunk/plugins/MCEReplacement/Forms/StbSetup.Designer.cs trunk/plugins/MCEReplacement/Forms/StbSetup.cs trunk/plugins/MCEReplacement/Forms/StbSetup.resx Removed Paths: ------------- trunk/plugins/MCEReplacement/Configuration/ Added: trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs (rev 0) +++ trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs 2007-01-30 02:51:49 UTC (rev 50) @@ -0,0 +1,245 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Diagnostics; +using System.Drawing; +using System.IO; +using System.Text; +using System.Threading; +using System.Windows.Forms; +using System.Xml; + +using MediaPortal.GUI.Library; +using MediaPortal.Util; + +namespace MediaPortal.Plugins +{ + + public partial class ExternalChannels : Form + { + + #region Variables + + TabPage[] _tvCardTabs; + StbSetup[] _tvCardStbSetups; + + #endregion Variables + + #region Constructor + + public ExternalChannels() + { + InitializeComponent(); + } + + #endregion Constructor + + private void ExternalChannels_Load(object sender, EventArgs e) + { + int cards = MCEReplacement.ExternalChannelConfigs.Length; + string cardName; + string cardNumber; + + _tvCardTabs = new TabPage[cards]; + _tvCardStbSetups = new StbSetup[cards]; + + comboBoxCopyFrom.Items.Clear(); + + for (int index = 0; index < cards; index++) + { + cardNumber = (index + 1).ToString(); + cardName = "TV Card " + cardNumber; + + comboBoxCopyFrom.Items.Add(cardName); + + _tvCardStbSetups[index] = new StbSetup(index); + _tvCardStbSetups[index].Name = "StbSetup" + cardNumber; + _tvCardStbSetups[index].Dock = DockStyle.Fill; + _tvCardStbSetups[index].TabIndex = 0; + + _tvCardTabs[index] = new TabPage(cardName); + _tvCardTabs[index].Controls.Add(_tvCardStbSetups[index]); + + this.tabControlTVCards.TabPages.Add(_tvCardTabs[index]); + } + + comboBoxCopyFrom.SelectedIndex = 0; + + // Setup quick setup combo box + string[] quickSetupFiles = Directory.GetFiles(MCEReplacement.AppDataFolder + MCEReplacement.STBFolder, "*.xml", SearchOption.TopDirectoryOnly); + foreach (string file in quickSetupFiles) + comboBoxQuickSetup.Items.Add(Path.GetFileNameWithoutExtension(file)); + + comboBoxQuickSetup.Items.Add("Clear all"); + } + + static bool ProcessExternalChannelProgram(string runCommand, int currentChannelDigit, string fullChannelString, MceIrApi.BlasterPort blasterPort) + { + string[] commands = MCEReplacement.SplitRunCommand(runCommand); + + if (commands == null) + return false; + + commands[2] = commands[2].Replace("%1", currentChannelDigit.ToString()); + commands[2] = commands[2].Replace("%2", fullChannelString); + commands[2] = commands[2].Replace("%3", ((int)blasterPort).ToString()); + + return MCEReplacement.ProcessRunCommand(commands); + } + + static bool ProcessSerialCommand(string serialCommand, int currentChannelDigit, string fullChannelString, MceIrApi.BlasterPort blasterPort) + { + string[] commands = MCEReplacement.SplitSerialCommand(serialCommand); + + if (commands == null) + return false; + + commands[0] = commands[0].Replace("%1", currentChannelDigit.ToString()); + commands[0] = commands[0].Replace("%2", fullChannelString); + commands[0] = commands[0].Replace("%3", ((int)blasterPort).ToString()); + + return MCEReplacement.ProcessSerialCommand(commands); + + } + + #region Buttons + + private void buttonOK_Click(object sender, EventArgs e) + { + foreach (StbSetup setup in _tvCardStbSetups) + setup.Save(); + + foreach (ExternalChannelConfig config in MCEReplacement.ExternalChannelConfigs) + config.SaveExternalChannelConfig(); + + this.DialogResult = DialogResult.OK; + this.Close(); + } + + private void buttonTest_Click(object sender, EventArgs e) + { + StbSetup setup = _tvCardStbSetups[tabControlTVCards.SelectedIndex]; + + int channelTest = Decimal.ToInt32(numericUpDownTest.Value); + string channel; + switch (setup.ChannelDigits) + { + case 2: + channel = channelTest.ToString("00"); + break; + + case 3: + channel = channelTest.ToString("000"); + break; + + case 4: + channel = channelTest.ToString("0000"); + break; + + default: + channel = channelTest.ToString(); + break; + } + + try + { + int charVal; + string command; + + for (int repeatCount = 0; repeatCount <= setup.RepeatChannelCommands; repeatCount++) + { + if (repeatCount > 0 && setup.RepeatPauseTime > 0) + Thread.Sleep(setup.RepeatPauseTime); + + if (setup.UsePreChangeCommand && !String.IsNullOrEmpty(setup.PreChangeCommand)) + { + if (setup.PreChangeCommand.StartsWith(MCEReplacement.RunCommandPrefix)) + ProcessExternalChannelProgram(setup.PreChangeCommand.Substring(MCEReplacement.RunCommandPrefix.Length), -1, channel, setup.ExtBlastPort); + else if (setup.PreChangeCommand.StartsWith(MCEReplacement.SerialCommandPrefix)) + ProcessSerialCommand(setup.PreChangeCommand.Substring(MCEReplacement.SerialCommandPrefix.Length), -1, channel, setup.ExtBlastPort); + else + MCEReplacement.ProcessCommand(setup.PreChangeCommand, setup.ExtBlastPort, setup.ExtBlastSpeed); + + if (setup.PauseTime > 0) + Thread.Sleep(setup.PauseTime); + } + + foreach (char digit in channel) + { + charVal = digit - 48; + + command = setup.Digits[charVal]; + if (!String.IsNullOrEmpty(command)) + { + if (command.StartsWith(MCEReplacement.RunCommandPrefix)) + ProcessExternalChannelProgram(command.Substring(MCEReplacement.RunCommandPrefix.Length), charVal, channel, setup.ExtBlastPort); + else if (command.StartsWith(MCEReplacement.SerialCommandPrefix)) + ProcessSerialCommand(command.Substring(MCEReplacement.SerialCommandPrefix.Length), charVal, channel, setup.ExtBlastPort); + else + MCEReplacement.ProcessCommand(command, setup.ExtBlastPort, setup.ExtBlastSpeed); + + if (setup.PauseTime > 0) + Thread.Sleep(setup.PauseTime); + } + } + + if (setup.SendSelect && !String.IsNullOrEmpty(setup.SelectCommand)) + { + if (setup.SelectCommand.StartsWith(MCEReplacement.RunCommandPrefix)) + { + ProcessExternalChannelProgram(setup.SelectCommand.Substring(MCEReplacement.RunCommandPrefix.Length), -1, channel, setup.ExtBlastPort); + + if (setup.DoubleChannelSelect) + ProcessExternalChannelProgram(setup.SelectCommand.Substring(MCEReplacement.RunCommandPrefix.Length), -1, channel, setup.ExtBlastPort); + } + else if (setup.SelectCommand.StartsWith(MCEReplacement.SerialCommandPrefix)) + { + ProcessSerialCommand(setup.SelectCommand.Substring(MCEReplacement.SerialCommandPrefix.Length), -1, channel, setup.ExtBlastPort); + + if (setup.DoubleChannelSelect) + ProcessSerialCommand(setup.SelectCommand.Substring(MCEReplacement.SerialCommandPrefix.Length), -1, channel, setup.ExtBlastPort); + } + else + { + MCEReplacement.ProcessCommand(setup.SelectCommand, setup.ExtBlastPort, setup.ExtBlastSpeed); + + if (setup.DoubleChannelSelect) + MCEReplacement.ProcessCommand(setup.SelectCommand, setup.ExtBlastPort, setup.ExtBlastSpeed); + } + } + } + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Failed to test external channel", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void buttonQuickSet_Click(object sender, EventArgs e) + { + string quickSetup = comboBoxQuickSetup.Text; + + if (quickSetup.Length == 0) + return; + + _tvCardStbSetups[tabControlTVCards.SelectedIndex].SetToXml(quickSetup); + } + + private void buttonCopyFrom_Click(object sender, EventArgs e) + { + _tvCardStbSetups[tabControlTVCards.SelectedIndex].SetToCard(comboBoxCopyFrom.SelectedIndex); + } + + private void buttonCancel_Click(object sender, EventArgs e) + { + this.DialogResult = DialogResult.Cancel; + this.Close(); + } + + #endregion Buttons + + } + +} Added: trunk/plugins/MCEReplacement/Forms/ExternalChannels.designer.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/ExternalChannels.designer.cs (rev 0) +++ trunk/plugins/MCEReplacement/Forms/ExternalChannels.designer.cs 2007-01-30 02:51:49 UTC (rev 50) @@ -0,0 +1,233 @@ +namespace MediaPortal.Plugins +{ + partial class ExternalChannels + { + /// <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.buttonOK = new System.Windows.Forms.Button(); + this.groupBoxQuickSetup = new System.Windows.Forms.GroupBox(); + this.buttonQuickSet = new System.Windows.Forms.Button(); + this.comboBoxQuickSetup = new System.Windows.Forms.ComboBox(); + this.groupBoxTest = new System.Windows.Forms.GroupBox(); + this.labelCh = new System.Windows.Forms.Label(); + this.buttonTest = new System.Windows.Forms.Button(); + this.numericUpDownTest = new System.Windows.Forms.NumericUpDown(); + this.buttonCopyFrom = new System.Windows.Forms.Button(); + this.comboBoxCopyFrom = new System.Windows.Forms.ComboBox(); + this.tabControlTVCards = new System.Windows.Forms.TabControl(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.groupBoxQuickSetup.SuspendLayout(); + this.groupBoxTest.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownTest)).BeginInit(); + this.SuspendLayout(); + // + // buttonOK + // + this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonOK.Location = new System.Drawing.Point(400, 408); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.Size = new System.Drawing.Size(56, 24); + this.buttonOK.TabIndex = 5; + this.buttonOK.Text = "OK"; + this.buttonOK.UseVisualStyleBackColor = true; + this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); + // + // groupBoxQuickSetup + // + this.groupBoxQuickSetup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxQuickSetup.Controls.Add(this.buttonQuickSet); + this.groupBoxQuickSetup.Controls.Add(this.comboBoxQuickSetup); + this.groupBoxQuickSetup.Location = new System.Drawing.Point(8, 352); + this.groupBoxQuickSetup.Name = "groupBoxQuickSetup"; + this.groupBoxQuickSetup.Size = new System.Drawing.Size(288, 48); + this.groupBoxQuickSetup.TabIndex = 1; + this.groupBoxQuickSetup.TabStop = false; + this.groupBoxQuickSetup.Text = "Quick Setup"; + // + // buttonQuickSet + // + this.buttonQuickSet.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonQuickSet.Location = new System.Drawing.Point(232, 16); + this.buttonQuickSet.Name = "buttonQuickSet"; + this.buttonQuickSet.Size = new System.Drawing.Size(48, 21); + this.buttonQuickSet.TabIndex = 1; + this.buttonQuickSet.Text = "Set"; + this.buttonQuickSet.UseVisualStyleBackColor = true; + this.buttonQuickSet.Click += new System.EventHandler(this.buttonQuickSet_Click); + // + // comboBoxQuickSetup + // + this.comboBoxQuickSetup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.comboBoxQuickSetup.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxQuickSetup.FormattingEnabled = true; + this.comboBoxQuickSetup.Location = new System.Drawing.Point(8, 16); + this.comboBoxQuickSetup.Name = "comboBoxQuickSetup"; + this.comboBoxQuickSetup.Size = new System.Drawing.Size(216, 21); + this.comboBoxQuickSetup.TabIndex = 0; + // + // groupBoxTest + // + this.groupBoxTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxTest.Controls.Add(this.labelCh); + this.groupBoxTest.Controls.Add(this.buttonTest); + this.groupBoxTest.Controls.Add(this.numericUpDownTest); + this.groupBoxTest.Location = new System.Drawing.Point(304, 352); + this.groupBoxTest.Name = "groupBoxTest"; + this.groupBoxTest.Size = new System.Drawing.Size(216, 48); + this.groupBoxTest.TabIndex = 2; + this.groupBoxTest.TabStop = false; + this.groupBoxTest.Text = "Test"; + // + // labelCh + // + this.labelCh.Location = new System.Drawing.Point(8, 16); + this.labelCh.Name = "labelCh"; + this.labelCh.Size = new System.Drawing.Size(64, 20); + this.labelCh.TabIndex = 0; + this.labelCh.Text = "Channel:"; + this.labelCh.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // buttonTest + // + this.buttonTest.Location = new System.Drawing.Point(152, 16); + this.buttonTest.Name = "buttonTest"; + this.buttonTest.Size = new System.Drawing.Size(56, 20); + this.buttonTest.TabIndex = 2; + this.buttonTest.Text = "Test"; + this.buttonTest.UseVisualStyleBackColor = true; + this.buttonTest.Click += new System.EventHandler(this.buttonTest_Click); + // + // numericUpDownTest + // + this.numericUpDownTest.Location = new System.Drawing.Point(72, 16); + this.numericUpDownTest.Maximum = new decimal(new int[] { + 9999, + 0, + 0, + 0}); + this.numericUpDownTest.Name = "numericUpDownTest"; + this.numericUpDownTest.Size = new System.Drawing.Size(72, 20); + this.numericUpDownTest.TabIndex = 1; + this.numericUpDownTest.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.numericUpDownTest.Value = new decimal(new int[] { + 1, + 0, + 0, + 0}); + // + // buttonCopyFrom + // + this.buttonCopyFrom.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonCopyFrom.Location = new System.Drawing.Point(8, 408); + this.buttonCopyFrom.Name = "buttonCopyFrom"; + this.buttonCopyFrom.Size = new System.Drawing.Size(144, 21); + this.buttonCopyFrom.TabIndex = 3; + this.buttonCopyFrom.Text = "Copy from saved config:"; + this.buttonCopyFrom.UseVisualStyleBackColor = true; + this.buttonCopyFrom.Click += new System.EventHandler(this.buttonCopyFrom_Click); + // + // comboBoxCopyFrom + // + this.comboBoxCopyFrom.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.comboBoxCopyFrom.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxCopyFrom.FormattingEnabled = true; + this.comboBoxCopyFrom.Location = new System.Drawing.Point(160, 408); + this.comboBoxCopyFrom.Name = "comboBoxCopyFrom"; + this.comboBoxCopyFrom.Size = new System.Drawing.Size(120, 21); + this.comboBoxCopyFrom.TabIndex = 4; + // + // tabControlTVCards + // + this.tabControlTVCards.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tabControlTVCards.Location = new System.Drawing.Point(8, 8); + this.tabControlTVCards.Name = "tabControlTVCards"; + this.tabControlTVCards.SelectedIndex = 0; + this.tabControlTVCards.Size = new System.Drawing.Size(512, 336); + this.tabControlTVCards.TabIndex = 0; + // + // buttonCancel + // + this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonCancel.Location = new System.Drawing.Point(464, 408); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(56, 24); + this.buttonCancel.TabIndex = 6; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); + // + // ExternalChannels + // + this.AcceptButton = this.buttonOK; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.buttonCancel; + this.ClientSize = new System.Drawing.Size(528, 439); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.tabControlTVCards); + this.Controls.Add(this.comboBoxCopyFrom); + this.Controls.Add(this.buttonCopyFrom); + this.Controls.Add(this.groupBoxTest); + this.Controls.Add(this.groupBoxQuickSetup); + this.Controls.Add(this.buttonOK); + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(536, 466); + this.Name = "ExternalChannels"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "External Channel Changing"; + this.Load += new System.EventHandler(this.ExternalChannels_Load); + this.groupBoxQuickSetup.ResumeLayout(false); + this.groupBoxTest.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownTest)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button buttonOK; + private System.Windows.Forms.GroupBox groupBoxQuickSetup; + private System.Windows.Forms.ComboBox comboBoxQuickSetup; + private System.Windows.Forms.GroupBox groupBoxTest; + private System.Windows.Forms.NumericUpDown numericUpDownTest; + private System.Windows.Forms.Button buttonTest; + private System.Windows.Forms.Button buttonQuickSet; + private System.Windows.Forms.Label labelCh; + private System.Windows.Forms.Button buttonCopyFrom; + private System.Windows.Forms.ComboBox comboBoxCopyFrom; + private System.Windows.Forms.TabControl tabControlTVCards; + private System.Windows.Forms.Button buttonCancel; + + } +} \ No newline at end of file Added: trunk/plugins/MCEReplacement/Forms/ExternalChannels.resx =================================================================== --- trunk/plugins/MCEReplacement/Forms/ExternalChannels.resx (rev 0) +++ trunk/plugins/MCEReplacement/Forms/ExternalChannels.resx 2007-01-30 02:51:49 UTC (rev 50) @@ -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 Added: trunk/plugins/MCEReplacement/Forms/ExternalProgram.Designer.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/ExternalProgram.Designer.cs (rev 0) +++ trunk/plugins/MCEReplacement/Forms/ExternalProgram.Designer.cs 2007-01-30 02:51:49 UTC (rev 50) @@ -0,0 +1,294 @@ +namespace MediaPortal.Plugins +{ + partial class ExternalProgram + { + /// <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.textBoxProgram = new System.Windows.Forms.TextBox(); + this.labelProgram = new System.Windows.Forms.Label(); + this.buttonProgam = new System.Windows.Forms.Button(); + this.buttonStartup = new System.Windows.Forms.Button(); + this.labelStartup = new System.Windows.Forms.Label(); + this.textBoxStartup = new System.Windows.Forms.TextBox(); + this.buttonOK = new System.Windows.Forms.Button(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.labelParameters = new System.Windows.Forms.Label(); + this.textBoxParameters = new System.Windows.Forms.TextBox(); + this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); + this.folderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog(); + this.buttonParamQuestion = new System.Windows.Forms.Button(); + this.checkBoxShellExecute = new System.Windows.Forms.CheckBox(); + this.buttonTest = new System.Windows.Forms.Button(); + this.checkBoxNoWindow = new System.Windows.Forms.CheckBox(); + this.checkBoxWaitForExit = new System.Windows.Forms.CheckBox(); + this.comboBoxWindowStyle = new System.Windows.Forms.ComboBox(); + this.labelWindowStyle = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // textBoxProgram + // + this.textBoxProgram.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxProgram.Location = new System.Drawing.Point(8, 24); + this.textBoxProgram.Name = "textBoxProgram"; + this.textBoxProgram.Size = new System.Drawing.Size(288, 20); + this.textBoxProgram.TabIndex = 1; + // + // labelProgram + // + this.labelProgram.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.labelProgram.Location = new System.Drawing.Point(8, 8); + this.labelProgram.Name = "labelProgram"; + this.labelProgram.Size = new System.Drawing.Size(288, 16); + this.labelProgram.TabIndex = 0; + this.labelProgram.Text = "Program:"; + this.labelProgram.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // buttonProgam + // + this.buttonProgam.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonProgam.Location = new System.Drawing.Point(304, 24); + this.buttonProgam.Name = "buttonProgam"; + this.buttonProgam.Size = new System.Drawing.Size(24, 20); + this.buttonProgam.TabIndex = 2; + this.buttonProgam.Text = "..."; + this.buttonProgam.UseVisualStyleBackColor = true; + this.buttonProgam.Click += new System.EventHandler(this.buttonProgam_Click); + // + // buttonStartup + // + this.buttonStartup.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonStartup.Location = new System.Drawing.Point(304, 72); + this.buttonStartup.Name = "buttonStartup"; + this.buttonStartup.Size = new System.Drawing.Size(24, 20); + this.buttonStartup.TabIndex = 5; + this.buttonStartup.Text = "..."; + this.buttonStartup.UseVisualStyleBackColor = true; + this.buttonStartup.Click += new System.EventHandler(this.buttonStartup_Click); + // + // labelStartup + // + this.labelStartup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.labelStartup.Location = new System.Drawing.Point(8, 56); + this.labelStartup.Name = "labelStartup"; + this.labelStartup.Size = new System.Drawing.Size(288, 16); + this.labelStartup.TabIndex = 3; + this.labelStartup.Text = "Startup Folder:"; + this.labelStartup.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // textBoxStartup + // + this.textBoxStartup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxStartup.Location = new System.Drawing.Point(8, 72); + this.textBoxStartup.Name = "textBoxStartup"; + this.textBoxStartup.Size = new System.Drawing.Size(288, 20); + this.textBoxStartup.TabIndex = 4; + // + // buttonOK + // + this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonOK.Location = new System.Drawing.Point(208, 216); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.Size = new System.Drawing.Size(56, 24); + this.buttonOK.TabIndex = 15; + this.buttonOK.Text = "OK"; + this.buttonOK.UseVisualStyleBackColor = true; + this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); + // + // buttonCancel + // + this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonCancel.Location = new System.Drawing.Point(272, 216); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(56, 24); + this.buttonCancel.TabIndex = 16; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); + // + // labelParameters + // + this.labelParameters.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.labelParameters.Location = new System.Drawing.Point(8, 104); + this.labelParameters.Name = "labelParameters"; + this.labelParameters.Size = new System.Drawing.Size(288, 16); + this.labelParameters.TabIndex = 6; + this.labelParameters.Text = "Parameters:"; + this.labelParameters.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // textBoxParameters + // + this.textBoxParameters.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxParameters.Location = new System.Drawing.Point(8, 120); + this.textBoxParameters.Name = "textBoxParameters"; + this.textBoxParameters.Size = new System.Drawing.Size(288, 20); + this.textBoxParameters.TabIndex = 7; + // + // openFileDialog + // + this.openFileDialog.Filter = "All files|*.*"; + this.openFileDialog.Title = "Select Program Executable"; + // + // folderBrowserDialog + // + this.folderBrowserDialog.Description = "Select the startup folder for the program to run from"; + // + // buttonParamQuestion + // + this.buttonParamQuestion.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonParamQuestion.Location = new System.Drawing.Point(304, 120); + this.buttonParamQuestion.Name = "buttonParamQuestion"; + this.buttonParamQuestion.Size = new System.Drawing.Size(24, 20); + this.buttonParamQuestion.TabIndex = 8; + this.buttonParamQuestion.Text = "?"; + this.buttonParamQuestion.UseVisualStyleBackColor = true; + this.buttonParamQuestion.Click += new System.EventHandler(this.buttonParamQuestion_Click); + // + // checkBoxShellExecute + // + this.checkBoxShellExecute.Location = new System.Drawing.Point(8, 184); + this.checkBoxShellExecute.Name = "checkBoxShellExecute"; + this.checkBoxShellExecute.Size = new System.Drawing.Size(184, 21); + this.checkBoxShellExecute.TabIndex = 12; + this.checkBoxShellExecute.Text = "Startup using ShellExecute"; + this.checkBoxShellExecute.UseVisualStyleBackColor = true; + // + // buttonTest + // + this.buttonTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonTest.Location = new System.Drawing.Point(8, 216); + this.buttonTest.Name = "buttonTest"; + this.buttonTest.Size = new System.Drawing.Size(56, 24); + this.buttonTest.TabIndex = 14; + this.buttonTest.Text = "Test"; + this.buttonTest.UseVisualStyleBackColor = true; + this.buttonTest.Click += new System.EventHandler(this.buttonTest_Click); + // + // checkBoxNoWindow + // + this.checkBoxNoWindow.Location = new System.Drawing.Point(208, 152); + this.checkBoxNoWindow.Name = "checkBoxNoWindow"; + this.checkBoxNoWindow.Size = new System.Drawing.Size(104, 21); + this.checkBoxNoWindow.TabIndex = 11; + this.checkBoxNoWindow.Text = "No window"; + this.checkBoxNoWindow.UseVisualStyleBackColor = true; + // + // checkBoxWaitForExit + // + this.checkBoxWaitForExit.Location = new System.Drawing.Point(208, 184); + this.checkBoxWaitForExit.Name = "checkBoxWaitForExit"; + this.checkBoxWaitForExit.Size = new System.Drawing.Size(104, 21); + this.checkBoxWaitForExit.TabIndex = 13; + this.checkBoxWaitForExit.Text = "Wait for exit"; + this.checkBoxWaitForExit.UseVisualStyleBackColor = true; + // + // comboBoxWindowStyle + // + this.comboBoxWindowStyle.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxWindowStyle.FormattingEnabled = true; + this.comboBoxWindowStyle.Location = new System.Drawing.Point(104, 152); + this.comboBoxWindowStyle.MaxDropDownItems = 4; + this.comboBoxWindowStyle.Name = "comboBoxWindowStyle"; + this.comboBoxWindowStyle.Size = new System.Drawing.Size(88, 21); + this.comboBoxWindowStyle.TabIndex = 10; + // + // labelWindowStyle + // + this.labelWindowStyle.Location = new System.Drawing.Point(8, 152); + this.labelWindowStyle.Name = "labelWindowStyle"; + this.labelWindowStyle.Size = new System.Drawing.Size(96, 21); + this.labelWindowStyle.TabIndex = 9; + this.labelWindowStyle.Text = "Window Style:"; + this.labelWindowStyle.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // ExternalProgram + // + this.AcceptButton = this.buttonOK; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.buttonCancel; + this.ClientSize = new System.Drawing.Size(336, 249); + this.Controls.Add(this.checkBoxNoWindow); + this.Controls.Add(this.checkBoxWaitForExit); + this.Controls.Add(this.comboBoxWindowStyle); + this.Controls.Add(this.labelWindowStyle); + this.Controls.Add(this.buttonTest); + this.Controls.Add(this.checkBoxShellExecute); + this.Controls.Add(this.buttonParamQuestion); + this.Controls.Add(this.labelParameters); + this.Controls.Add(this.textBoxParameters); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.buttonOK); + this.Controls.Add(this.buttonStartup); + this.Controls.Add(this.labelStartup); + this.Controls.Add(this.textBoxStartup); + this.Controls.Add(this.buttonProgam); + this.Controls.Add(this.labelProgram); + this.Controls.Add(this.textBoxProgram); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(344, 276); + this.Name = "ExternalProgram"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "External Program Details"; + this.Load += new System.EventHandler(this.ExternalProgram_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox textBoxProgram; + private System.Windows.Forms.Label labelProgram; + private System.Windows.Forms.Button buttonProgam; + private System.Windows.Forms.Button buttonStartup; + private System.Windows.Forms.Label labelStartup; + private System.Windows.Forms.TextBox textBoxStartup; + private System.Windows.Forms.Button buttonOK; + private System.Windows.Forms.Button buttonCancel; + private System.Windows.Forms.Label labelParameters; + private System.Windows.Forms.TextBox textBoxParameters; + private System.Windows.Forms.OpenFileDialog openFileDialog; + private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog; + private System.Windows.Forms.Button buttonParamQuestion; + private System.Windows.Forms.CheckBox checkBoxShellExecute; + private System.Windows.Forms.Button buttonTest; + private System.Windows.Forms.CheckBox checkBoxNoWindow; + private System.Windows.Forms.CheckBox checkBoxWaitForExit; + private System.Windows.Forms.ComboBox comboBoxWindowStyle; + private System.Windows.Forms.Label labelWindowStyle; + } +} \ No newline at end of file Added: trunk/plugins/MCEReplacement/Forms/ExternalProgram.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/ExternalProgram.cs (rev 0) +++ trunk/plugins/MCEReplacement/Forms/ExternalProgram.cs 2007-01-30 02:51:49 UTC (rev 50) @@ -0,0 +1,162 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Diagnostics; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +using MediaPortal.GUI.Library; + +namespace MediaPortal.Plugins +{ + + public partial class ExternalProgram : Form + { + + #region Variables + + string _parametersMessage = ""; + + #endregion Variables + + #region Properties + + public string CommandString + { + get + { + return string.Format("{0}|{1}|{2}|{3}|{4}|{5}|{6}", + textBoxProgram.Text, + textBoxStartup.Text, + textBoxParameters.Text, + (string)comboBoxWindowStyle.SelectedItem, + checkBoxNoWindow.Checked.ToString(), + checkBoxShellExecute.Checked.ToString(), + checkBoxWaitForExit.Checked.ToString()); + } + } + + #endregion Properties + + #region Constructors + + public ExternalProgram() : this(null, "") { } + public ExternalProgram(string parametersMessage) : this(null, parametersMessage) { } + public ExternalProgram(string[] commands) : this(commands, "") { } + public ExternalProgram(string[] commands, string parametersMessage) + { + InitializeComponent(); + + _parametersMessage = parametersMessage; + + comboBoxWindowStyle.Items.Clear(); + comboBoxWindowStyle.Items.AddRange(Enum.GetNames(typeof(ProcessWindowStyle))); + + if (commands != null) + { + textBoxProgram.Text = commands[0]; + textBoxStartup.Text = commands[1]; + textBoxParameters.Text = commands[2]; + + checkBoxNoWindow.Checked = bool.Parse(commands[4]); + checkBoxShellExecute.Checked = bool.Parse(commands[5]); + checkBoxWaitForExit.Checked = bool.Parse(commands[6]); + + comboBoxWindowStyle.SelectedItem = ((ProcessWindowStyle)Enum.Parse(typeof(ProcessWindowStyle), commands[3])).ToString(); + } + else + { + comboBoxWindowStyle.SelectedIndex = 0; + } + } + + #endregion Constructors + + private void ExternalProgram_Load(object sender, EventArgs e) + { + if (_parametersMessage.Trim().Length == 0) + buttonParamQuestion.Visible = false; + } + + + private void buttonProgam_Click(object sender, EventArgs e) + { + if (openFileDialog.ShowDialog(this) == DialogResult.OK) + { + textBoxProgram.Text = openFileDialog.FileName; + + if (textBoxStartup.Text.Trim().Length == 0) + { + textBoxStartup.Text = System.IO.Path.GetDirectoryName(openFileDialog.FileName); + } + } + } + + private void buttonStartup_Click(object sender, EventArgs e) + { + if (folderBrowserDialog.ShowDialog(this) == DialogResult.OK) + { + textBoxProgram.Text = folderBrowserDialog.SelectedPath; + } + } + + private void buttonOK_Click(object sender, EventArgs e) + { + if (textBoxProgram.Text.Trim().Length == 0) + { + MessageBox.Show(this, "You must specify a program to run", "Missing program name", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + return; + } + + this.DialogResult = DialogResult.OK; + this.Close(); + } + + private void buttonCancel_Click(object sender, EventArgs e) + { + this.DialogResult = DialogResult.Cancel; + this.Close(); + } + + private void buttonParamQuestion_Click(object sender, EventArgs e) + { + MessageBox.Show(this, _parametersMessage, "Parameters", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + + private void buttonTest_Click(object sender, EventArgs e) + { + if (textBoxProgram.Text.Trim().Length == 0) + { + MessageBox.Show(this, "You must specify a program to run", "Missing program name", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + return; + } + + try + { + Process process = new Process(); + process.StartInfo.FileName = textBoxProgram.Text; + process.StartInfo.WorkingDirectory = textBoxStartup.Text; + process.StartInfo.Arguments = textBoxParameters.Text; + process.StartInfo.WindowStyle = (ProcessWindowStyle)Enum.Parse(typeof(ProcessWindowStyle), (string)comboBoxWindowStyle.SelectedItem); + process.StartInfo.CreateNoWindow = checkBoxNoWindow.Checked; + process.StartInfo.UseShellExecute = checkBoxShellExecute.Checked; + + if (MCEReplacement.LogVerbose) + Log.Info("MCEReplacement: Launching external program {0}", textBoxProgram.Text); + + process.Start(); + + if (checkBoxWaitForExit.Checked) // Wait for exit + process.WaitForExit(); + } + catch (Exception ex) + { + Log.Error("MCEReplacement: {0}", ex.Message); + } + } + + } + +} Added: trunk/plugins/MCEReplacement/Forms/ExternalProgram.resx =================================================================== --- trunk/plugins/MCEReplacement/Forms/ExternalProgram.resx (rev 0) +++ trunk/plugins/MCEReplacement/Forms/ExternalProgram.resx 2007-01-30 02:51:49 UTC (rev 50) @@ -0,0 +1,126 @@ +<?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> + <metadata name="openFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> + <metadata name="folderBrowserDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>144, 17</value> + </metadata> +</root> \ No newline at end of file Added: trunk/plugins/MCEReplacement/Forms/GoToScreen.Designer.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/GoToScreen.Designer.cs (rev 0) +++ trunk/plugins/MCEReplacement/Forms/GoToScreen.Designer.cs 2007-01-30 02:51:49 UTC (rev 50) @@ -0,0 +1,111 @@ +namespace MediaPortal.Plugins +{ + partial class GoToScreen + { + /// <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.comboBoxScreen = new System.Windows.Forms.ComboBox(); + this.buttonOK = new System.Windows.Forms.Button(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.labelScreen = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // comboBoxScreen + // + this.comboBoxScreen.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.comboBoxScreen.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxScreen.FormattingEnabled = true; + this.comboBoxScreen.Location = new System.Drawing.Point(8, 24); + this.comboBoxScreen.Name = "comboBoxScreen"; + this.comboBoxScreen.Size = new System.Drawing.Size(280, 21); + this.comboBoxScreen.TabIndex = 0; + // + // buttonOK + // + this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonOK.Location = new System.Drawing.Point(152, 56); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.Size = new System.Drawing.Size(64, 24); + this.buttonOK.TabIndex = 1; + this.buttonOK.Text = "OK"; + this.buttonOK.UseVisualStyleBackColor = true; + this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); + // + // buttonCancel + // + this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonCancel.Location = new System.Drawing.Point(224, 56); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(64, 24); + this.buttonCancel.TabIndex = 2; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); + // + // labelScreen + // + this.labelScreen.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.labelScreen.Location = new System.Drawing.Point(8, 8); + this.labelScreen.Name = "labelScreen"; + this.labelScreen.Size = new System.Drawing.Size(280, 16); + this.labelScreen.TabIndex = 3; + this.labelScreen.Text = "Screen:"; + // + // GoToScreen + // + this.AcceptButton = this.buttonOK; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.buttonCancel; + this.ClientSize = new System.Drawing.Size(296, 89); + this.Controls.Add(this.labelScre... [truncated message content] |