# Class: AutoSave

## AutoSave(xmlEditor, mode, intervalMillis)

Implements the autosave feature of XMLEditorApp.

This class may be used independently from `XMLEditorApp`.

## Constructor

#### new AutoSave(xmlEditor, mode, intervalMillis)

Constructs an `AutoSave` object.

##### Parameters:

Name | Type | Description
--- | --- | ---
`xmlEditor` | XMLEditor | the XML editor.
`mode` | string | autosave mode: `"local"` (autosave local files), `"remote"` (autosave remote files) or `"both"` (autosave both local and remotefiles).
`intervalMillis` | number | autosave interval in milliseconds; must be at least 10000 (10s).

Source:
  - app/AutoSave.js, line 17

### Classes

AutoSave

### Members

#### activable :boolean

Get the `activable` property of this `AutoSave` object which may be used to test whether it will be active after a document is created, opened or recovered.

Typically invoked from a DocumentOpenedEvent (of any kind) event handler to determine whether this `AutoSave` object will be active given opened document and chosen autosave mode.

##### Type:

- boolean

Source:
  - app/AutoSave.js, line 140

#### intervalMillis :number

Get the `intervalMillis` property of this `AutoSave` object. See constructor.

##### Type:

- number

Source:
  - app/AutoSave.js, line 115

#### mode :string

Get the `mode` property of this `AutoSave` object. See constructor.

##### Type:

- string

Source:
  - app/AutoSave.js, line 105

#### xmlEditor :XMLEditor

Get the `xmlEditor` property of this `AutoSave` object. See constructor.

##### Type:

- XMLEditor

Source:
  - app/AutoSave.js, line 95

### Methods

#### dispose()

Dispose this `AutoSave` object when it is not needed anymore.

Source:
  - app/AutoSave.js, line 62