コード例 #1
0
        private void SetArchorList(ArchorManager archorManager, UDPArchorList list, UDPArchor item1 = null, int id = -1)
        {
            this.Dispatcher.Invoke(() => {
                if (archorManager == null)
                {
                    TbConsole.Text        = "";
                    DataGrid3.ItemsSource = null;
                    LbCount.Content       = "";
                    LbStatistics.Content  = "";
                }
                else
                {
                    //IsDirty = true;
                    LbTime.Content = archorManager.GetTimeSpan();
                    TbConsole.Text = archorManager.Log;

                    if (DbArchorListDict != null)
                    {
                        //list.ClearInfo();
                        foreach (var item in list)
                        {
                            item.DbInfo   = "";
                            item.RealArea = "";
                            var clientIP  = item.GetClientIP();
                            //var ar = DbArchorList.Find(i => i.Ip == clientIP);
                            if (DbArchorListDict.ContainsKey(clientIP))
                            {
                                var ar = DbArchorListDict[clientIP];
                                if (ar != null)
                                {
                                    item.RealArea = ar.Parent.Name;
                                    if (item.GetClientIP() != ar.Ip)
                                    {
                                        item.DbInfo = "IP:" + ar.Ip;
                                    }
                                    else
                                    {
                                        string code = ar.Code.Trim();
                                        if (!string.IsNullOrEmpty(code))
                                        {
                                            item.DbInfo = "有:" + code;
                                        }
                                        else
                                        {
                                            item.DbInfo = "有:" + ar.Ip;
                                        }
                                    }
                                }
                            }
                        }
                    }

                    if (id > 0)
                    {
                        var item2 = list[id];
                        if (item2 != item1)
                        {
                        }

                        int id2 = list.IndexOf(item1);
                    }

                    DataGrid3.ItemsSource = list;

                    if (id > 0)
                    {
                        var item2 = list[id];
                        if (item2 != item1)
                        {
                        }
                        int id2 = list.IndexOf(item1);
                    }

                    LbCount.Content        = list.GetConnectedCount();
                    LbStatistics.Content   = archorManager.GetStatistics();
                    LbServerIpList.Content = list.ServerList.GetText();

                    LbListenCount.Content      = archorManager.valueList.Count;
                    LbListenStatistics.Content = archorManager.valueList.GetStatistics();
                }
            });
        }
コード例 #2
0
        private void SetArchorList(ArchorManager archorManager, UDPArchorList list, UDPArchor item1 = null, int id = -1)
        {
            if (DbArchorListDict != null)
            {
                //list.ClearInfo();
                foreach (var item in list)
                {
                    item.DbInfo   = "";
                    item.RealArea = "";
                    var clientIP = item.GetClientIP();
                    //var ar = DbArchorList.Find(i => i.Ip == clientIP);
                    if (DbArchorListDict.ContainsKey(clientIP))
                    {
                        var ar = DbArchorListDict[clientIP];
                        if (ar != null)
                        {
                            item.RealArea = ar.Parent.Name;
                            if (item.GetClientIP() != ar.Ip)
                            {
                                item.DbInfo = "IP:" + ar.Ip;
                            }
                            else
                            {
                                string code = ar.Code.Trim();
                                if (!string.IsNullOrEmpty(code))
                                {
                                    item.DbInfo = "有:" + code;
                                }
                                else
                                {
                                    item.DbInfo = "有:" + ar.Ip;
                                }
                            }
                        }
                    }
                }

                if (id > 0)
                {
                    var item2 = list[id];
                    if (item2 != item1)
                    {
                    }

                    int id2 = list.IndexOf(item1);
                }

                if (UDPArchorList == null)
                {
                    UDPArchorList = list;
                }
                else
                {
                    //if(UDPArchorList!= list)
                    //{

                    //}
                }


                if (id > 0)
                {
                    var item2 = list[id];
                    if (item2 != item1)
                    {
                    }
                    int id2 = list.IndexOf(item1);
                }
            }
        }