/* * Box Social™ * http://boxsocial.net/ * Copyright © 2007, David Lachlan Smith * * $Id:$ * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ using System; using System.Collections; using System.Collections.Generic; using System.Text; using System.Web; namespace BoxSocial.Forms { public class ScriptProperty { private string onchange; private string onkeypress; private string onkeydown; private string onkeyup; private string onfocus; private string onblur; public string OnChange { get { return onchange; } set { onchange = value; } } public string OnKeyPress { get { return onkeypress; } set { onkeypress = value; } } public string OnKeyDown { get { return onkeydown; } set { onkeydown = value; } } public string OnKeyUp { get { return onkeyup; } set { onkeyup = value; } } public string OnFocus { get { return onfocus; } set { onfocus = value; } } public string OnBlur { get { return onblur; } set { onblur = value; } } public override string ToString() { StringBuilder sb = new StringBuilder(); if (!string.IsNullOrEmpty(onchange)) { sb.Append(" onchange=\""); sb.Append(onchange); sb.Append("\""); } if (!string.IsNullOrEmpty(onkeypress)) { sb.Append(" onkeypress=\""); sb.Append(onkeypress); sb.Append("\""); } if (!string.IsNullOrEmpty(onkeyup)) { sb.Append(" onkeyup=\""); sb.Append(onkeyup); sb.Append("\""); } if (!string.IsNullOrEmpty(onkeydown)) { sb.Append(" onkeydown=\""); sb.Append(onkeydown); sb.Append("\""); } if (!string.IsNullOrEmpty(onfocus)) { sb.Append(" onfocus=\""); sb.Append(onfocus); sb.Append("\""); } if (!string.IsNullOrEmpty(onblur)) { sb.Append(" onblur=\""); sb.Append(onblur); sb.Append("\""); } return sb.ToString(); } } }