Exemplo n.º 1
0
        public bool RemoveCommandSource(Type type)
        {
            var result = m_CommandSourceTypes.RemoveAll(d => d == type) > 0;

            OnCommandSourcesChanged?.Invoke();
            return(result);
        }
Exemplo n.º 2
0
        public void RemoveCommandSource(ICommandSource commandSource)
        {
            if (commandSource == null)
            {
                throw new ArgumentNullException(nameof(commandSource));
            }

            m_CommandSources.Remove(commandSource);
            OnCommandSourcesChanged?.Invoke();
        }
Exemplo n.º 3
0
        public bool RemoveCommandSource(Type type)
        {
            if (type == null)
            {
                throw new ArgumentNullException(nameof(type));
            }

            var result = m_CommandSourceTypes.RemoveAll(d => d == type) > 0;

            OnCommandSourcesChanged?.Invoke();
            return(result);
        }
Exemplo n.º 4
0
        public void AddCommandSource(Type type)
        {
            if (!typeof(ICommandSource).IsAssignableFrom(type))
            {
                throw new Exception($"Type {type} must be an instance of ICommandSource!");
            }

            if (m_CommandSourceTypes.Contains(type))
            {
                return;
            }

            m_CommandSourceTypes.Add(type);
            m_CommandSourceTypes.Sort((a, b) => m_PriorityComparer.Compare(a.GetPriority(), b.GetPriority()));
            OnCommandSourcesChanged?.Invoke();
        }
Exemplo n.º 5
0
 public void RemoveCommandSource(ICommandSource commandSource)
 {
     m_CommandSources.Remove(commandSource);
     OnCommandSourcesChanged?.Invoke();
 }
Exemplo n.º 6
0
 public void AddCommandSource(ICommandSource commandSource)
 {
     m_CommandSources.Add(commandSource);
     OnCommandSourcesChanged?.Invoke();
 }