Class RealmConfiguration
Realm configuration specifying settings that affect the Realm's behavior.
Inherited Members
Namespace: Realms
Assembly: Realm.dll
Syntax
public class RealmConfiguration : RealmConfigurationBase
Remarks
Its main role is generating a canonical path from whatever absolute, relative subdirectory, or just filename the user supplies.
Constructors
| Improve this Doc View SourceRealmConfiguration(String)
Initializes a new instance of the RealmConfiguration class.
Declaration
public RealmConfiguration(string optionalPath = null)
Parameters
Type | Name | Description |
---|---|---|
String | optionalPath | Path to the realm, must be a valid full path for the current platform, relative subdirectory, or just filename. |
Properties
| Improve this Doc View SourceDefaultConfiguration
Gets or sets the RealmConfiguration that is used when creating a new Realm without specifying a configuration.
Declaration
public static RealmConfiguration DefaultConfiguration { get; set; }
Property Value
Type | Description |
---|---|
RealmConfiguration | The default configuration. |
IsReadOnly
Gets or sets a value indicating whether a Realm is opened as readonly. This allows opening it from locked locations such as resources, bundled with an application.
Declaration
public bool IsReadOnly { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
|
MigrationCallback
Gets or sets the migration callback.
Declaration
public RealmConfiguration.MigrationCallbackDelegate MigrationCallback { get; set; }
Property Value
Type | Description |
---|---|
RealmConfiguration.MigrationCallbackDelegate | The RealmConfiguration.MigrationCallbackDelegate that will be invoked if the Realm needs to be migrated. |
ShouldCompactOnLaunch
Gets or sets the compact on launch callback.
Declaration
public RealmConfiguration.ShouldCompactDelegate ShouldCompactOnLaunch { get; set; }
Property Value
Type | Description |
---|---|
RealmConfiguration.ShouldCompactDelegate | The RealmConfiguration.ShouldCompactDelegate that will be invoked when opening a Realm for the first time to determine if it should be compacted before being returned to the user. |
ShouldDeleteIfMigrationNeeded
Gets or sets a value indicating whether the database will be deleted if the RealmSchema
mismatches the one in the code. Use this when debugging and developing your app but never release it with
this flag set to true
.
Declaration
public bool ShouldDeleteIfMigrationNeeded { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
|
Methods
| Improve this Doc View SourceConfigWithPath(String)
Clone method allowing you to override or customize the current path.
Declaration
public RealmConfiguration ConfigWithPath(string newConfigPath)
Parameters
Type | Name | Description |
---|---|---|
String | newConfigPath | Path to the realm, must be a valid full path for the current platform, relative subdirectory, or just filename. |
Returns
Type | Description |
---|---|
RealmConfiguration | An object with a fully-specified, canonical path. |