Class MimeHelper
Class for assisting in mime-related functionality.
Inherited Members
Namespace: SuperOffice.Util
Assembly: SoCore.dll
Syntax
public static class MimeHelper
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 |
|---|---|
| int |
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 |
|---|---|
| bool |
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 |
|---|---|
| bool |