Example #1
0
 /// <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);
     }
 }
Example #2
0
        /// <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;
            }
        }
Example #3
0
        /// <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);
        }
Example #4
0
 /// <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;
 }