private void _StopNotify(string channel, string item, string value) { if (m_StopNotifies == null) { return; } string key = $"{channel}.{item}"; StopNotifyInfo info = null; foreach (var allow in m_StopNotifies) { if (allow.isAllow(channel, item)) { info = allow; break; } } if (info == null) { return; } if (!m_Channels.ContainsKey(key)) { TimerChannel cinfo = new TimerChannel(Server, info.Style, info.Interval, channel, item, value); m_Channels.TryAdd(key, cinfo); } else { m_Channels[key].Value = value; } }
public void ChannelInterval(StopNotifyInfo info, int interval) { foreach (var item in m_Channels.Values) { if (info.isAllow(item.ChannelName, item.Item)) { item.Interval = new TimeSpan(0, 0, interval); } } }
public void RemoveStopNotify(StopNotifyInfo info) { m_Publish.OnValueUpdated -= OnValueUpdated; foreach (var channel in m_Channels) { if (info.isAllow(channel.Value.ChannelName, channel.Value.Item)) { TimerChannel cinfo; m_Channels.TryRemove(channel.Key, out cinfo); cinfo.Dispose(); } } m_Publish.OnValueUpdated += OnValueUpdated; }