Table of Contents

Class StorageEvent

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The StorageEvent interface is implemented by the Windowstorage event, which is
sent to a window
when a storage area the window has access to is changed within the context of another document.

[Value("StorageEvent")]
public class StorageEvent : Event
Inheritance
StorageEvent
Inherited Members

Remarks

-{{domxref("Web Storage API", "", "", "nocode")}}

See also on MDN

Constructors

StorageEvent()

public StorageEvent()

StorageEvent(string, StorageEventInit)

The StorageEvent() constructor creates a new StorageEvent object.

public StorageEvent(string type, StorageEventInit eventInitDict = null)

Parameters

type string
eventInitDict StorageEventInit

Remarks

-{{domxref("Web Storage API", "", "", "nocode")}}

See also on MDN

Properties

Key

The key property of the StorageEvent interface returns the key for the storage item that was changed.

[Value("key")]
public string? Key { get; }

Property Value

string

A string containing the key for the storage item that was changed.

Remarks

-{{domxref("Web Storage API", "", "", "nocode")}}

See also on MDN

NewValue

The newValue property of the StorageEvent interface returns the new value of the storage item whose value was changed.

[Value("newValue")]
public string? NewValue { get; }

Property Value

string

A string containing the new value of the storage item.

Remarks

-{{domxref("Web Storage API", "", "", "nocode")}}

See also on MDN

OldValue

The oldValue property of the StorageEvent interface returns the original value of the storage item whose value changed.

[Value("oldValue")]
public string? OldValue { get; }

Property Value

string

A string containing the original value of the storage item.

Remarks

-{{domxref("Web Storage API", "", "", "nocode")}}

See also on MDN

StorageArea

The storageArea property of the StorageEvent interface returns the storage object that was affected.

[Value("storageArea")]
public Storage? StorageArea { get; }

Property Value

Storage

A Storage object that represents the storage object that was affected.

Remarks

-{{domxref("Web Storage API", "", "", "nocode")}}

See also on MDN

Url

The url property of the StorageEvent interface returns the URL of the document whose storage changed.

[Value("url")]
public string Url { get; }

Property Value

string

A string containing the URL of the document whose storage changed.

Remarks

-{{domxref("Web Storage API", "", "", "nocode")}}

See also on MDN

Methods

InitStorageEvent(string, bool, bool, string?, string?, string?, string, Storage?)

IMPORTANT
Deprecated
The StorageEvent.initStorageEvent() method is used to initialize the value of a StorageEvent.
[Value("initStorageEvent")]
public GlobalObject.Undefined InitStorageEvent(string type, bool bubbles = false, bool cancelable = false, string? key = null, string? oldValue = null, string? newValue = null, string url = null, Storage? storageArea = null)

Parameters

type string
bubbles bool
cancelable bool
key string
oldValue string
newValue string
url string
storageArea Storage

Returns

GlobalObject.Undefined

None (GlobalObject.Undefined).

Remarks

-{{domxref("Web Storage API", "", "", "nocode")}}
-The constructor to use instead of this deprecated method: StorageEvent(string, StorageEventInit).

See also on MDN