/// <summary> /// This constructor is used to copy a property into a new collection. Typically used /// when creating an instance of the property in a child object. /// </summary> /// <param name="collection"></param> /// <param name="src"></param> public MapProperty(MapProperties collection, MapProperty src) : this(collection, src.name, src.category, src.description, src.type, src.value) { }
public void ParseProperty(XmlReader r) { MapProperty prop = new MapProperty(this, r); properties[prop.Name] = prop; }
public void SetValue(string name, object value) { if (properties.ContainsKey(name)) { // if the property exists at this level, then just set it properties[name].Value = value; } else { // look at ancestors to find the property MapProperty src = GetProperty(name); if (src != null) { // if the property exists on an ancestor, then copy it down to this level, and set the value // in the local copy. MapProperty prop = new MapProperty(this, src); prop.Value = value; properties[name] = prop; } else { throw new Exception("attempt to set MapProperty that does not exist in hierarchy"); } } }
public void NewProperty(string name, string category, string description, Type type, object value) { MapProperty prop = new MapProperty(this, name, category, description, type, value); properties[name] = prop; }