/// <summary> /// Assign a value to a property given its name. /// </summary> /// <param name="propertyName">Name of property to change</param> /// <param name="val">Value to assign to property</param> /// <remarks> /// This method only modifies property values that already exist /// in the container. If the property does not exist, this method fails. /// </remarks> public override void ChangePropertyValue(string propertyName, object val) { if (propertyName == "Text") { this.text = (string)val; } else if (propertyName == "ContainerName") { if (this.container != null) { IPropertyContainer propContainer = this.container.GetService(typeof(IPropertyContainer)) as IPropertyContainer; if (propContainer != null) { propContainer.ChangePropertyValue("Name", val); } } } else { this.propertyValues[propertyName] = val; } }