/// <summary> /// Returns a <em>short</em> value read from configuration file. /// </summary> /// <param name="propertyName">Property name.</param> /// <returns> /// A <em>short</em> value if the property is found in the configuration, null otherwise. /// </returns> public short GetShortProperty(String propertyName) { if (propertyName == null) { throw new ArgumentNullException("propertyName", "The parameter [propertyName] cannot be null. Unable to get property value."); } return((short)TypeHandlerFactory.GetInstance().GetTypeHandler(typeof(short)).ToObject(GetProperty(propertyName))); }
/// <summary> /// Sets a <em>System.Boolean</em> property in the configuration. /// </summary> /// <param name="propertyName">Name of the property to set.</param> /// <param name="propertyValue">Property value.</param> public void SetBooleanProperty(String propertyName, Boolean propertyValue) { if (!_Writable) { throw new InvalidOperationException(String.Format("The configuration [{0}] is not writable. Cannot set property value.", _Name)); } if (propertyName == null) { throw new ArgumentNullException("propertyName", "The parameter [propertyName] cannot be null. Unable to set property value."); } SetProperty(propertyName, TypeHandlerFactory.GetInstance().GetTypeHandler(typeof(Boolean)).ToString(propertyValue)); }
/// <summary> /// Returns a <em>System.Boolean</em> value read from configuration file. /// </summary> /// <param name="propertyName">Property name.</param> /// <returns> /// A <em>System.Boolean</em> value if the property is found in the configuration, false otherwise. /// </returns> public Boolean GetBooleanProperty(String propertyName) { if (propertyName == null) { throw new ArgumentNullException("propertyName", "The parameter [propertyName] cannot be null. Unable to get property value."); } String propertyValue = GetProperty(propertyName); if (propertyValue != null) { return((Boolean)TypeHandlerFactory.GetInstance().GetTypeHandler(typeof(Boolean)).ToObject(propertyValue)); } return(false); }