internal CheckItem(IJsonCheckItem json, string checkListId, TrelloAuthorization auth = null)
        {
            Id       = json.Id;
            _context = new CheckItemContext(Id, checkListId, auth);
            _context.Synchronized += Synchronized;

            _checkList = new Field <CheckList>(_context, nameof(CheckList));
            _checkList.AddRule(NotNullRule <CheckList> .Instance);
            _name = new Field <string>(_context, nameof(Name));
            _name.AddRule(NotNullOrWhiteSpaceRule.Instance);
            _position = new Field <Position>(_context, nameof(Position));
            _position.AddRule(NotNullRule <Position> .Instance);
            _position.AddRule(PositionRule.Instance);
            _state = new Field <CheckItemState?>(_context, nameof(State));
            _state.AddRule(NullableHasValueRule <CheckItemState> .Instance);
            _state.AddRule(EnumerationRule <CheckItemState?> .Instance);

            TrelloConfiguration.Cache.Add(this);

            _context.Merge(json);
        }
Exemple #2
0
 void IMergeJson <IJsonCheckItem> .Merge(IJsonCheckItem json, bool overwrite)
 {
     _context.Merge(json, overwrite);
 }
 void IMergeJson <IJsonCheckItem> .Merge(IJsonCheckItem json)
 {
     _context.Merge(json);
 }