/// <summary>Makes child list long enough to accommodate setter. </summary> private void extendChildList(int index) { if (index >= this.components.Length) { SubComponent[] newCopy = new SubComponent[index + 1]; Array.Copy(this.components, 0, newCopy, 0, this.components.Length); this.components = newCopy; } }
/// <summary>Indexed setter for property components (index starts at 1 following HL7 convention).</summary> /// <param name="index">Index of the property (starts at 1 following HL7 convention). /// </param> /// <param name="component">New value of the property at <CODE>index</CODE>. /// /// </param> /// <throws> ProfileException </throws> public virtual void setSubComponent(int index, SubComponent component) { index--; extendChildList(index); SubComponent oldComponent = this.components[index]; this.components[index] = component; try { SupportClass.PropertyChangingEventArgs ve22 = new SupportClass.PropertyChangingEventArgs("components", null, null); } catch (System.ArgumentOutOfRangeException vetoException) { this.components[index] = oldComponent; throw new NuGenProfileException(null, vetoException); } SupportClass.PropertyChangingEventArgs me22 = new SupportClass.PropertyChangingEventArgs("components", null, null); }