internal void LoadFromXml(XmlNode node) { try { this.FSourceNode = node; this.FPurpose = (MetadataPropertyPurpose)XmlUtils.GetEnumAttr(node, "purpose", MetadataProperty.FPurposeNames); this.FCaption = XmlUtils.GetAttr(node, "caption", this.FCaption); this.FDataField = XmlUtils.GetAttr(node, "data-field", this.FDataField); this.FDataTypeName = XmlUtils.GetAttr(node, "data-type", this.FDataTypeName); this.FDataType = InDbUtils.InMetaDataTypeToDataType(this.FDataTypeName); this.FDataLength = XmlUtils.GetIntAttr(node, "data-length", this.FDataLength); this.FInitialValue = XmlUtils.GetAttr(node, "default-value", this.FInitialValue); this.FIsExtension = XmlUtils.GetBoolAttr(node, "is-virtual", this.FIsExtension); this.FExtensionClass = XmlUtils.GetAttr(node, "virtual-aggregation", this.FExtensionClass); this.FExtensionProperty = XmlUtils.GetAttr(node, "virtual-ref-property", this.FExtensionProperty); if (this.FDataField.Length == 0) { this.FDataField = this.Name; } if (this.FDataType == DataType.Unknown) { throw new MetadataException("Не задан тип данных"); } this.FMemberName = XmlUtils.GetAttr(node, "prog-id", this.Name); this.LookupValues.LoadFromXml(node); } catch (Exception ex) { throw new MetadataException(string.Format("Ошибка загрузки метаданных свойства {0}", (object)this.Name), ex); } }
public MetadataProperty(MetadataClass cls, string name, int index) { this.Class = cls; this.Name = name; this.Index = index; this.FPurpose = MetadataPropertyPurpose.Data; this.FDataType = DataType.Unknown; this.LookupValues = new MetadataLookupValueList(); }