/// <summary> /// Constructs a MedicationNameLabel object and passes the MedicationName on instantiation. /// </summary> /// <param name="names">MedicationNames</param> public MedicationNameLabel(MedicationNameCollection names) : base(HtmlTextWriterTag.A) { this.medicationNames = names; if (names != null) { this.medicationNames.PropertyChanged += new PropertyChangedEventHandler(this.OnMedicationNamesPropertyChanged); } }
/// <summary> /// Implement the LoadViewState method. Loads the MedicationNames if saved /// </summary> /// <param name="savedState">Saved State</param> protected override void LoadViewState(object savedState) { base.LoadViewState(savedState); MedicationNameCollection medicationNames = ViewState["MedicationNames"] as MedicationNameCollection; if (medicationNames != null) { this.medicationNames = medicationNames; } }
/// <summary> /// Makes a deep copy of the MedicationNameCollection. /// </summary> /// <returns>A deep copy of the MedicationNameCollection. </returns> public object Clone() { MedicationNameCollection newCollection = new MedicationNameCollection(); foreach (MedicationName medicationName in this.Items) { newCollection.Add(medicationName.Clone() as MedicationName); } return(newCollection); }
/// <summary> /// This Method is required as MedicationNames cannot have a setter if used on the Design Surface. Assign /// </summary> /// <param name="medicationNameCollection">Collection to update MedicationNames with</param> internal void UpdateMedicationNames(MedicationNameCollection medicationNameCollection) { this.medicationNames = medicationNameCollection; }