Exemplo n.º 1
0
        internal CustomFieldDefinition(IJsonCustomFieldDefinition json, TrelloAuthorization auth)
        {
            Id       = json.Id;
            _context = new CustomFieldDefinitionContext(Id, auth);

            _board      = new Field <IBoard>(_context, nameof(Board));
            DisplayInfo = new CustomFieldDisplayInfo(_context.DisplayInfo);
            _fieldGroup = new Field <string>(_context, nameof(FieldGroup));
            _name       = new Field <string>(_context, nameof(Name));
            _position   = new Field <Position>(_context, nameof(Position));
            _type       = new Field <CustomFieldType?>(_context, nameof(Type));

            if (auth != TrelloAuthorization.Null)
            {
                TrelloConfiguration.Cache.Add(this);
            }

            _context.Merge(json);
            _context.Synchronized += Synchronized;
        }
Exemplo n.º 2
0
        internal CustomFieldDefinition(IJsonCustomFieldDefinition json, TrelloAuthorization auth)
        {
            Id       = json.Id;
            _context = new CustomFieldDefinitionContext(Id, auth);

            _board      = new Field <IBoard>(_context, nameof(Board));
            _fieldGroup = new Field <string>(_context, nameof(FieldGroup));
            _name       = new Field <string>(_context, nameof(Name));
            _position   = new Field <Position>(_context, nameof(Position));
            _type       = new Field <CustomFieldType?>(_context, nameof(Type));

            TrelloConfiguration.Cache.Add(this);

            // we need to enumerate the collection to cache all of the values
            // ReSharper disable once ReturnValueOfPureMethodIsNotUsed
            //Options?.ToList();

            _context.Merge(json);
            _context.Synchronized += Synchronized;
        }