mirror of
https://github.com/esiur/esiur-dart.git
synced 2025-05-06 12:02:57 +00:00
WS2
This commit is contained in:
parent
d41911b1ab
commit
32d36144a4
@ -1,7 +1,10 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'PropertyModificationInfo.dart';
|
||||||
|
|
||||||
class IEventHandler {
|
class IEventHandler {
|
||||||
final _propertyModifiedController = StreamController<String>();
|
final _propertyModifiedController =
|
||||||
|
StreamController<PropertyModificationInfo>();
|
||||||
|
|
||||||
Map<String, List<Function>> _events = {};
|
Map<String, List<Function>> _events = {};
|
||||||
|
|
||||||
@ -11,10 +14,11 @@ class IEventHandler {
|
|||||||
|
|
||||||
IEventHandler() {}
|
IEventHandler() {}
|
||||||
|
|
||||||
Stream get properyModified => _propertyModifiedController.stream;
|
Stream<PropertyModificationInfo> get properyModified =>
|
||||||
|
_propertyModifiedController.stream;
|
||||||
|
|
||||||
emitProperty(String name) {
|
emitProperty(PropertyModificationInfo event) {
|
||||||
_propertyModifiedController.add(name);
|
_propertyModifiedController.add(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
emitArgs(String event, List arguments) {
|
emitArgs(String event, List arguments) {
|
||||||
|
14
lib/src/Core/PropertyModificationInfo.dart
Normal file
14
lib/src/Core/PropertyModificationInfo.dart
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import '../Resource/IResource.dart';
|
||||||
|
import '../Resource/Template/PropertyTemplate.dart';
|
||||||
|
|
||||||
|
class PropertyModificationInfo {
|
||||||
|
final PropertyTemplate propertyTemplate;
|
||||||
|
final value;
|
||||||
|
final int age;
|
||||||
|
final IResource resource;
|
||||||
|
|
||||||
|
String get name => propertyTemplate.name;
|
||||||
|
|
||||||
|
PropertyModificationInfo(
|
||||||
|
this.resource, this.propertyTemplate, this.value, this.age);
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user