Exemplo n.º 1
0
		static APRptConditionDef()
		{
			logicProp = new APXmlProperty("logic", typeof(string), "");
			rpnProp = new APXmlProperty("rpn", typeof(string), "");
			filtersProp = new APXmlProperty("", typeof(APRptFilterDefCollection), null, APXmlPropertyOptions.IsDefaultCollection);

			properties = new APXmlPropertyCollection();
			properties.Add(logicProp);
			properties.Add(rpnProp);
			properties.Add(filtersProp);
		}
Exemplo n.º 2
0
		static APRptOrderDef()
		{
			columnIdProp = new APXmlProperty("columnId", typeof(string), "", APXmlPropertyOptions.IsRequired | APXmlPropertyOptions.IsKey);
			accordingProp = new APXmlProperty("according", typeof(APSqlOrderAccording), APSqlOrderAccording.Asc,
				new GenericEnumAPConverter(typeof(APSqlOrderAccording)),
				APCVHelper.DefaultValidator,
				APXmlPropertyOptions.IsRequired);

			properties = new APXmlPropertyCollection();
			properties.Add(columnIdProp);
			properties.Add(accordingProp);
		}
Exemplo n.º 3
0
		static APRptViewDef()
		{
			nameProp = new APXmlProperty("name", typeof(string), "");
			refersProp = new APXmlProperty("refers", typeof(APRptReferDefCollection));
			ordersProp = new APXmlProperty("orders", typeof(APRptOrderDefCollection));
			conditionProp = new APXmlProperty("condition", typeof(APRptConditionDef));

			properties = new APXmlPropertyCollection();
			properties.Add(nameProp);
			properties.Add(refersProp);
			properties.Add(ordersProp);
			properties.Add(conditionProp);
		}
Exemplo n.º 4
0
		static APRptFilterDef()
		{
			serialProp = new APXmlProperty("serial", typeof(string), "", APXmlPropertyOptions.IsRequired | APXmlPropertyOptions.IsKey);
			columnIdProp = new APXmlProperty("columnId", typeof(string), "", APXmlPropertyOptions.IsRequired);
			comparatorProp = new APXmlProperty("comparator", typeof(APRptFilterComparator), APRptFilterComparator.Equals,
				new GenericEnumAPConverter(typeof(APRptFilterComparator)),
				APCVHelper.DefaultValidator,
				APXmlPropertyOptions.IsRequired);
			valuesProp = new APXmlProperty("values", typeof(string), "");

			properties = new APXmlPropertyCollection();
			properties.Add(serialProp);
			properties.Add(columnIdProp);
			properties.Add(comparatorProp);
			properties.Add(valuesProp);
		}
Exemplo n.º 5
0
		public APXmlElementMap(Type type)
		{
			_properties = new APXmlPropertyCollection();

			_collectionAttribute = Attribute.GetCustomAttribute(type, typeof(APXmlCollectionAttribute)) as APXmlCollectionAttribute;

			PropertyInfo[] props = type.GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance);

			foreach (PropertyInfo prop in props)
			{
				APXmlPropertyAttribute attr = Attribute.GetCustomAttribute(prop, typeof(APXmlPropertyAttribute)) as APXmlPropertyAttribute;
				if (attr == null)
					continue;
				string name = attr.Name != null ? attr.Name : prop.Name;

				APValidatorAttribute validatorAttr = Attribute.GetCustomAttribute(prop, typeof(APValidatorAttribute)) as APValidatorAttribute;
				APValidatorBase validator = validatorAttr != null ? validatorAttr.ValidatorInstance : null;

				TypeConverterAttribute convertAttr = Attribute.GetCustomAttribute(prop, typeof(TypeConverterAttribute)) as TypeConverterAttribute;
				TypeConverter converter = convertAttr != null ? (TypeConverter)Activator.CreateInstance(Type.GetType(convertAttr.ConverterTypeName), true) : null;

				APXmlProperty property = new APXmlProperty(name, prop.PropertyType, attr.DefaultValue, converter, validator, attr.Options);

				property.CollectionAttribute = Attribute.GetCustomAttribute(prop, typeof(APXmlCollectionAttribute)) as APXmlCollectionAttribute;
				_properties.Add(property);
			}
		}
