From: <an...@us...> - 2008-01-20 15:50:07
|
Revision: 1288 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1288&view=rev Author: and-81 Date: 2008-01-20 07:49:40 -0800 (Sun, 20 Jan 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandProcessor.csproj trunk/plugins/IR Server Suite/Commands/CommandProcessor/Processor.cs trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandKeystrokes.cs trunk/plugins/IR Server Suite/Commands/GeneralCommands/EditKeystrokes.Designer.cs trunk/plugins/IR Server Suite/Commands/GeneralCommands/EditKeystrokes.cs trunk/plugins/IR Server Suite/Commands/GeneralCommands/GeneralCommands.csproj trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/CommandGotoScreen.cs trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/EditGotoScreen.Designer.cs trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/EditGotoScreen.cs trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/MediaPortalCommands.csproj trunk/plugins/IR Server Suite/Commands/TestApp/Program.cs trunk/plugins/IR Server Suite/Documentation/LICENSE.MIT trunk/plugins/IR Server Suite/Documentation/legal.html trunk/plugins/IR Server Suite/Documentation/new.html Added Paths: ----------- trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/CommandBlastIR.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/CommandCallMacro.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/CommandClearVariables.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/CommandGotoLabel.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/CommandIf.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/CommandLabel.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/CommandLoadVariables.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/CommandMathsOperation.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/CommandSaveVariables.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/CommandSetVariable.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/CommandStringOperation.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/CommandSwapVariables.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/CommandSwitch.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditBlastIR.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditBlastIR.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditBlastIR.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditIf.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditIf.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditIf.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditLabel.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditLabel.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditLabel.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditMacro.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditMacro.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditMacro.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditMathsOperation.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditMathsOperation.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditMathsOperation.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditSetVariable.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditSetVariable.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditSetVariable.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditStringOperation.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditStringOperation.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditStringOperation.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditSwapVariables.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditSwapVariables.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditSwapVariables.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditSwitch.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditSwitch.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditSwitch.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditVariablesFile.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditVariablesFile.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditVariablesFile.resx trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/CommandExit.cs trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/CommandReboot.cs trunk/plugins/IR Server Suite/Documentation/LICENSE.MS-PL Removed Paths: ------------- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandBlastIR.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandCallMacro.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandClearVariables.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandGotoLabel.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandIf.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandLabel.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandLoadVariables.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandMathsOperation.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSaveVariables.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSetVariable.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandStringOperation.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSwapVariables.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSwitch.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditBlastIR.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditBlastIR.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditBlastIR.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditIf.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditIf.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditIf.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditLabel.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditLabel.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditLabel.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMacro.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMacro.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMacro.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMathsOperation.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMathsOperation.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMathsOperation.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditSetVariable.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditSetVariable.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditSetVariable.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditStringOperation.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditStringOperation.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditStringOperation.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditSwapVariables.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditSwapVariables.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditSwapVariables.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditSwitch.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditSwitch.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditSwitch.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditVariablesFile.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditVariablesFile.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditVariablesFile.resx Deleted: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandBlastIR.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandBlastIR.cs 2008-01-20 15:12:37 UTC (rev 1287) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandBlastIR.cs 2008-01-20 15:49:40 UTC (rev 1288) @@ -1,97 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Windows.Forms; - -using IrssUtils; - -namespace Commands -{ - - /// <summary> - /// Blast IR macro command. - /// </summary> - public class CommandBlastIR : Command - { - - #region Constructors - - /// <summary> - /// Initializes a new instance of the <see cref="CommandBlastIR"/> class. - /// </summary> - public CommandBlastIR() { InitParameters(2); } - - /// <summary> - /// Initializes a new instance of the <see cref="CommandBlastIR"/> class. - /// </summary> - /// <param name="parameters">The parameters.</param> - public CommandBlastIR(string[] parameters) : base(parameters) { } - - #endregion Constructors - - #region Implementation - - /// <summary> - /// Gets the category of this command. - /// </summary> - /// <returns>The category of this command.</returns> - public override string GetCategory() { return Processor.CategoryHidden; } - - /// <summary> - /// Gets the user interface text. - /// </summary> - /// <returns>User interface text.</returns> - public override string GetUserInterfaceText() { return "Blast IR"; } - - /// <summary> - /// Gets the user display text. - /// </summary> - /// <returns>The user display text.</returns> - public override string GetUserDisplayText() - { - string fileName = Parameters[0]; - - if (Parameters[0].StartsWith(Common.FolderAppData, StringComparison.OrdinalIgnoreCase)) - fileName = Parameters[0].Substring(Common.FolderAppData.Length); - - return String.Format("{0} ({1}, {2})", GetUserInterfaceText(), fileName, Parameters[1]); - } - - /// <summary> - /// Edit this command. - /// </summary> - /// <param name="parent">The parent window.</param> - /// <param name="blastIrDelegate">The blast ir delegate.</param> - /// <param name="blastPorts">The blast ports.</param> - /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> - public bool Edit(IWin32Window parent, BlastIrDelegate blastIrDelegate, string[] blastPorts) - { - EditBlastIR edit = new EditBlastIR(blastIrDelegate, blastPorts, Parameters); - if (edit.ShowDialog(parent) == DialogResult.OK) - { - Parameters = edit.Parameters; - return true; - } - - return false; - } - - /// <summary> - /// Execute this command. - /// </summary> - /// <param name="blastIrDelegate">The blast ir delegate.</param> - public void Execute(BlastIrDelegate blastIrDelegate) - { - string irFile = Parameters[0] + Common.FileExtensionIR; - string port = Parameters[1]; - - blastIrDelegate(irFile, port); - } - - #endregion Implementation - - - } - -} Deleted: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandCallMacro.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandCallMacro.cs 2008-01-20 15:12:37 UTC (rev 1287) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandCallMacro.cs 2008-01-20 15:49:40 UTC (rev 1288) @@ -1,93 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Windows.Forms; - -using IrssUtils; - -namespace Commands -{ - - /// <summary> - /// Call Macro macro command. - /// </summary> - public class CommandCallMacro : Command - { - - #region Constructors - - /// <summary> - /// Initializes a new instance of the <see cref="CommandCallMacro"/> class. - /// </summary> - public CommandCallMacro() { InitParameters(1); } - - /// <summary> - /// Initializes a new instance of the <see cref="CommandCallMacro"/> class. - /// </summary> - /// <param name="parameters">The parameters.</param> - public CommandCallMacro(string [] parameters): base(parameters) { } - - #endregion Constructors - - #region Implementation - - /// <summary> - /// Gets the category of this command. - /// </summary> - /// <returns>The category of this command.</returns> - public override string GetCategory() { return Processor.CategoryHidden; } - - /// <summary> - /// Gets the user interface text. - /// </summary> - /// <returns>User interface text.</returns> - public override string GetUserInterfaceText() { return "Macro"; } - - /// <summary> - /// Gets the user display text. - /// </summary> - /// <returns>The user display text.</returns> - public override string GetUserDisplayText() - { - string fileName = Parameters[0]; - - if (Parameters[0].StartsWith(Common.FolderAppData, StringComparison.OrdinalIgnoreCase)) - fileName = Parameters[0].Substring(Common.FolderAppData.Length); - - return String.Format("{0} ({1})", GetUserInterfaceText(), fileName); - } - - /// <summary> - /// Execute this command. - /// </summary> - /// <param name="commandProcessor">The command processor.</param> - public void Execute(Processor commandProcessor) - { - Macro macro = new Macro(Parameters[0]); - macro.Execute(commandProcessor); - } - - /// <summary> - /// Edit this command. - /// </summary> - /// <param name="parent">The parent window.</param> - /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> - public override bool Edit(IWin32Window parent) - { - if (String.IsNullOrEmpty(Parameters[0])) - { - OpenFileDialog openFileDialog = new OpenFileDialog(); - openFileDialog.Filter = "Macro Files|*" + Processor.FileExtensionMacro; - if (openFileDialog.ShowDialog(parent) == DialogResult.OK) - Parameters[0] = Path.Combine(Path.GetDirectoryName(openFileDialog.FileName), Path.GetFileNameWithoutExtension(openFileDialog.FileName)); - } - - return true; - } - - #endregion Implementation - - } - -} Deleted: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandClearVariables.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandClearVariables.cs 2008-01-20 15:12:37 UTC (rev 1287) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandClearVariables.cs 2008-01-20 15:49:40 UTC (rev 1288) @@ -1,56 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows.Forms; - -namespace Commands -{ - - /// <summary> - /// Clear Variables special command. - /// </summary> - public class CommandClearVariables : Command - { - - #region Constructors - - /// <summary> - /// Initializes a new instance of the <see cref="CommandClearVariables"/> class. - /// </summary> - public CommandClearVariables() { InitParameters(0); } - - /// <summary> - /// Initializes a new instance of the <see cref="CommandClearVariables"/> class. - /// </summary> - /// <param name="parameters">The parameters.</param> - public CommandClearVariables(string[] parameters) : base(parameters) { } - - #endregion Constructors - - #region Implementation - - /// <summary> - /// Gets the category of this command. - /// </summary> - /// <returns>The category of this command.</returns> - public override string GetCategory() { return Processor.CategoryMacro; } - - /// <summary> - /// Gets the user interface text. - /// </summary> - /// <returns>User interface text.</returns> - public override string GetUserInterfaceText() { return "Clear Variables"; } - - /// <summary> - /// Execute this command. - /// </summary> - public override void Execute(VariableList variables) - { - variables.Clear(); - } - - #endregion Implementation - - } - -} Deleted: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandGotoLabel.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandGotoLabel.cs 2008-01-20 15:12:37 UTC (rev 1287) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandGotoLabel.cs 2008-01-20 15:49:40 UTC (rev 1288) @@ -1,65 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows.Forms; - -namespace Commands -{ - - /// <summary> - /// Goto Label macro command. - /// </summary> - public class CommandGotoLabel : Command - { - - #region Constructors - - /// <summary> - /// Initializes a new instance of the <see cref="CommandGotoLabel"/> class. - /// </summary> - public CommandGotoLabel() { InitParameters(1); } - - /// <summary> - /// Initializes a new instance of the <see cref="CommandGotoLabel"/> class. - /// </summary> - /// <param name="parameters">The parameters.</param> - public CommandGotoLabel(string[] parameters) : base(parameters) { } - - #endregion Constructors - - #region Implementation - - /// <summary> - /// Gets the category of this command. - /// </summary> - /// <returns>The category of this command.</returns> - public override string GetCategory() { return Processor.CategoryMacro; } - - /// <summary> - /// Gets the user interface text. - /// </summary> - /// <returns>User interface text.</returns> - public override string GetUserInterfaceText() { return "Goto Label"; } - - /// <summary> - /// Edit this command. - /// </summary> - /// <param name="parent">The parent window.</param> - /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> - public override bool Edit(IWin32Window parent) - { - EditLabel edit = new EditLabel(Parameters[0]); - if (edit.ShowDialog(parent) == DialogResult.OK) - { - Parameters[0] = edit.LabelName; - return true; - } - - return false; - } - - #endregion Implementation - - } - -} Deleted: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandIf.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandIf.cs 2008-01-20 15:12:37 UTC (rev 1287) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandIf.cs 2008-01-20 15:49:40 UTC (rev 1288) @@ -1,139 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows.Forms; - -namespace Commands -{ - - /// <summary> - /// If Statement macro command. - /// </summary> - public class CommandIf : Command - { - - #region Comparisons - - // String comparisons ... - internal const string IfEquals = "=="; - internal const string IfNotEqual = "!="; - internal const string IfContains = "CONTAINS"; - internal const string IfStartsWith = "STARTS WITH"; - internal const string IfEndsWith = "ENDS WITH"; - - // Integer comparisons ... - internal const string IfGreaterThan = ">"; - internal const string IfLessThan = "<"; - internal const string IfGreaterThanOrEqual = ">="; - internal const string IfLessThanOrEqual = "<="; - - #endregion Comparisons - - #region Constructors - - /// <summary> - /// Initializes a new instance of the <see cref="CommandIf"/> class. - /// </summary> - public CommandIf() { InitParameters(5); } - - /// <summary> - /// Initializes a new instance of the <see cref="CommandIf"/> class. - /// </summary> - /// <param name="parameters">The parameters.</param> - public CommandIf(string[] parameters) : base(parameters) { } - - #endregion Constructors - - #region Implementation - - /// <summary> - /// Gets the category of this command. - /// </summary> - /// <returns>The category of this command.</returns> - public override string GetCategory() { return Processor.CategoryMacro; } - - /// <summary> - /// Gets the user interface text. - /// </summary> - /// <returns>User interface text.</returns> - public override string GetUserInterfaceText() { return "If Statement"; } - - /// <summary> - /// Edit this command. - /// </summary> - /// <param name="parent">The parent window.</param> - /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> - public override bool Edit(IWin32Window parent) - { - EditIf edit = new EditIf(Parameters); - if (edit.ShowDialog(parent) == DialogResult.OK) - { - Parameters = edit.Parameters; - return true; - } - - return false; - } - - #endregion Implementation - - #region Static Methods - - /// <summary> - /// This method will determine if an If Statement evaluates true. - /// </summary> - /// <param name="value1">The first value for comparison.</param> - /// <param name="comparison">The comparison type.</param> - /// <param name="value2">The second value for comparison.</param> - /// <returns><c>true</c> if the parameters evaluates true, otherwise <c>false</c>.</returns> - public static bool Evaluate(string value1, string comparison, string value2) - { - int value1AsInt; - bool value1IsInt = int.TryParse(value1, out value1AsInt); - - int value2AsInt; - bool value2IsInt = int.TryParse(value2, out value2AsInt); - - bool comparisonResult = false; - switch (comparison.ToUpperInvariant()) - { - // Use string comparison ... - case IfEquals: comparisonResult = value1.Equals(value2, StringComparison.OrdinalIgnoreCase); break; - case IfNotEqual: comparisonResult = !value1.Equals(value2, StringComparison.OrdinalIgnoreCase); break; - case IfContains: comparisonResult = value1.ToUpperInvariant().Contains(value2.ToUpperInvariant()); break; - case IfStartsWith: comparisonResult = value1.StartsWith(value2, StringComparison.OrdinalIgnoreCase); break; - case IfEndsWith: comparisonResult = value1.EndsWith(value2, StringComparison.OrdinalIgnoreCase); break; - - // Use integer comparison ... - case IfGreaterThan: - if (value1IsInt && value2IsInt) - comparisonResult = (value1AsInt > value2AsInt); - break; - - case IfLessThan: - if (value1IsInt && value2IsInt) - comparisonResult = (value1AsInt < value2AsInt); - break; - - case IfGreaterThanOrEqual: - if (value1IsInt && value2IsInt) - comparisonResult = (value1AsInt >= value2AsInt); - break; - - case IfLessThanOrEqual: - if (value1IsInt && value2IsInt) - comparisonResult = (value1AsInt <= value2AsInt); - break; - - default: - throw new CommandStructureException(String.Format("Invalid variable comparison method: {0}", comparison)); - } - - return comparisonResult; - } - - #endregion Static Methods - - } - -} Deleted: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandLabel.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandLabel.cs 2008-01-20 15:12:37 UTC (rev 1287) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandLabel.cs 2008-01-20 15:49:40 UTC (rev 1288) @@ -1,65 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows.Forms; - -namespace Commands -{ - - /// <summary> - /// Label macro command. - /// </summary> - public class CommandLabel : Command - { - - #region Constructors - - /// <summary> - /// Initializes a new instance of the <see cref="CommandLabel"/> class. - /// </summary> - public CommandLabel() { InitParameters(1); } - - /// <summary> - /// Initializes a new instance of the <see cref="CommandLabel"/> class. - /// </summary> - /// <param name="parameters">The parameters.</param> - public CommandLabel(string[] parameters) : base(parameters) { } - - #endregion Constructors - - #region Implementation - - /// <summary> - /// Gets the category of this command. - /// </summary> - /// <returns>The category of this command.</returns> - public override string GetCategory() { return Processor.CategoryMacro; } - - /// <summary> - /// Gets the user interface text. - /// </summary> - /// <returns>User interface text.</returns> - public override string GetUserInterfaceText() { return "Label"; } - - /// <summary> - /// Edit this command. - /// </summary> - /// <param name="parent">The parent window.</param> - /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> - public override bool Edit(IWin32Window parent) - { - EditLabel edit = new EditLabel(Parameters[0]); - if (edit.ShowDialog(parent) == DialogResult.OK) - { - Parameters[0] = edit.LabelName; - return true; - } - - return false; - } - - #endregion Implementation - - } - -} Deleted: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandLoadVariables.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandLoadVariables.cs 2008-01-20 15:12:37 UTC (rev 1287) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandLoadVariables.cs 2008-01-20 15:49:40 UTC (rev 1288) @@ -1,74 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows.Forms; - -namespace Commands -{ - - /// <summary> - /// Load Variables macro command. - /// </summary> - public class CommandLoadVariables : Command - { - - #region Constructors - - /// <summary> - /// Initializes a new instance of the <see cref="CommandLoadVariables"/> class. - /// </summary> - public CommandLoadVariables() { InitParameters(1); } - - /// <summary> - /// Initializes a new instance of the <see cref="CommandLoadVariables"/> class. - /// </summary> - /// <param name="parameters">The parameters.</param> - public CommandLoadVariables(string[] parameters) : base(parameters) { } - - #endregion Constructors - - #region Implementation - - /// <summary> - /// Gets the category of this command. - /// </summary> - /// <returns>The category of this command.</returns> - public override string GetCategory() { return Processor.CategoryMacro; } - - /// <summary> - /// Gets the user interface text. - /// </summary> - /// <returns>User interface text.</returns> - public override string GetUserInterfaceText() { return "Load Variables"; } - - /// <summary> - /// Edit this command. - /// </summary> - /// <param name="parent">The parent window.</param> - /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> - public override bool Edit(IWin32Window parent) - { - EditVariablesFile edit = new EditVariablesFile(Parameters[0]); - if (edit.ShowDialog(parent) == DialogResult.OK) - { - Parameters[0] = edit.FileName; - return true; - } - - return false; - } - - /// <summary> - /// Execute this command. - /// </summary> - /// <param name="variables">The variable list of the calling code.</param> - public override void Execute(VariableList variables) - { - variables.Load(Parameters[0]); - } - - #endregion Implementation - - } - -} Deleted: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandMathsOperation.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandMathsOperation.cs 2008-01-20 15:12:37 UTC (rev 1287) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandMathsOperation.cs 2008-01-20 15:49:40 UTC (rev 1288) @@ -1,123 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows.Forms; - -namespace Commands -{ - - /// <summary> - /// Maths Operation macro command. - /// </summary> - public class CommandMathsOperation : Command - { - - #region Maths Operations - - internal const string MathOpAdd = "Add"; - internal const string MathOpSubtract = "Subtract"; - internal const string MathOpMultiply = "Multiply"; - internal const string MathOpDivide = "Divide"; - internal const string MathOpModulo = "Modulo"; - internal const string MathOpPower = "Power"; - internal const string MathOpAbsolute = "Absolute"; - internal const string MathOpRoot = "Square Root"; - - // TODO: Add more maths operations - - //internal const string MathOpToBinary = "To Binary (Input 1)"; - //internal const string MathOpFromBinary = "From Binary (Input 1)"; - - //internal const string MathOpToHex = "To Hex (Input 1)"; - //internal const string MathOpFromHex = "From Hex (Input 1)"; - - //internal const string MathOpToOctal = "To Octal (Input 1)"; - //internal const string MathOpFromOctal = "From Octal (Input 1)"; - - #endregion Maths Operations - - #region Constructors - - /// <summary> - /// Initializes a new instance of the <see cref="CommandMathsOperation"/> class. - /// </summary> - public CommandMathsOperation() { InitParameters(4); } - - /// <summary> - /// Initializes a new instance of the <see cref="CommandMathsOperation"/> class. - /// </summary> - /// <param name="parameters">The parameters.</param> - public CommandMathsOperation(string[] parameters) : base(parameters) { } - - #endregion Constructors - - #region Implementation - - /// <summary> - /// Gets the category of this command. - /// </summary> - /// <returns>The category of this command.</returns> - public override string GetCategory() { return Processor.CategoryMacro; } - - /// <summary> - /// Gets the user interface text. - /// </summary> - /// <returns>User interface text.</returns> - public override string GetUserInterfaceText() { return "Maths Operation"; } - - /// <summary> - /// Edit this command. - /// </summary> - /// <param name="parent">The parent window.</param> - /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> - public override bool Edit(IWin32Window parent) - { - EditMathsOperation edit = new EditMathsOperation(Parameters); - if (edit.ShowDialog(parent) == DialogResult.OK) - { - Parameters = edit.Parameters; - return true; - } - - return false; - } - - /// <summary> - /// Execute this command. - /// </summary> - /// <param name="variables">The variable list of the calling code.</param> - public override void Execute(VariableList variables) - { - string input1 = Processor.ReplaceSpecial(Parameters[1]); - int input1Int = 0; - int.TryParse(input1, out input1Int); - - string input2 = Processor.ReplaceSpecial(Parameters[2]); - int input2Int = 0; - int.TryParse(input2, out input2Int); - - int output = 0; - - switch (Parameters[0]) - { - case MathOpAdd: output = input1Int + input2Int; break; - case MathOpDivide: output = input1Int / input2Int; break; - case MathOpModulo: output = input1Int % input2Int; break; - case MathOpMultiply: output = input1Int * input2Int; break; - case MathOpPower: output = (int)Math.Pow((double)input1Int, (double)input2Int); break; - case MathOpSubtract: output = input1Int - input2Int; break; - case MathOpAbsolute: output = Math.Abs(input1Int); break; - case MathOpRoot: output = (int)Math.Sqrt((double) input1Int); break; - - default: - throw new CommandStructureException(String.Format("Invalid Maths Operation: {0}", Parameters[0])); - } - - variables.SetVariable(Parameters[3], output.ToString()); - } - - #endregion Implementation - - } - -} Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandProcessor.csproj =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandProcessor.csproj 2008-01-20 15:12:37 UTC (rev 1287) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandProcessor.csproj 2008-01-20 15:49:40 UTC (rev 1288) @@ -38,83 +38,83 @@ <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> - <Compile Include="CommandStringOperation.cs" /> - <Compile Include="CommandSwapVariables.cs" /> - <Compile Include="CommandMathsOperation.cs" /> - <Compile Include="CommandSwitch.cs" /> - <Compile Include="EditSwitch.cs"> + <Compile Include="Commands\CommandStringOperation.cs" /> + <Compile Include="Commands\CommandSwapVariables.cs" /> + <Compile Include="Commands\CommandMathsOperation.cs" /> + <Compile Include="Commands\CommandSwitch.cs" /> + <Compile Include="Forms\EditBlastIR.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="EditSwitch.Designer.cs"> - <DependentUpon>EditSwitch.cs</DependentUpon> + <Compile Include="Forms\EditBlastIR.designer.cs"> + <DependentUpon>EditBlastIR.cs</DependentUpon> </Compile> - <Compile Include="EditMathsOperation.cs"> + <Compile Include="Forms\EditIf.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="EditMathsOperation.Designer.cs"> - <DependentUpon>EditMathsOperation.cs</DependentUpon> + <Compile Include="Forms\EditIf.designer.cs"> + <DependentUpon>EditIf.cs</DependentUpon> </Compile> - <Compile Include="EditSwapVariables.cs"> + <Compile Include="Forms\EditLabel.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="EditSwapVariables.Designer.cs"> - <DependentUpon>EditSwapVariables.cs</DependentUpon> + <Compile Include="Forms\EditLabel.designer.cs"> + <DependentUpon>EditLabel.cs</DependentUpon> </Compile> - <Compile Include="EditStringOperation.cs"> + <Compile Include="Forms\EditMacro.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="EditStringOperation.Designer.cs"> - <DependentUpon>EditStringOperation.cs</DependentUpon> + <Compile Include="Forms\EditMacro.designer.cs"> + <DependentUpon>EditMacro.cs</DependentUpon> </Compile> - <Compile Include="Processor.cs" /> - <Compile Include="EditBlastIR.cs"> + <Compile Include="Forms\EditMathsOperation.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="EditBlastIR.Designer.cs"> - <DependentUpon>EditBlastIR.cs</DependentUpon> + <Compile Include="Forms\EditMathsOperation.designer.cs"> + <DependentUpon>EditMathsOperation.cs</DependentUpon> </Compile> - <Compile Include="CommandClearVariables.cs" /> - <Compile Include="CommandIf.cs" /> - <Compile Include="CommandLabel.cs" /> - <Compile Include="CommandGotoLabel.cs" /> - <Compile Include="CommandSetVariable.cs" /> - <Compile Include="CommandSaveVariables.cs" /> - <Compile Include="CommandLoadVariables.cs" /> - <Compile Include="CommandCallMacro.cs" /> - <Compile Include="CommandBlastIR.cs" /> - <Compile Include="EditIf.cs"> + <Compile Include="Forms\EditSetVariable.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="EditIf.Designer.cs"> - <DependentUpon>EditIf.cs</DependentUpon> + <Compile Include="Forms\EditSetVariable.designer.cs"> + <DependentUpon>EditSetVariable.cs</DependentUpon> </Compile> - <Compile Include="EditLabel.cs"> + <Compile Include="Forms\EditStringOperation.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="EditLabel.Designer.cs"> - <DependentUpon>EditLabel.cs</DependentUpon> + <Compile Include="Forms\EditStringOperation.designer.cs"> + <DependentUpon>EditStringOperation.cs</DependentUpon> </Compile> - <Compile Include="Macro.cs" /> - <Compile Include="EditMacro.cs"> + <Compile Include="Forms\EditSwapVariables.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="EditMacro.Designer.cs"> - <DependentUpon>EditMacro.cs</DependentUpon> + <Compile Include="Forms\EditSwapVariables.designer.cs"> + <DependentUpon>EditSwapVariables.cs</DependentUpon> </Compile> - <Compile Include="MacroStructureException.cs" /> - <Compile Include="Properties\AssemblyInfo.cs" /> - <Compile Include="EditSetVariable.cs"> + <Compile Include="Forms\EditSwitch.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="EditSetVariable.Designer.cs"> - <DependentUpon>EditSetVariable.cs</DependentUpon> + <Compile Include="Forms\EditSwitch.designer.cs"> + <DependentUpon>EditSwitch.cs</DependentUpon> </Compile> - <Compile Include="EditVariablesFile.cs"> + <Compile Include="Forms\EditVariablesFile.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="EditVariablesFile.Designer.cs"> + <Compile Include="Forms\EditVariablesFile.designer.cs"> <DependentUpon>EditVariablesFile.cs</DependentUpon> </Compile> + <Compile Include="Processor.cs" /> + <Compile Include="Commands\CommandClearVariables.cs" /> + <Compile Include="Commands\CommandIf.cs" /> + <Compile Include="Commands\CommandLabel.cs" /> + <Compile Include="Commands\CommandGotoLabel.cs" /> + <Compile Include="Commands\CommandSetVariable.cs" /> + <Compile Include="Commands\CommandSaveVariables.cs" /> + <Compile Include="Commands\CommandLoadVariables.cs" /> + <Compile Include="Commands\CommandCallMacro.cs" /> + <Compile Include="Commands\CommandBlastIR.cs" /> + <Compile Include="Macro.cs" /> + <Compile Include="MacroStructureException.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\Resources.Designer.cs"> <AutoGen>True</AutoGen> <DesignTime>True</DesignTime> @@ -122,43 +122,43 @@ </Compile> </ItemGroup> <ItemGroup> - <EmbeddedResource Include="EditSwitch.resx"> - <DependentUpon>EditSwitch.cs</DependentUpon> + <EmbeddedResource Include="Forms\EditBlastIR.resx"> + <DependentUpon>EditBlastIR.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> - <EmbeddedResource Include="EditMathsOperation.resx"> - <DependentUpon>EditMathsOperation.cs</DependentUpon> + <EmbeddedResource Include="Forms\EditIf.resx"> + <DependentUpon>EditIf.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> - <EmbeddedResource Include="EditSwapVariables.resx"> - <DependentUpon>EditSwapVariables.cs</DependentUpon> + <EmbeddedResource Include="Forms\EditLabel.resx"> + <DependentUpon>EditLabel.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> - <EmbeddedResource Include="EditStringOperation.resx"> - <DependentUpon>EditStringOperation.cs</DependentUpon> + <EmbeddedResource Include="Forms\EditMacro.resx"> + <DependentUpon>EditMacro.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> - <EmbeddedResource Include="EditBlastIR.resx"> - <DependentUpon>EditBlastIR.cs</DependentUpon> + <EmbeddedResource Include="Forms\EditMathsOperation.resx"> + <DependentUpon>EditMathsOperation.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> - <EmbeddedResource Include="EditIf.resx"> - <DependentUpon>EditIf.cs</DependentUpon> + <EmbeddedResource Include="Forms\EditSetVariable.resx"> + <DependentUpon>EditSetVariable.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> - <EmbeddedResource Include="EditMacro.resx"> - <DependentUpon>EditMacro.cs</DependentUpon> + <EmbeddedResource Include="Forms\EditStringOperation.resx"> + <DependentUpon>EditStringOperation.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> - <EmbeddedResource Include="EditLabel.resx"> - <DependentUpon>EditLabel.cs</DependentUpon> + <EmbeddedResource Include="Forms\EditSwapVariables.resx"> + <DependentUpon>EditSwapVariables.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> - <EmbeddedResource Include="EditSetVariable.resx"> - <DependentUpon>EditSetVariable.cs</DependentUpon> + <EmbeddedResource Include="Forms\EditSwitch.resx"> + <DependentUpon>EditSwitch.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> - <EmbeddedResource Include="EditVariablesFile.resx"> + <EmbeddedResource Include="Forms\EditVariablesFile.resx"> <DependentUpon>EditVariablesFile.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> Deleted: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSaveVariables.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSaveVariables.cs 2008-01-20 15:12:37 UTC (rev 1287) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSaveVariables.cs 2008-01-20 15:49:40 UTC (rev 1288) @@ -1,74 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows.Forms; - -namespace Commands -{ - - /// <summary> - /// Save Variables macro command. - /// </summary> - public class CommandSaveVariables : Command - { - - #region Constructors - - /// <summary> - /// Initializes a new instance of the <see cref="CommandSaveVariables"/> class. - /// </summary> - public CommandSaveVariables() { InitParameters(1); } - - /// <summary> - /// Initializes a new instance of the <see cref="CommandSaveVariables"/> class. - /// </summary> - /// <param name="parameters">The parameters.</param> - public CommandSaveVariables(string[] parameters) : base(parameters) { } - - #endregion Constructors - - #region Implementation - - /// <summary> - /// Gets the category of this command. - /// </summary> - /// <returns>The category of this command.</returns> - public override string GetCategory() { return Processor.CategoryMacro; } - - /// <summary> - /// Gets the user interface text. - /// </summary> - /// <returns>User interface text.</returns> - public override string GetUserInterfaceText() { return "Save Variables"; } - - /// <summary> - /// Edit this command. - /// </summary> - /// <param name="parent">The parent window.</param> - /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> - public override bool Edit(IWin32Window parent) - { - EditVariablesFile edit = new EditVariablesFile(Parameters[0]); - if (edit.ShowDialog(parent) == DialogResult.OK) - { - Parameters[0] = edit.FileName; - return true; - } - - return false; - } - - /// <summary> - /// Execute this command. - /// </summary> - /// <param name="variables">The variable list of the calling code.</param> - public override void Execute(VariableList variables) - { - variables.Save(Parameters[0]); - } - - #endregion Implementation - - } - -} Deleted: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSetVariable.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSetVariable.cs 2008-01-20 15:12:37 UTC (rev 1287) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSetVariable.cs 2008-01-20 15:49:40 UTC (rev 1288) @@ -1,76 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows.Forms; - -namespace Commands -{ - - /// <summary> - /// Set Variable macro command. - /// </summary> - public class CommandSetVariable : Command - { - - #region Constructors - - /// <summary> - /// Initializes a new instance of the <see cref="CommandSetVariable"/> class. - /// </summary> - public CommandSetVariable() { InitParameters(2); } - - /// <summary> - /// Initializes a new instance of the <see cref="CommandSetVariable"/> class. - /// </summary> - /// <param name="parameters">The parameters.</param> - public CommandSetVariable(string[] parameters) : base(parameters) { } - - #endregion Constructors - - #region Implementation - - /// <summary> - /// Gets the category of this command. - /// </summary> - /// <returns>The category of this command.</returns> - public override string GetCategory() { return Processor.CategoryMacro; } - - /// <summary> - /// Gets the user interface text. - /// </summary> - /// <returns>User interface text.</returns> - public override string GetUserInterfaceText() { return "Set Variable"; } - - /// <summary> - /// Edit this command. - /// </summary> - /// <param name="parent">The parent window.</param> - /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> - public override bool Edit(IWin32Window parent) - { - EditSetVariable edit = new EditSetVariable(Parameters); - if (edit.ShowDialog(parent) == DialogResult.OK) - { - Parameters = edit.Parameters; - return true; - } - - return false; - } - - /// <summary> - /// Execute this command. - /// </summary> - /// <param name="variables">The variable list of the calling code.</param> - public override void Execute(VariableList variables) - { - string value = Processor.ReplaceSpecial(Parameters[1]); - - variables.SetVariable(Parameters[0], value); - } - - #endregion Implementation - - } - -} Deleted: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandStringOperation.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandStringOperation.cs 2008-01-20 15:12:37 UTC (rev 1287) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandStringOperation.cs 2008-01-20 15:49:40 UTC (rev 1288) @@ -1,106 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows.Forms; - -namespace Commands -{ - - /// <summary> - /// String Operation macro command. - /// </summary> - public class CommandStringOperation : Command - { - - #region String Operations - - internal const string StrOpConcatenate = "Join"; - internal const string StrOpTrim = "Trim"; - internal const string StrOpUpper = "Upper Case"; - internal const string StrOpLower = "Lower Case"; - - // TODO: Add more string operations - - //internal const string StrOpTrimStart = "Trim Start (Input 1)"; - //internal const string StrOpTrimEnd = "Trim End (Input 1)"; - //internal const string StrOpLeft = "Left (Input 1 by Input 2)"; - //internal const string StrOpRight = "Right (Input 1 by Input 2)"; - - #endregion String Operations - - #region Constructors - - /// <summary> - /// Initializes a new instance of the <see cref="CommandStringOperation"/> class. - /// </summary> - public CommandStringOperation() { InitParameters(4); } - - /// <summary> - /// Initializes a new instance of the <see cref="CommandStringOperation"/> class. - /// </summary> - /// <param name="parameters">The parameters.</param> - public CommandStringOperation(string[] parameters) : base(parameters) { } - - #endregion Constructors - - #region Implementation - - /// <summary> - /// Gets the category of this command. - /// </summary> - /// <returns>The category of this command.</returns> - public override string GetCategory() { return Processor.CategoryMacro; } - - /// <summary> - /// Gets the user interface text. - /// </summary> - /// <returns>User interface text.</returns> - public override string GetUserInterfaceText() { return "String Operation"; } - - /// <summary> - /// Edit this command. - /// </summary> - /// <param name="parent">The parent window.</param> - /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> - public override bool Edit(IWin32Window parent) - { - EditStringOperation edit = new EditStringOperation(Parameters); - if (edit.ShowDialog(parent) == DialogResult.OK) - { - Parameters = edit.Parameters; - return true; - } - - return false; - } - - /// <summary> - /// Execute this command. - /// </summary> - /// <param name="variables">The variable list of the calling code.</param> - public override void Execute(VariableList variables) - { - string input1 = Processor.ReplaceSpecial(Parameters[1]); - string input2 = Processor.ReplaceSpecial(Parameters[2]); - - string output = String.Empty; - - switch (Parameters[0]) - { - case StrOpConcatenate: output = input1 + input2; break; - case StrOpTrim: output = input1.Trim(); break; - case StrOpUpper: output = input1.ToUpper(); break; - case StrOpLower: output = input1.ToLower(); break; - - default: - throw new CommandStructureException(String.Format("Invalid String Operation: {0}", Parameters[0])); - } - - variables.SetVariable(Parameters[3], output); - } - - #endregion Implementation - - } - -} Deleted: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSwapVariables.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSwapVariables.cs 2008-01-20 15:12:37 UTC (rev 1287) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSwapVariables.cs 2008-01-20 15:49:40 UTC (rev 1288) @@ -1,78 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows.Forms; - -namespace Commands -{ - - /// <summary> - /// Swap Variables macro command. - /// </summary> - public class CommandSwapVariables : Command - { - - #region Constructors - - /// <summary> - /// Initializes a new instance of the <see cref="CommandSwapVariables"/> class. - /// </summary> - public CommandSwapVariables() { InitParameters(2); } - - /// <summary> - /// Initializes a new instance of the <see cref="CommandSwapVariables"/> class. - /// </summary> - /// <param name="parameters">The parameters.</param> - public CommandSwapVariables(string[] parameters) : base(parameters) { } - - #endregion Constructors - - #region Implementation - - /// <summary> - /// Gets the category of this command. - /// </summary> - /// <returns>The category of this command.</returns> - public override string GetCategory() { return Processor.CategoryMacro; } - - /// <summary> - /// Gets the user interface text. - /// </summary> - /// <returns>User interface text.</returns> - public override string GetUserInterfaceText() { return "Swap Variables"; } - - /// <summary> - /// Edit this command. - /// </summary> - /// <param name="parent">The parent window.</param> - /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> - public override bool Edit(IWin32Window parent) - { - EditSwapVariables edit = new EditSwapVariables(Parameters); - if (edit.ShowDialog(parent) == DialogResult.OK) - { - Parameters = edit.Parameters; - return true; - } - - return false; - } - - /// <summary> - /// Execute this command. - /// </summary> - /// <param name="variables">The variable list of the calling code.</param> - public override void Execute(VariableList variables) - { - string value0 = variables.GetVariable(Parameters[0]); - string value1 = variables.GetVariable(Parameters[1]); - - variables.SetVariable(Parameters[0], value1); - variables.SetVariable(Parameters[1], value0); - } - - #endregion Implementation - - } - -} Deleted: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSwitch.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSwitch.cs 2008-01-20 15:12:37 UTC (rev 1287) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSwitch.cs 2008-01-20 15:49:40 UTC (rev 1288) @@ -1,94 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Windows.Forms; -using System.Xml; -using System.Xml.Serialization; - -namespace Commands -{ - - /// <summary> - /// Switch Statement macro command. - /// </summary> - public class CommandSwitch : Command - { - - #region Constructors - - /// <summary> - /// Initializes a new instance of the <see cref="CommandSwitch"/> class. - /// </summary> - public CommandSwitch() { InitParameters(3); } - - /// <summary> - /// Initializes a new instance of the <see cref="CommandSwitch"/> class. - /// </summary> - /// <param name="parameters">The parameters.</param> - public CommandSwitch(string[] parameters) : base(parameters) { } - - #endregion Constructors - - #region Implementation - - /// <summary> - /// Gets the category of this command. - /// </summary> - /// <returns>The category of this command.</returns> - public override string GetCategory() { return Processor.CategoryMacro; } - - /// <summary> - /// Gets the user interface text. - /// </summary> - /// <returns>User interface text.</returns> - public override string GetUserInterfaceText() { return "Switch Statement"; } - - /// <summary> - /// Edit this command. - /// </summary> - /// <param name="parent">The parent window.</param> - /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> - public override bool Edit(IWin32Window parent) - { - EditSwitch edit = new EditSwitch(Parameters); - if (edit.ShowDialog(parent) == DialogResult.OK) - { - Parameters = edit.Parameters; - return true; - } - - return false; - } - - #endregion Implementation - - #region Static Methods - - /// <summary> - /// This method will determine which (if any) case in a Switch Statement evaluates true. - /// </summary> - /// <param name="value">The value.</param> - /// <param name="casesXml">The cases XML.</param> - /// <returns>Label to goto (null for default).</returns> - public static string Evaluate(string value, string casesXml) - { - string[] cases; - using (StringReader stringReader = new StringReader(casesXml)) - { - XmlSerializer xmlSerializer = new XmlSerializer(typeof(string[])); - cases = (string[])xmlSerializer.Deserialize(stringReader); - } - - for (int index = 0; index < cases.Length; index += 2) - if (value.Equals(cases[index], StringComparison.OrdinalIgnoreCase)) - return cases[index + 1]; - - return null; - } - - #endregion Static Methods - - } - -} Added: trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/CommandBlastIR.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/CommandBlastIR.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/CommandBlastIR.cs 2008-01-20 15:49:40 UTC (rev 1288) @@ -0,0 +1,102 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Windows.Forms; + +using IrssUtils; + +namespace Commands +{ + + /// <summary> + /// Blast IR macro command. + /// </summary> + public class CommandBlastIR : Command + { + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="CommandBlastIR"/> class. + /// </summary> + public CommandBlastIR() { InitParameters(2); } + + /// <summary> + /// Initializes a new instance of the <see cref="CommandBlastIR"/> class. + /// </summary> + /// <param name="parameters">The parameters.</param> + public CommandBlastIR(string[] parameters) : base(parameters) { } + + #endregion Constructors + + #region Implementation + + /// <summary> + /// Gets the category of this command. + /// </summary> + /// <returns>The category of this command.</returns> + public override string GetCategory() { return Processor.CategoryHidden; } + + /// <summary> + /// Gets the user interface text. + /// </summary> + /// <returns>User interface text.</returns> + public override string GetUserInterfaceText() { return "Blast IR"; } + + /// <summary> + /// Gets the user display text. + /// </summary> + /// <returns>The user display text.</returns> + public override string GetUserDisplayText() + { + string fileDir = Path.GetDirectoryName(Parameters[0]); + if (!fileDir.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.OrdinalIgnoreCase)) + fileDir += Path.DirectorySeparatorChar; + + string fileName = Path.GetFileNameWithoutExtension(Parameters[0]); + + if (fileDir.StartsWith(Common.FolderIRCommands, StringComparison.OrdinalIgnoreCase)) + fileDir = fileDir.Substring(Common.FolderIRCommands.Length); + else if (fileDir.StartsWith(Common.FolderAppData, StringComparison.OrdinalIgnoreCase)) + fileDir = fileDir.Substring(Common.FolderAppData.Length); + + return String.Format("{0} ({1}, {2})", GetUserInterfaceText(), Path.Combine(fileDir, fileName), Parameters[1]); + } + + /// <summary> + /// Edit this command. + /// </summary> + /// <param name="parent">The parent window.</param> + /// <param name="blastIrDelegate">The blast ir delegate.</param> + /// <param name="blastPorts">The blast ports.</param> + /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> + public bool Edit(IWin32Window parent, BlastIrDelegate blastIrDelegate, string[] blastPorts) + { + EditBlastIR edit = new EditBlastIR(blastIrDelegate, blastPorts, Parameters); + if (edit.ShowDialog(parent) == DialogResult.OK) + { + Parameters = edit.Parameters; + return true; + } + + return false; + } + + /// <summary> + /// Execute this command. + /// </summary> + /// <param name="blastIrDelegate">The blast ir delegate.</param> + public void Execute(BlastIrDelegate blastIrDelegate) + { + string irFile = Parameters[0] + Common.FileExtensionIR; + string port = Parameters[1]; + + blastIrDelegate(irFile, port); + } + + #endregion Implementation + + } + +} Added: trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/CommandCallMacro.cs =================================================================== --- trunk/plugins/IR Server Suite/C... [truncated message content] |