Ejemplo n.º 1
0
        protected override void CreateVisualElements(SerializedProperty property)
        {
            if (FieldsContainer.childCount > 0)
            {
                FieldsContainer.Clear();
            }
            var customPropertyType = IsArrayAndNotString ? null : GetCustomElementTypeForProperty(property);

            if (customPropertyType != null)
            {
                var instance = Activator.CreateInstance(customPropertyType) as BasePropertyFieldElement;
                instance.SetProperty(property, true);
                AddSubfield(instance);
            }
            else
            {
                if (!IsComplex)
                {
                    CreateSimpleView(property);
                }
                else
                {
                    CreateComplexView(property);
                }
            }
        }
Ejemplo n.º 2
0
        public void Clear_ClearList_ReturnEmptyList()
        {
            var fieldsContainer = new FieldsContainer();

            fieldsContainer.Add(FieldName, Value);

            fieldsContainer.Clear();

            fieldsContainer.Fields.Should().BeEmpty();
        }
Ejemplo n.º 3
0
        private List <NotificationMessage> GetDataFromDb()
        {
            var ret = new List <NotificationMessage>();
            var paramsInitialCounter = _params.InitialCounter;
            var recsToTake           = RowsHelper.MaxRowsToGet(Count, ref paramsInitialCounter);

            _params.InitialCounter = paramsInitialCounter;
            if (recsToTake.Equals(0))
            {
                _counterReader.Save(_params.InitialCounter);
                return(ret);
            }
            _container.Clear();

            foreach (var r in _db[_params.Schema][_params.TableName].All().Take(recsToTake).OrderByDescending(_db[_params.Schema][_params.TableName][_params.OrderByColumnName]))
            {
                _container.Clear();
                GetColumnsByColumnsNames(r);

                if (_validator?.Validate(_container) == true)
                {
                    continue;
                }
                if (_aggregator?.AggregateIfPossible(ret, _container) != false)
                {
                    continue;
                }

                ret.Add(CreateMessage());
            }

            _counterReader.Save(_params.InitialCounter);

            ret.Reverse();
            return(ret);
        }