Esempio n. 1
0
        public void SetCursor(object source, CursorType cursorType)
        {
            CursorUiRequest cursorStackEntry = GetCursorRequest(source, true);
            bool            isTop            = MostRelevantCursor.source == source;

            cursorStackEntry.Set(this, cursorType, isTop);
        }
Esempio n. 2
0
        public CursorUiRequest GetCursorRequest(object source, bool createIfNotFound = false)
        {
            int index = CursorUiStackDepth(source);

            if (index >= 0)
            {
                return(cursorUiRequest[index]);
            }
            if (createIfNotFound)
            {
                CursorUiRequest newOne = new CursorUiRequest {
                    source = source, cursor = CursorType.Cursor
                };
                cursorUiRequest.Add(newOne);
                return(newOne);
            }
            return(null);
        }
Esempio n. 3
0
        public void UnsetCursor(object source)
        {
            CursorUiRequest top = MostRelevantCursor;

            if (top == null)
            {
                return;
            }
            if (top.source == source)
            {
                cursorUiRequest.RemoveAt(cursorUiRequest.Count - 1);
            }
            if (cursorUiRequest.Count > 0)
            {
                top = MostRelevantCursor;
                top.Apply(this);
            }
            else
            {
                SetCursor(CursorType.Cursor);
            }
        }