ScriptContext Class |
Namespace: Compiled.EDD.Scripting
public sealed class ScriptContext : IScriptContext
The ScriptContext type exposes the following members.
Name | Description | |
---|---|---|
Document |
Returns the active document when used in conjunction with
ReadDocument | |
IsCancellationRequested |
Gets whether cancellation has been requested.
|
Name | Description | |
---|---|---|
AddMessage(String) |
Adds a information-level log message to be consumed.
| |
AddMessage(DocumentItem, String) |
Adds a information-level log message to be consumed.
| |
AddWarning(String) |
Adds a warning level log message to be consumed.
| |
AddWarning(DocumentItem, String) |
Adds a warning level log message to be consumed.
| |
CreateDocument |
Adds a new document into the project.
| |
CreateField(String) |
Creates the given field name if it does not exist.
| |
CreateField(String, ChoiceFieldItemType) |
Creates the given field name as choice or multi-choice if it does not exist.
| |
CreateField(String, FieldItemType) |
Creates the given field name using the provided FieldItemType if it does not exist.
| |
CreateFieldSet |
Create field set with given collection of fields
| |
DeleteField |
Deletes the field from the project schema.
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
GetCustomFields |
Gets a list of the custom (User) fields available to the script.
| |
GetDocuments |
Gets a new list of documents based on the documents
already available in this context.
| |
GetField |
Gets the FieldItem for the given field name.
| |
GetFields |
Gets a list of every field available to the script.
| |
GetFieldSet(String) |
Gets a field set matching the given field set name.
| |
GetFieldSet(FieldSetItemType) |
Gets the field set matching the given field set type.
| |
GetFieldSets |
Gets all the FieldSetItem's available in the project.
| |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetNewDocument |
Gets a new document that can be added to the project.
| |
GetNewDocuments |
Gets the list of new documents that have been created by the script.
| |
GetOrCreateField(String, ChoiceFieldItemType) |
Gets or creates the field matching both the given name and choice type.
| |
GetOrCreateField(String, FieldItemType) |
Gets or creates the field matching both the given name and field data type.
| |
GetProject |
Gets the active project associated to this instance.
| |
GetRemovedDocuments |
Gets the list of documents to remove that have been flagged deleted by the script.
| |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
HasField |
Checks if the given field name exists in the list of fields.
| |
ReadDocument |
Reads through the list of documents available to this instance.
| |
ReadDocument(DocumentItem) |
Marks the document as being read by the script. Primarily used for progress updates.
| |
RemoveDocument |
Flags the document as being removed by the script.
| |
RenameField |
Renames the given field in the schema.
| |
ThrowIfCancellationRequested |
Throws a OperationCanceledException if cancellation is requested.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
TryConvertFieldType |
Attempts to convert the provided field to a new field type. A return value indicates whether the field
was converted successfully to the new field type.
| |
TryGetOrCreateField(String, ChoiceFieldItemType, FieldItem) |
Gets or creates the field matching both the given name and choice type. A return value indicates
an existing field with type was found or a new field instance was created successfully.
| |
TryGetOrCreateField(String, FieldItemType, FieldItem) |
Gets or creates the field matching both the given name and field type. A return value indicates
an existing field with type was found or a new field instance was created successfully.
| |
UpdateDocument |
Marks the document as having changes and updates the progress.
|
Name | Description | |
---|---|---|
ScriptMessage |
Occurs when a message was encountered during script execution.
| |
ScriptProgress |
Occurs when notable progress occurs on a DocumentItem during script execution.
| |
ScriptWarning |
Occurs when a warning was encountered during script execution.
|