[This is preliminary documentation and is subject to change.]
Method that creates a new ContentSpecification based on the content of the contentValue-string, and adds it to the local list of ContentSpecifications.
If a mimetype is specified in the parameters, the content file will be saved in MultiArchive with this mimetype instead of the mimetype of the actual physical file.
Namespace: MultiArchive.SDK.ServiceUtils
Assembly: MultiArchive.SDK (in MultiArchive.SDK.dll) Version: 1.2.30.413 (1.2.30.413)
Syntax
C# |
public void AddContentSpecification(
string content,
string itemDescription,
string itemExtension,
string mimeType
)
|
Visual Basic |
Public Sub AddContentSpecification (
content As String,
itemDescription As String,
itemExtension As String,
mimeType As String
)
|
Visual C++ |
public:
void AddContentSpecification(
String^ content,
String^ itemDescription,
String^ itemExtension,
String^ mimeType
)
|
Parameters
-
content
- Type: System..::..String
A string containing the content of the attachment.
-
itemDescription
- Type: System..::..String
A description of the item being attached. Will be used to specify the content name in MultiArchive.
-
itemExtension
- Type: System..::..String
The extension of the file being attached to the item.
-
mimeType
- Type: System..::..String
A user specified mimetype for the file being attached. This overrides the mimetype of the physical file.
Examples
C# |
Copy
|
class TestClass
{
public static void Main()
{
ItemSpecificationBuilder myBuilder = new ItemSpecificationBuilder();
myBuilder.AddContentSpecification("Hello World.", "Hello World Example", ".txt", "text/plain");
}
}
|
Exceptions
Exception |
Condition |
System..::..ArgumentException
|
Throws an ArgumentException if either content, itemDescription or itemExtension are missing or empty. |
See Also