|
From: <an...@us...> - 2007-03-18 12:13:41
|
Revision: 194
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=194&view=rev
Author: and-81
Date: 2007-03-17 05:10:29 -0700 (Sat, 17 Mar 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/plugins/ComSkipLauncher TVE2/ComSkipLauncher.cs
trunk/plugins/ComSkipLauncher TVE2/Configuration.cs
trunk/plugins/ComSkipLauncher TVE3/ComSkipLauncher.cs
trunk/plugins/ComSkipLauncher TVE3/PluginSetup.Designer.cs
trunk/plugins/ComSkipLauncher TVE3/PluginSetup.cs
Modified: trunk/plugins/ComSkipLauncher TVE2/ComSkipLauncher.cs
===================================================================
--- trunk/plugins/ComSkipLauncher TVE2/ComSkipLauncher.cs 2007-03-17 06:59:36 UTC (rev 193)
+++ trunk/plugins/ComSkipLauncher TVE2/ComSkipLauncher.cs 2007-03-17 12:10:29 UTC (rev 194)
@@ -126,34 +126,16 @@
try
{
- string fileName = String.Empty;
- List<TVRecorded> recorded = new List<TVRecorded>();
- TVDatabase.GetRecordedTV(ref recorded);
- foreach (TVRecorded rec in recorded)
- {
- if (rec.Title == recording.Title && rec.StartTime == recording.StartTime)
- {
- fileName = rec.FileName;
- break;
- }
- }
+ string parameters = ProcessParameters(_parameters, recordingFilename);
- if (String.IsNullOrEmpty(fileName))
- {
- Log.Warn("ComSkipLauncher: Couldn't process recording titled {0}, no filename found.", recording.Title);
- return;
- }
-
- string parameters = ProcessParameters(_parameters, fileName);
-
Log.Info(
"ComSkipLauncher: Recording ended ({0}), launching program ({1} {2}) ...",
- fileName,
+ recordingFilename,
_program,
parameters
);
- LaunchProcess(_program, parameters, Path.GetDirectoryName(fileName), ProcessWindowStyle.Hidden);
+ LaunchProcess(_program, parameters, Path.GetDirectoryName(recordingFilename), ProcessWindowStyle.Hidden);
}
catch (Exception ex)
{
@@ -194,18 +176,6 @@
}
}
- void LaunchProcess(string program, string parameters, string workingFolder, ProcessWindowStyle windowStyle)
- {
- Process process = new Process();
- process.StartInfo = new ProcessStartInfo();
- process.StartInfo.Arguments = parameters;
- process.StartInfo.FileName = program;
- process.StartInfo.WindowStyle = windowStyle;
- process.StartInfo.WorkingDirectory = workingFolder;
-
- process.Start();
- }
-
internal static string ProcessParameters(string input, string fileName)
{
string output = String.Empty;
@@ -229,7 +199,18 @@
return output;
}
+ internal static void LaunchProcess(string program, string parameters, string workingFolder, ProcessWindowStyle windowStyle)
+ {
+ Process process = new Process();
+ process.StartInfo = new ProcessStartInfo();
+ process.StartInfo.Arguments = parameters;
+ process.StartInfo.FileName = program;
+ process.StartInfo.WindowStyle = windowStyle;
+ process.StartInfo.WorkingDirectory = workingFolder;
+ process.Start();
+ }
+
#endregion Implementation
}
Modified: trunk/plugins/ComSkipLauncher TVE2/Configuration.cs
===================================================================
--- trunk/plugins/ComSkipLauncher TVE2/Configuration.cs 2007-03-17 06:59:36 UTC (rev 193)
+++ trunk/plugins/ComSkipLauncher TVE2/Configuration.cs 2007-03-17 12:10:29 UTC (rev 194)
@@ -1,5 +1,4 @@
using System;
-using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
@@ -79,7 +78,6 @@
{
MessageBox.Show(this, ParametersMessage, "Parameters", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
-
private void buttonTest_Click(object sender, EventArgs e)
{
string program = textBoxProgram.Text.Trim();
@@ -95,12 +93,7 @@
{
string parameters = ComSkipLauncher.ProcessParameters(param, textBoxTest.Text);
- Process process = new Process();
- process.StartInfo.Arguments = parameters;
- process.StartInfo.FileName = program;
- process.StartInfo.WorkingDirectory = Path.GetDirectoryName(program);
-
- process.Start();
+ ComSkipLauncher.LaunchProcess(program, parameters, Path.GetDirectoryName(program), ProcessWindowStyle.Normal);
}
catch (Exception ex)
{
@@ -113,7 +106,6 @@
if (openFileDialog.ShowDialog(this) == DialogResult.OK)
textBoxTest.Text = openFileDialog.FileName;
}
-
private void buttonProgram_Click(object sender, EventArgs e)
{
openFileDialog.Title = "Select Program To Execute";
Modified: trunk/plugins/ComSkipLauncher TVE3/ComSkipLauncher.cs
===================================================================
--- trunk/plugins/ComSkipLauncher TVE3/ComSkipLauncher.cs 2007-03-17 06:59:36 UTC (rev 193)
+++ trunk/plugins/ComSkipLauncher TVE3/ComSkipLauncher.cs 2007-03-17 12:10:29 UTC (rev 194)
@@ -145,25 +145,6 @@
}
}
- void LaunchProcess(string program, string parameters, string workingFolder, ProcessWindowStyle windowStyle)
- {
- try
- {
- Process process = new Process();
- process.StartInfo = new ProcessStartInfo();
- process.StartInfo.Arguments = parameters;
- process.StartInfo.FileName = program;
- process.StartInfo.WindowStyle = windowStyle;
- process.StartInfo.WorkingDirectory = workingFolder;
-
- process.Start();
- }
- catch (Exception ex)
- {
- Log.Error("ComSkipLauncher - LaunchProcess(): {0}", ex.Message);
- }
- }
-
internal static string ProcessParameters(string input, string fileName)
{
string output = String.Empty;
@@ -188,6 +169,25 @@
return output;
}
+ internal static void LaunchProcess(string program, string parameters, string workingFolder, ProcessWindowStyle windowStyle)
+ {
+ try
+ {
+ Process process = new Process();
+ process.StartInfo = new ProcessStartInfo();
+ process.StartInfo.Arguments = parameters;
+ process.StartInfo.FileName = program;
+ process.StartInfo.WindowStyle = windowStyle;
+ process.StartInfo.WorkingDirectory = workingFolder;
+
+ process.Start();
+ }
+ catch (Exception ex)
+ {
+ Log.Error("ComSkipLauncher - LaunchProcess(): {0}", ex.Message);
+ }
+ }
+
#endregion Implementation
}
Modified: trunk/plugins/ComSkipLauncher TVE3/PluginSetup.Designer.cs
===================================================================
--- trunk/plugins/ComSkipLauncher TVE3/PluginSetup.Designer.cs 2007-03-17 06:59:36 UTC (rev 193)
+++ trunk/plugins/ComSkipLauncher TVE3/PluginSetup.Designer.cs 2007-03-17 12:10:29 UTC (rev 194)
@@ -111,21 +111,21 @@
//
// radioButtonStart
//
+ this.radioButtonStart.Checked = true;
this.radioButtonStart.Location = new System.Drawing.Point(8, 16);
this.radioButtonStart.Name = "radioButtonStart";
this.radioButtonStart.Size = new System.Drawing.Size(120, 24);
this.radioButtonStart.TabIndex = 0;
+ this.radioButtonStart.TabStop = true;
this.radioButtonStart.Text = "Recording Start";
this.radioButtonStart.UseVisualStyleBackColor = true;
//
// radioButtonEnd
//
- this.radioButtonEnd.Checked = true;
this.radioButtonEnd.Location = new System.Drawing.Point(144, 16);
this.radioButtonEnd.Name = "radioButtonEnd";
this.radioButtonEnd.Size = new System.Drawing.Size(120, 24);
this.radioButtonEnd.TabIndex = 1;
- this.radioButtonEnd.TabStop = true;
this.radioButtonEnd.Text = "Recording End";
this.radioButtonEnd.UseVisualStyleBackColor = true;
//
Modified: trunk/plugins/ComSkipLauncher TVE3/PluginSetup.cs
===================================================================
--- trunk/plugins/ComSkipLauncher TVE3/PluginSetup.cs 2007-03-17 06:59:36 UTC (rev 193)
+++ trunk/plugins/ComSkipLauncher TVE3/PluginSetup.cs 2007-03-17 12:10:29 UTC (rev 194)
@@ -1,14 +1,11 @@
using System;
-using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Text;
-using System.Threading;
using System.Windows.Forms;
-using System.Xml;
using TvLibrary.Log;
using TvEngine;
@@ -112,15 +109,11 @@
{
MessageBox.Show(this, ParametersMessage, "Parameters", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
-
private void buttonTest_Click(object sender, EventArgs e)
{
- string program;
- string param;
+ string program = textBoxProgram.Text.Trim();
+ string param = textBoxParameters.Text;
- program = textBoxProgram.Text.Trim();
- param = textBoxParameters.Text;
-
if (program.Length == 0)
{
MessageBox.Show(this, "You must specify a program to run", "Missing program name", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
@@ -131,12 +124,7 @@
{
string parameters = ComSkipLauncher.ProcessParameters(param, textBoxTest.Text);
- Process process = new Process();
- process.StartInfo.Arguments = parameters;
- process.StartInfo.FileName = program;
- process.StartInfo.WorkingDirectory = Path.GetDirectoryName(program);
-
- process.Start();
+ ComSkipLauncher.LaunchProcess(program, parameters, Path.GetDirectoryName(program), ProcessWindowStyle.Normal);
}
catch (Exception ex)
{
@@ -149,7 +137,6 @@
if (openFileDialog.ShowDialog(this) == DialogResult.OK)
textBoxTest.Text = openFileDialog.FileName;
}
-
private void buttonProgram_Click(object sender, EventArgs e)
{
openFileDialog.Title = "Select Program To Execute";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|