Пример #1
0
        void RemoveAlert(TDBaseAlertData alert)
        {
            BaseAlertItem tempAlert = ActiveItems.Find((x) => { return(x.DataIndex == alert.ID); });

            if (tempAlert == null)
            {
                return;
            }
            tempAlert.Show(false);
            ActiveItems.Remove(tempAlert);
        }
Пример #2
0
        // 设置阻挡得Node,输入Null表示清空
        public void SetBlockNode(BaseUnit unit, List <TNode> nodes)
        {
            if (unit == null)
            {
                return;
            }
            HashList <TNode> preNodes = null;

            if (BlockNodesUnit.ContainsKey(unit))
            {
                preNodes = BlockNodesUnit[unit];
            }

            //先清除之前残余得数据
            if (preNodes != null)
            {
                foreach (var item in preNodes)
                {
                    AllBlockers.Remove(item);
                    if (BlockNodes.ContainsKey(item))
                    {
                        BlockNodes[item].Remove(unit);
                    }
                    if (BlockNodes[item].Count == 0)
                    {
                        BlockNodes.Remove(item);
                    }
                }
                BlockNodesUnit.Remove(unit);
            }


            if (nodes != null)
            {
                HashList <TNode> newHashSetNodes = new HashList <TNode>(nodes);
                foreach (var item in nodes)
                {
                    AllBlockers.Add(item);
                    if (!BlockNodes.ContainsKey(item))
                    {
                        BlockNodes.Add(item, new HashList <BaseUnit>());
                    }
                    BlockNodes[item].Add(unit);
                }
                BlockNodesUnit.Add(unit, newHashSetNodes);
            }
        }