예제 #1
0
        public CommandResultGroup AddArchor(System.Net.IPEndPoint iep, byte[] data)
        {
            lock (resultList.Groups)
            {
                if (archorList == null)
                {
                    archorList = new UDPArchorList();
                    //archorList.DataUpdated += (archor) =>
                    //{

                    //};
                    //archorList.DataAdded += (archor) =>
                    //{
                    //    //if (ArchorListChanged != null)
                    //    //{
                    //    //    ArchorListChanged(archorList);
                    //    //}
                    //};
                }

                CommandResultGroup group = resultList.Add(iep, data);
                archorList = OnDataReceive(group);
                return(group);
            }
        }
예제 #2
0
        internal void LoadList(ArchorDevList archors)
        {
            this.archors = archors;
            resultList   = new CommandResultManager();
            if (archors.ArchorList != null)
            {
                foreach (var item in archors.ArchorList)
                {
                    var group = resultList.Add(item);
                    //group.Archor.Ip = item.ArchorIp;
                    group.Archor.Area = item.InstallArea;
                }
            }

            UDPArchorList list = new UDPArchorList();

            foreach (var item in resultList.Groups)
            {
                list.Add(item.Archor);
                item.Archor.Num = list.Count;
            }

            archorList = list;
            if (ArchorListChanged != null)
            {
                ArchorListChanged(list, null);
            }
        }
예제 #3
0
        internal void LoadArchorList(string path)
        {
            archorList = XmlSerializeHelper.LoadFromFile <UDPArchorList>(path);

            resultList = new CommandResultManager();
            foreach (var item in archorList)
            {
                var group = resultList.Add(item);
            }

            OnArchorListChanged(archorList, null);
        }
예제 #4
0
 public UDPArchorList AddArchor(System.Net.IPEndPoint iep, byte[] data)
 {
     resultList.Add(iep, data);
     archorList = new UDPArchorList();
     foreach (var item in resultList.Groups)
     {
         archorList.Add(item.Archor);
         item.Archor.Num = archorList.Count;
     }
     if (ArchorListChanged != null)
     {
         ArchorListChanged();
     }
     return(archorList);
 }