/////////////////////////////////////////////////////////////////////////////////////////////////// ////////////BUILD FROM MUTABLE OBJECT ////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////// #region Constructors and Destructors /// <summary> /// Initializes a new instance of the <see cref="ConstraintDataKeySetCore"/> class. /// </summary> /// <param name="mutable"> /// The mutable. /// </param> /// <param name="parent"> /// The parent. /// </param> public ConstraintDataKeySetCore(IConstraintDataKeySetMutableObject mutable, IConstraintObject parent) : base(SdmxStructureType.GetFromEnum(SdmxStructureEnumType.ConstrainedDataKeyset), parent) { this.contstrainedKeys = new List<IConstrainedDataKey>(); foreach (IConstrainedDataKeyMutableObject each in mutable.ConstrainedDataKeys) { IConstrainedDataKey cdk = new ConstrainedDataKeyCore(each, this); if (ObjectUtil.ValidCollection(cdk.KeyValues)) { this.contstrainedKeys.Add(cdk); } } }
/// <summary> /// Write KeySet /// </summary> /// <param name="set"> /// The KeySetBean to write /// </param> /// <param name="isIncluded"> /// A value indication whether the <paramref name="set"/> is included /// </param> private void WriteKeySet(IConstraintDataKeySetMutableObject set, bool isIncluded) { if (set != null) { foreach (IConstrainedDataKeyMutableObject keyValue in set.ConstrainedDataKeys) { this.WriteStartElement(this.DefaultNS, ElementNameTable.KeySet); this.WriteAttribute(AttributeNameTable.isIncluded, isIncluded); this.WriteKey(keyValue.KeyValues); this.WriteEndElement(); } } }