static void InitImp (Atom input, NumericOptions options=null) { input.SetAttribute ("autonumeric", true); input.SetAttribute ("data-type", "numeric"); input.Style.CssText = "text-align:right;"; jQuery.FromElement (input).Execute ("autoNumeric", "init", options); }
static void Init (Atom input, NumericOptions options=null) { if (input.HasAttribute ("autonumeric")) return; InitImp (input, options); }
static void Update (Atom input, NumericOptions options) { if (!input.HasAttribute ("autonumeric")) InitImp (input, options); else jQuery.FromElement (input).Execute ("autoNumeric", "update", options); }
public static AutoNumeric AutoNumeric(Atom input, NumericOptions options=null) { Init (input, options); dynamic methods = new {}; methods["get"]= (Func<bool, decimal?>)( (r)=> GetValue(input,false) ); methods["set"]= (Action< decimal?>)( (v)=> SetValue(input,v) ); methods["init"]= (Action<NumericOptions>)( o=> Init(input,o) ); methods["update"]= (Action<NumericOptions>)( o=> Update(input,o) ); methods["getSettings"]= (Func<NumericOptions>)( ()=> GetSettings(input) ); input.SetToAtomProperty ("autoNumeric",(object) methods); return UI.Cast<AutoNumeric> (input); }
public AutoNumeric(Element atom, NumericOptions options=null) { }
public void Update (NumericOptions options) { }