public ASN1SequenceOfMetadata(String name, bool isSetOf, Type itemClass, ICustomAttributeProvider seqFieldAnnotatedElem)
     : base(name)
 {
     this.isSetOf = isSetOf;
     this.itemClass = itemClass;
     Type paramType = itemClass.GetGenericArguments()[0];
     this.itemClassMetadata = new ASN1PreparedElementData(paramType);
     if (this.itemClassMetadata.TypeMetadata != null)
         this.itemClassMetadata.TypeMetadata.setParentAnnotated(seqFieldAnnotatedElem);
 }
        private void setupConstructed(Type objectClass)
        {
            int count = 0;

            PropertyInfo[] srcFields = null;
            if (typeMeta != null && typeMeta is ASN1SequenceMetadata && ((ASN1SequenceMetadata)typeMeta).IsSet)
            {
                SortedList <int, PropertyInfo> fieldOrder = CoderUtils.getSetOrder(objectClass);
                srcFields = new PropertyInfo[fieldOrder.Count];
                fieldOrder.Values.CopyTo(srcFields, 0);
                count = srcFields.Length;
            }
            else
            {
                srcFields = objectClass.GetProperties(); //objectClass.getDeclaredFields();
                foreach (PropertyInfo field in srcFields)
                {
                    if (!field.PropertyType.Equals(typeof(IASN1PreparedElementData)))
                    {
                        count++;
                    }
                }
            }

            properties         = new PropertyInfo[count];
            propertiesMetadata = new ASN1PreparedElementData[count];
            int idx = 0;

            foreach (PropertyInfo field in srcFields)
            {
                if (!field.PropertyType.Equals(typeof(IASN1PreparedElementData)))
                {
                    properties[idx]         = field;
                    propertiesMetadata[idx] = new ASN1PreparedElementData(objectClass, field);

                    if (properties[idx].Name.Equals("Value"))
                    {
                        setValueField(field, propertiesMetadata[idx]);
                    }
                    idx++;
                }
            }
        }
 public void setValueField(PropertyInfo valueProperty, ASN1PreparedElementData valuePropertyMeta)
 {
     this.valueProperty = valueProperty;
     this.valueMetadata = valuePropertyMeta;
 }
        private void setupConstructed(Type objectClass)
        {
            int count = 0;
            PropertyInfo[] srcFields = null;
            if(typeMeta !=null && typeMeta is ASN1SequenceMetadata && ((ASN1SequenceMetadata)typeMeta).IsSet) {
                SortedList<int, PropertyInfo> fieldOrder = CoderUtils.getSetOrder(objectClass);
                srcFields = new PropertyInfo[fieldOrder.Count];
                fieldOrder.Values.CopyTo(srcFields, 0);
                count = srcFields.Length;
            }
            else {
                srcFields = objectClass.GetProperties(); //objectClass.getDeclaredFields();
                foreach(PropertyInfo field in srcFields) {
                    if (!field.PropertyType.Equals(typeof(IASN1PreparedElementData)))
                    {
                        count++;
                    }
                }
            }

            properties = new PropertyInfo[count];
            propertiesMetadata = new ASN1PreparedElementData[count];
            int idx=0;
            foreach(PropertyInfo field in srcFields) {
                if (!field.PropertyType.Equals(typeof(IASN1PreparedElementData)))
                {
                    properties[idx] = field;
                    propertiesMetadata[idx] = new ASN1PreparedElementData(objectClass, field);

                    if (properties[idx].Name.Equals("Value"))
                    {
                        setValueField(field, propertiesMetadata[idx]);
                    }
                    idx++;
                }
            }
        }
 public void setValueField(PropertyInfo valueProperty, ASN1PreparedElementData valuePropertyMeta)
 {
     this.valueProperty = valueProperty;
     this.valueMetadata = valuePropertyMeta;
 }