Class MimeHelper
Class for assisting in mime-related functionality.
Namespace: SuperOffice.Util
Assembly: SoCore.dll
Syntax
public static class MimeHelper : Object
Methods
GetDocumentTypeKeyFor(String)
Get's a matching DocumentTypeKey value for the given mimetype. To be used with template-creation where this value needs to be available.
Declaration
public static int GetDocumentTypeKeyFor(string mimeType)
Parameters
Type | Name | Description |
---|---|---|
String | mimeType |
Returns
Type | Description |
---|---|
Int32 |
GetExtensionFor(String)
Determines the file-extension matching the corresponding mime-type.
Declaration
public static string GetExtensionFor(string mimeType)
Parameters
Type | Name | Description |
---|---|---|
String | mimeType | Mime-type to be looked up. |
Returns
Type | Description |
---|---|
String | Extension including leading dot. Never null. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Will thrown if value cannot be resolved. |
GetForFilename(String)
Gets the appropriate mime-type for the filename provided.
Declaration
public static string GetForFilename(string fileName)
Parameters
Type | Name | Description |
---|---|---|
String | fileName | Filename used to determine mime-type. Can be null. |
Returns
Type | Description |
---|---|
String | Never null. unknown/unknown is returned if no other match is found. |
IsGoogleTypeFile(String)
Determines if the specified mime-type is a native Google Apps mime-type.
Declaration
public static bool IsGoogleTypeFile(string mimeType)
Parameters
Type | Name | Description |
---|---|---|
String | mimeType |
Returns
Type | Description |
---|---|
Boolean |
IsOfficeTypeFile(String)
Determines if the specified mime-type is a native Google Apps mime-type.
Declaration
public static bool IsOfficeTypeFile(string mimeType)
Parameters
Type | Name | Description |
---|---|---|
String | mimeType |
Returns
Type | Description |
---|---|
Boolean |