using System;
using System.Collections.Generic;
using System.Text;
namespace Systin.Library{
public sealed class Instruction
{
#region Fields And Properties
private string m_InstructionContent;
/// <summary>
/// Gets the content of the instruction.
/// </summary>
/// <value>The content of the instruction.</value>
public string InstructionContent
{
get
{
return m_InstructionContent;
}
}
#endregion
#region Constructor
private Instruction() { }
#endregion
#region Internal Methods
/// <summary>
/// Creates an instruction object.
/// </summary>
/// <param name="p">The p.</param>
/// <returns><seealso cref="Instruction"/>A new Instruction object</returns>
public static Instruction NewInstruction(string p)
{
//If the parameter is null throw an Argument null exception
if (p == null)
{
throw new ArgumentNullException("instruction is null");
}
//If the argument is not a valid stright throw an argumentexception
if (p.Length == 0)
{
throw new ArgumentException("No Instruction given");
}
//create a new instruction object to copy the input parameters to
Instruction instruction = new Instruction();
instruction.m_InstructionContent = p;
return instruction;
}
#endregion
}
}
|