Exemplo n.º 1
0
        public void SendNotify()
        {
            if (m_callback == null)
            {
                return;
            }

            lock (this)
            {
                foreach (TypeSetPair p in m_list)
                {
                    List <RealtimeData> sendList = new List <RealtimeData>();
                    foreach (ModelBase model in p.m_set)
                    {
                        RealtimeData rtd = model.PrepareRealtimeData();
                        if (rtd != null)
                        {
                            sendList.Add(rtd);
                        }
                    }
                    if (sendList.Count > 0)
                    {
                        int index = 0;
                        while (index < sendList.Count)
                        {
                            int            length = Math.Min(SystemConfig.MaxArrayLength, sendList.Count - index);
                            RealtimeData[] array  = new RealtimeData[length];
                            sendList.CopyTo(index, array, 0, array.Length);
                            m_callback(p.m_type.Name, array);
                            index += SystemConfig.MaxArrayLength;
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        public override bool Equals(object obj)
        {
            RealtimeData data = obj as RealtimeData;

            if (data != null)
            {
                if (this.Rid != data.Rid)
                {
                    return(false);
                }

                if (this.Data.Length == data.Data.Length)
                {
                    for (int i = 0; i < this.m_data.Count; i++)
                    {
                        if (!this.m_data[i].Equals(data.m_data[i]))
                        {
                            return(false);
                        }
                    }
                    return(true);
                }
                return(false);
            }
            return(base.Equals(obj));
        }
Exemplo n.º 3
0
        public RealtimeData PrepareRealtimeData()
        {
            RealtimeData data = new RealtimeData();

            data.Rid = this.Rid;
            GetRealtimeData(data);
            if (m_oldCopy == data)
            {
                return(null);
            }
            m_oldCopy = data;
            return(data);
        }
Exemplo n.º 4
0
 protected virtual void GetRealtimeData(RealtimeData data)
 {
 }