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));
 }