tbf/TestBenchFramework/Boxes/IBox.cs
2014-07-31 17:04:09 +02:00

55 lines
1.4 KiB
C#

using System;
using System.Text;
namespace TBF.Boxes
{
interface IBox
{
/// <summary>
/// Box name
/// </summary>
string Name { get; }
/// <summary>
/// Validity flag: true = the box value is valid
/// </summary>
bool Valid { get; }
/// <summary>
/// Set the name and the format for a conversion to a string.
/// In the most complex case the conversion is:
/// string.Format(formatEx, val.ToString(format))
/// If the value is invalid, the conversion result is 'formatInvalid'.
/// </summary>
void SetFormat(string name, string format, string formatInvalid, string formatEx);
/// <summary>
/// Set only the basic format. 'formatInvalid' is "---".
/// </summary>
void SetFormat(string format);
/// <summary>
/// Clear the box value and the valid flag
/// </summary>
void Clear();
/// <summary>
/// Convert the box value to a string representation
/// </summary>
string ToString();
/// <summary>
/// Validate the string representation of the box value
/// </summary>
/// <param name="strVal">String representation of the parameter</param>
/// <returns>true = string is OK, false = string is wrong (see 'message')</returns>
bool ValidateParam(string strVal);
/// <summary>
/// Update the parameter from a string
/// </summary>
/// <param name="strVal">String representation of the box value</param>
void UpdateParam(string strVal);
}
}