42 lines
1.5 KiB
C#
42 lines
1.5 KiB
C#
using System;
|
|
using System.Windows.Forms;
|
|
|
|
namespace TBF.UI.Item
|
|
{
|
|
public interface IEditItem
|
|
{
|
|
/// <summary>
|
|
/// Returns name of the parameter to be displayed as a column header, etc.
|
|
/// </summary>
|
|
/// <returns>Name of the parameter</returns>
|
|
string Name();
|
|
|
|
/// <summary>
|
|
/// Returns embedded control (Textbox, ComboBox, etc.).
|
|
/// </summary>
|
|
/// <returns>Embedded control</returns>
|
|
Control EmbeddedControl();
|
|
|
|
/// <summary>
|
|
/// Converts the embedded variable value to its string representation.
|
|
/// </summary>
|
|
/// <returns>String representation of the embedded variable</returns>
|
|
string Print();
|
|
|
|
/// <summary>
|
|
/// Updates the associated embedded variable from the given string representation.
|
|
/// </summary>
|
|
/// <param name="strValue">String representation of the new value</param>
|
|
void Update(string strValue);
|
|
|
|
/// <summary>
|
|
/// Determines whether the edited value (string representation) is valid.
|
|
/// If Validate(..) returns true, then Update(..) has to correctly update the embedded variable.
|
|
/// </summary>
|
|
/// <param name="strValue">Edited value</param>
|
|
/// <param name="message">Explanation message in case Validate() returns false</param>
|
|
/// <returns>true = string is OK, false = string is wrong (see 'message')</returns>
|
|
bool Validate(string strValue, out string message);
|
|
}
|
|
}
|