FileAssociations.Contains
method · FileAssociations · cAlgo.API Since 5.1
DesktopCLICloud
Checks if the specified file extension is already associated.
Environment behaviour
CLI — not supported. Available to plugins only, and plugins cannot run in the CLI.
Cloud — not supported. Available to plugins only, and plugins cannot run in the cloud.
Definition
bool Contains(string fileExtension)
api.FileAssociations.Contains(fileExtension: str) -> bool
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
fileExtension | string | str | File extension with dot, ex: .pdf |
Returns bool
Examples
if (!FileAssociations.Contains(".mydata"))
FileAssociations.Add(".mydata");
if not api.FileAssociations.Contains(".mydata"):
api.FileAssociations.Add(".mydata")