Adds an element with the specified String key and
String value to the end of the NameValueCollection.
Namespace: CodeSmith.CustomPropertiesAssembly: CodeSmith.CustomProperties (in CodeSmith.CustomProperties.dll) Version: 6.0.0.0 (7.0.0.15127)
Syntax
C# |
---|
public int Add( string key, string value ) |
Visual Basic |
---|
Public Function Add ( key As String, value As String ) As Integer |
Parameters
- key
- Type: System..::..String
The String key of the element to add to the end of the NameValueCollection.
- value
- Type: System..::..String
The String value of the element to add to the end of the NameValueCollection. This argument can be a null reference.
Return Value
Type: Int32The NameValueCollection index at which the new element has been added.
Remarks
Please refer to Add(Object, Object) for details but note that
the NameValueCollection may contain multiple identical keys.
Exceptions
Exception | Condition |
---|---|
System..::..ArgumentNullException | key is a null reference. |
System..::..NotSupportedException | The NameValueCollection is read-only. -or- The NameValueCollection has a fixed size. |