Exemple #1
0
        private void _InfoNotify(string channel, string item, string value)
        {
            if (m_InfoNotifies == null)
            {
                return;
            }
            string         key  = $"{channel}.{item}";
            InfoNotifyInfo info = null;

            foreach (var allow in m_InfoNotifies)
            {
                if (allow.isAllow(channel, item))
                {
                    info = allow;
                    break;
                }
            }
            if (info == null)
            {
                return;
            }


            if (!m_DisplayChannels.ContainsKey(key))
            {
                DisplayChannel dinfo = new DisplayChannel(Server, info.Style, channel, item, value);
                m_DisplayChannels.TryAdd(key, dinfo);
            }
            else
            {
                m_DisplayChannels[key].Value = value;
            }
        }
Exemple #2
0
 public void RemoveInfoNotify(InfoNotifyInfo info)
 {
     m_Publish.OnValueUpdated -= OnValueUpdated;
     foreach (var channel in m_DisplayChannels)
     {
         if (info.isAllow(channel.Value.ChannelName, channel.Value.Item))
         {
             DisplayChannel dinfo;
             m_DisplayChannels.TryRemove(channel.Key, out dinfo);
             dinfo.Dispose();
         }
     }
     m_Publish.OnValueUpdated += OnValueUpdated;
 }