mirror of
https://github.com/esiur/esiur-dart.git
synced 2025-09-13 20:13:19 +00:00
setSync
This commit is contained in:
@@ -359,6 +359,21 @@ class DistributedResource extends IResource {
|
||||
}
|
||||
}
|
||||
|
||||
dynamic setSync(int index, dynamic value) async {
|
||||
if (_destroyed) throw new Exception("Trying to access a destroyed object.");
|
||||
|
||||
if (_suspended) throw new Exception("Trying to access a suspended object.");
|
||||
|
||||
if (!_attached) return null;
|
||||
|
||||
if (index >= _properties.length)
|
||||
throw Exception("Property with index `${index}` not found.");
|
||||
|
||||
if (_properties[index] == value) return value;
|
||||
|
||||
return await set(index, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set property value.
|
||||
/// </summary>
|
||||
|
Reference in New Issue
Block a user