public static FieldValue[] FieldValues(Field[] fields) { FieldValue[] ret = (from f in fields select f.GetDefaultValue()).ToArray(); return ret; }
public static Field GetByName(Field[] fields, string name) { return (from f in fields where f.name == name select f).SingleOrDefault(); }
public bool edit() { current_editing_account = this; GenericEditor editor = new GenericEditor(); List<FieldValue> vals = new List<FieldValue>(values); var enabled_field = new Field(Field.FIELD_TYPE.Bool, "Account Enabled","enabled","",enabled ? "true" : "false",""); var enabled_val = enabled_field.GetDefaultValue(); vals.Insert(0, enabled_val); editor.Init("Editing Account", vals); editor.ShowDialog(); if (editor.DialogResult == true){ if (enabled_val.value == "true") enabled = true; else enabled = false; ReloadAccount(); } else return false; return true; }