2010-10-19 13:42:59 +00:00
using System ;
using System.Collections.Generic ;
using System.Linq ;
using System.Web ;
using umbraco.cms.businesslogic.datatype ;
namespace umbraco.editorControls.SettingControls
{
2013-10-21 18:36:46 +11:00
[Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")]
2010-10-19 13:42:59 +00:00
public class CheckBox : DataEditorSettingType
{
private System . Web . UI . WebControls . CheckBox cb = new System . Web . UI . WebControls . CheckBox ();
2011-07-26 08:21:46 -02:00
private string _val = string . Empty ;
2010-10-19 13:42:59 +00:00
public override string Value
{
get
{
return cb . Checked . ToString ();
}
set
{
2011-07-26 08:21:46 -02:00
if (! string . IsNullOrEmpty ( value ))
_val = value ;
2010-10-19 13:42:59 +00:00
}
}
public override System . Web . UI . Control RenderControl ( DataEditorSetting sender )
{
cb . ID = sender . GetName ();
2011-07-26 08:21:46 -02:00
if ( string . IsNullOrEmpty ( _val ) && ! string . IsNullOrEmpty ( DefaultValue ) && DefaultValue == true . ToString ())
cb . Checked = true ;
else if ( _val == true . ToString ())
cb . Checked = true ;
2010-10-19 13:42:59 +00:00
return cb ;
}
}
}