示例#1
0
        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
        /// </summary>
        /// <filterpriority>2</filterpriority>
        public void Dispose()
        {
            foreach (KeyValuePair <KeyCombination, List <KeyHandler> > pair in _mappings)
            {
                pair.Value.Clear();
            }

            _mappings.Clear();

            SystemEventDispatcher.Instance.RemoveEventListener(KeyboardEvent.KEY_DOWN, Instance.OnKeyEvent);
            SystemEventDispatcher.Instance.RemoveEventListener(KeyboardEvent.KEY_UP, Instance.OnKeyEvent);

            _instance = null;
        }
示例#2
0
        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
        /// </summary>
        /// <filterpriority>2</filterpriority>
        public void Dispose()
        {
            foreach (KeyValuePair<KeyCombination, List<KeyHandler>> pair in _mappings)
            {
                pair.Value.Clear();
            }

            _mappings.Clear();

            SystemEventDispatcher.Instance.RemoveEventListener(KeyboardEvent.KEY_DOWN, Instance.OnKeyEvent);
            SystemEventDispatcher.Instance.RemoveEventListener(KeyboardEvent.KEY_UP, Instance.OnKeyEvent);

            _instance = null;
        }