public override IList<UserDefinedProperty> UserDefinedProperties {get; set;}
public override IList<UserDefinedProperty> UserDefinedProperties {get; set;}
Exception | Description |
---|---|
EPLAN.Harness.API.Exceptions.ObjectInvalidException | The object is in invalid state. Obtain a new one. |
EPLAN.Harness.API.Exceptions.InternalErrorException | Internal error of HpD or HpD API. IMPORTANT: Throwing this exception changes HpD Api's state to Failed. |
EPLAN.Harness.API.Exceptions.DuplicateUserDefinedPropertyException | The exception that is thrown when a user-defined property with this name already exists on this object. |
// An object with user-defined properties was obtained before... // For example: Project. // Get user-defined properties of the project. IList<UserDefinedProperty> props = project.UserDefinedProperties; // Edit list of user-defined properties - the list is changed immediately. // Remove property: project.UserDefinedProperties.Remove(props.Last()); // Add new property: project.UserDefinedProperties.Add(new UserDefinedProperty("Name of the property", new TextProperty("Value of the property"))); // Edit property: project.UserDefinedProperties.First(p => p.Name == "Name").Name = "New name"; // Save the project. project.Save();