public static UIBlockInfo GetOrAddBlockInfo(string name) { if (!blockMap.ContainsKey(name)) { blockMap[name] = new UIBlockInfo(); } return(blockMap[name] as UIBlockInfo); }
public static bool IsBlock(string UIID) { UIBlockInfo bInfo = GetBlockInfo(UIID); if (bInfo == null) { return(false); } else { return(!bInfo.IsEmpty()); } }
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); } } }
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); } }
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)); } } }