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")}}
Constructors
StorageEvent()
public StorageEvent()
StorageEvent(string, StorageEventInit)
The StorageEvent() constructor creates a new StorageEvent object.
public StorageEvent(string type, StorageEventInit eventInitDict = null)
Parameters
typestringeventInitDictStorageEventInit
Remarks
-{{domxref("Web Storage API", "", "", "nocode")}}
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")}}
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")}}
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")}}
StorageArea
The storageArea property of the StorageEvent interface returns the storage object that was affected.
[Value("storageArea")]
public Storage? StorageArea { get; }
Property Value
Remarks
-{{domxref("Web Storage API", "", "", "nocode")}}
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")}}
Methods
InitStorageEvent(string, bool, bool, string?, string?, string?, string, Storage?)
IMPORTANT
DeprecatedStorageEvent.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
typestringbubblesboolcancelableboolkeystringoldValuestringnewValuestringurlstringstorageAreaStorage
Returns
Remarks
-{{domxref("Web Storage API", "", "", "nocode")}}
-The constructor to use instead of this deprecated method: StorageEvent(string, StorageEventInit).