Пример #1
0
 public static UIBlockInfo GetOrAddBlockInfo(string name)
 {
     if (!blockMap.ContainsKey(name))
     {
         blockMap[name] = new UIBlockInfo();
     }
     return(blockMap[name] as UIBlockInfo);
 }
Пример #2
0
        public static bool IsBlock(string UIID)
        {
            UIBlockInfo bInfo = GetBlockInfo(UIID);

            if (bInfo == null)
            {
                return(false);
            }
            else
            {
                return(!bInfo.IsEmpty());
            }
        }
Пример #3
0
        public static void Unblock(string blockTo, UIBlocker blockFrom)
        {
            UIBlockInfo bInfo = GetBlockInfo(blockTo);

            if (bInfo != null)
            {
                bInfo.blockFrom.Remove(blockFrom);
                CleanBlocker();

                if (!IsBlock(blockTo))
                {
                    UIBlockSystemLock(GetObjects(blockTo), false);
                }
            }
        }
Пример #4
0
        public static void CleanBlocker()
        {
            List <string> removeList = new List <string>();

            foreach (DictionaryEntry entry in blockMap)
            {
                UIBlockInfo bInfo = entry.Value as UIBlockInfo;
                if (bInfo == null || bInfo.IsEmpty())
                {
                    removeList.Add(entry.Key as string);
                }
            }
            foreach (string bInfoName in removeList)
            {
                blockMap.Remove(bInfoName);
            }
        }
Пример #5
0
        public static void Block(string blockTo, UIBlocker blockFrom)
        {
            if (blockTo == null)
            {
                return;
            }

            bool isBlocked = IsBlock(blockTo);

            UIBlockInfo bInfo = GetOrAddBlockInfo(blockTo);

            if (bInfo != null)
            {
                bInfo.Block(blockFrom);
                if (!isBlocked)
                {
                    UIBlockSystemLock(GetObjects(blockTo));
                }
            }
        }