private void CheckExtenderConfigChange(Pdu pdu) { if (ExtenderConfigChanged != null) { ExtenderConfigResponsePayload configPayload = GetPayload(pdu, Constants.ExtenderConfigResponsePayload.TagType, null) as ExtenderConfigResponsePayload; if (configPayload != null) { ExtenderConfig extenderConfig = new ExtenderConfig(configPayload); if (_currentExtenderConfig == null || !_currentExtenderConfig.Equals(extenderConfig)) { _currentExtenderConfig = extenderConfig; ExtenderConfigChanged?.BeginInvoke(this, new ExtenderConfigChangedEventArgs(_currentExtenderConfig), EndExtenderConfigChanged, null); } } } }
/// <summary> /// Compare current extender config against another config. /// </summary> /// <param name="config">extender config</param> /// <returns>true if objects are equal</returns> public bool Equals(ExtenderConfig config) { if (!base.Equals(config)) { return(false); } if (MaxRequests != config.MaxRequests) { return(false); } if (CalendarFirstTime != config.CalendarFirstTime) { return(false); } if (CalendarLastTime != config.CalendarLastTime) { return(false); } return(true); }
/// <summary> /// Create extender configuration changed event arguments class instance. /// </summary> /// <param name="extenderConfig">New extender configuration</param> /// <param name="ksiService">KsiService that made the extender configuration request</param> public ExtenderConfigChangedEventArgs(ExtenderConfig extenderConfig, IKsiService ksiService = null) { ExtenderConfig = extenderConfig; KsiService = ksiService; }