/** * Add a new double property * * @throws IllegalArgumentException if a property with this name already exists */ public void AddProperty(string name, double value) { CT_Property p = Add(name); p.ItemElementName = ItemChoiceType.r8; p.Item = value; }
/** * Add a new bool property * * @throws IllegalArgumentException if a property with this name already exists */ public void AddProperty(string name, bool value) { CT_Property p = Add(name); p.ItemElementName = ItemChoiceType.@bool; p.Item = value; }
/** * Add a new string property * * @throws IllegalArgumentException if a property with this name already exists */ public void AddProperty(string name, String value) { CT_Property p = Add(name); p.ItemElementName = ItemChoiceType.lpwstr; p.Item = value; }
/** * Add a new integer property * * @throws IllegalArgumentException if a property with this name already exists */ public void AddProperty(String name, int value) { CT_Property p = Add(name); p.ItemElementName = ItemChoiceType.i4; p.Item = value; }
public void AddProperty(string name, bool value) { CT_Property ctProperty = this.Add(name); ctProperty.ItemElementName = ItemChoiceType.@bool; ctProperty.Item = (object)value; }
private CT_Property Add(string name) { if (this.Contains(name)) { throw new ArgumentException("A property with this name already exists in the custom properties"); } CT_Property ctProperty = this.props.GetProperties().AddNewProperty(); int num = this.NextPid(); ctProperty.pid = num; ctProperty.fmtid = POIXMLProperties.CustomProperties.FORMAT_ID; ctProperty.name = name; return(ctProperty); }
/** * Add a new property * * @param name the property name * @throws IllegalArgumentException if a property with this name already exists */ private CT_Property Add(string name) { if (Contains(name)) { throw new ArgumentException("A property with this name " + "already exists in the custom properties"); } CT_Property p = props.GetProperties().AddNewProperty(); int pid = NextPid(); p.pid = pid; p.fmtid = FORMAT_ID; p.name = name; return(p); }