public SignalEventItem(Signal signal, ValueStructure newValue, SetValue setValue, SetEventFlag setEventFlag, NotifyNewValue notifyNewValue) { _signal = signal; _newValue = newValue; _setEventFlag = setEventFlag; _setValue = setValue; _notifyNewValue = notifyNewValue; }
public Signal(Context context) { if (context == null) { throw new ArgumentNullException("context"); } _context = context; _iid = _context.GenerateInstanceId(); _properties = new PropertyBag(context); _constraints = new PropertyBag(context); _eventQueue = new SignalDelayedEventTimeline(context.Scheduler); _setValue = delegate(ValueStructure newValue) { if (newValue == null) { return(false); } bool different = _presentStructure == null || !_presentStructure.Equals(newValue); _presentStructure = newValue; _properties.ValidatePropertiesAfterEvent(this); _context.NotifySignalValueChanged(this); return(different); }; _setEventFlag = delegate(bool flagEvent) { _hasEvent = flagEvent; }; _notifyNewValue = delegate() { EventHandler <SignalEventArgs> handler = SignalValueChanged; if (handler != null) { handler(this, new SignalEventArgs(this)); } }; context.NotifyNewSignalConstructed(this); }