private static CustomField _BuildCustomField(IJsonCustomField json, TrelloAuthorization auth, object[] parameters) { var cardId = (string)parameters[0]; switch (json.Type) { case CustomFieldType.Text: return(new TextField(json, cardId, auth)); case CustomFieldType.DropDown: return(new DropDownField(json, cardId, auth)); case CustomFieldType.CheckBox: return(new CheckBoxField(json, cardId, auth)); case CustomFieldType.DateTime: return(new DateTimeField(json, cardId, auth)); case CustomFieldType.Number: return(new NumberField(json, cardId, auth)); default: return(null); } }
internal DateTimeField(IJsonCustomField json, string cardId, TrelloAuthorization auth) : base(json, cardId, auth) { _value = new Field <DateTime?>(Context, nameof(IJsonCustomField.Date)); }
internal TextField(IJsonCustomField json, string cardId, TrelloAuthorization auth) : base(json, cardId, auth) { _value = new Field <string>(Context, nameof(IJsonCustomField.Text)); }
internal DropDownField(IJsonCustomField json, string cardId, TrelloAuthorization auth) : base(json, cardId, auth) { _value = new Field <DropDownOption>(Context, nameof(IJsonCustomField.Selected)); }
internal NumberField(IJsonCustomField json, string cardId, TrelloAuthorization auth) : base(json, cardId, auth) { _value = new Field <double?>(Context, nameof(IJsonCustomField.Number)); }
internal CheckBoxField(IJsonCustomField json, string cardId, TrelloAuthorization auth) : base(json, cardId, auth) { _value = new Field <bool?>(Context, nameof(IJsonCustomField.Checked)); }