using System;
namespace Yavsc.Model.FrontOffice
{
///
/// Text input.
///
public class TextInput:FormInput
{
#region implemented abstract members of FormInput
private string tpe = null;
///
/// Gets the type.
///
/// The type.
public override string Type {
get {
return tpe;
}
}
#endregion
///
/// Initializes a new instance of the class.
///
public TextInput ()
{
tpe = "text";
}
///
/// Initializes a new instance of the class.
///
/// Text.
public TextInput (string txt)
{
tpe = "text";
text = txt;
}
///
/// Initializes a new instance of the class.
///
/// Type.
/// Text.
public TextInput (string type, string txt)
{
tpe = type;
text = txt;
}
string text = null;
/// T.
public static implicit operator string(TextInput t)
{
return t.text;
}
/// T.
public static implicit operator TextInput(string t)
{
return new TextInput(t);
}
///
/// Gets or sets the default value.
///
/// The default value.
public string DefaultValue {
get {
return text;
}
set {
text = (string) value;
}
}
private bool multiline = false;
///
/// Gets or sets a value indicating whether this multi line.
///
/// true if multi line; otherwise, false.
public bool MultiLine { get { return multiline; } set { multiline = value; } }
///
/// html representation of this input.
///
/// The html.
public override string ToHtml ()
{
return MultiLine?
string.Format ("", Id,Name,DefaultValue)
: string.Format ("", Id,Name,DefaultValue);
}
}
}