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);
            }
        }
예제 #2
0
 internal DateTimeField(IJsonCustomField json, string cardId, TrelloAuthorization auth)
     : base(json, cardId, auth)
 {
     _value = new Field <DateTime?>(Context, nameof(IJsonCustomField.Date));
 }
예제 #3
0
 internal TextField(IJsonCustomField json, string cardId, TrelloAuthorization auth)
     : base(json, cardId, auth)
 {
     _value = new Field <string>(Context, nameof(IJsonCustomField.Text));
 }
예제 #4
0
 internal DropDownField(IJsonCustomField json, string cardId, TrelloAuthorization auth)
     : base(json, cardId, auth)
 {
     _value = new Field <DropDownOption>(Context, nameof(IJsonCustomField.Selected));
 }
예제 #5
0
 internal NumberField(IJsonCustomField json, string cardId, TrelloAuthorization auth)
     : base(json, cardId, auth)
 {
     _value = new Field <double?>(Context, nameof(IJsonCustomField.Number));
 }
예제 #6
0
 internal CheckBoxField(IJsonCustomField json, string cardId, TrelloAuthorization auth)
     : base(json, cardId, auth)
 {
     _value = new Field <bool?>(Context, nameof(IJsonCustomField.Checked));
 }