Exemplo n.º 6
0
		static APRptReferDef()
		{
			columnIdProp = new APXmlProperty("columnId", typeof(string), "", APXmlPropertyOptions.IsRequired | APXmlPropertyOptions.IsKey);

			properties = new APXmlPropertyCollection();
			properties.Add(columnIdProp);
		}
Exemplo n.º 7
0
        public APXmlElementMap(Type type)
        {
            _properties = new APXmlPropertyCollection();

            _collectionAttribute = Attribute.GetCustomAttribute(type, typeof(APXmlCollectionAttribute)) as APXmlCollectionAttribute;

            PropertyInfo[] props = type.GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance);

            foreach (PropertyInfo prop in props)
            {
                APXmlPropertyAttribute attr = Attribute.GetCustomAttribute(prop, typeof(APXmlPropertyAttribute)) as APXmlPropertyAttribute;
                if (attr == null)
                {
                    continue;
                }
                string name = attr.Name != null ? attr.Name : prop.Name;

                APValidatorAttribute validatorAttr = Attribute.GetCustomAttribute(prop, typeof(APValidatorAttribute)) as APValidatorAttribute;
                APValidatorBase      validator     = validatorAttr != null ? validatorAttr.ValidatorInstance : null;

                TypeConverterAttribute convertAttr = Attribute.GetCustomAttribute(prop, typeof(TypeConverterAttribute)) as TypeConverterAttribute;
                TypeConverter          converter   = convertAttr != null ? (TypeConverter)Activator.CreateInstance(Type.GetType(convertAttr.ConverterTypeName), true) : null;

                APXmlProperty property = new APXmlProperty(name, prop.PropertyType, attr.DefaultValue, converter, validator, attr.Options);

                property.CollectionAttribute = Attribute.GetCustomAttribute(prop, typeof(APXmlCollectionAttribute)) as APXmlCollectionAttribute;
                _properties.Add(property);
            }
        }
Exemplo n.º 8
0
		static APRptReportDef()
		{
			nameProp = new APXmlProperty("name", typeof(string), "");
			refersProp = new APXmlProperty("refers", typeof(APRptReferDefCollection));
			ordersProp = new APXmlProperty("orders", typeof(APRptOrderDefCollection));
			groupsProp = new APXmlProperty("groups", typeof(APRptGroupDefCollection));
			conditionProp = new APXmlProperty("condition", typeof(APRptConditionDef));
			showSummaryProp = new APXmlProperty("showSummary", typeof(bool), true);
			frameColumnIdProp = new APXmlProperty("frameColumnId", typeof(string), "");
			frameBeginProp = new APXmlProperty("frameBegin", typeof(string), "");
			frameEndProp = new APXmlProperty("frameEnd", typeof(string), "");

			properties = new APXmlPropertyCollection();
			properties.Add(nameProp);
			properties.Add(refersProp);
			properties.Add(ordersProp);
			properties.Add(groupsProp);
			properties.Add(showSummaryProp);
			properties.Add(frameColumnIdProp);
			properties.Add(frameBeginProp);
			properties.Add(frameEndProp);
			properties.Add(conditionProp);
		}
Exemplo n.º 9
0
        internal APXmlPropertyCollection GetKeyProperties()
        {
            if (_keyProps != null)
            {
                return(_keyProps);
            }

            APXmlPropertyCollection tmpkeyProps = new APXmlPropertyCollection();

            foreach (APXmlProperty prop in Properties)
            {
                if (prop.IsKey)
                {
                    tmpkeyProps.Add(prop);
                }
            }

            return(_keyProps = tmpkeyProps);
        }
Exemplo n.º 10
0
		internal APXmlPropertyCollection GetKeyProperties()
		{
			if (_keyProps != null)
				return _keyProps;

			APXmlPropertyCollection tmpkeyProps = new APXmlPropertyCollection();

			foreach (APXmlProperty prop in Properties)
			{
				if (prop.IsKey)
					tmpkeyProps.Add(prop);
			}

			return _keyProps = tmpkeyProps;
		}