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); }
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); }
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); }
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); }
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); } }
static APRptReferDef() { columnIdProp = new APXmlProperty("columnId", typeof(string), "", APXmlPropertyOptions.IsRequired | APXmlPropertyOptions.IsKey); properties = new APXmlPropertyCollection(); properties.Add(columnIdProp); }
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); } }
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); }
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); }
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; }