public bool RemoveCommandSource(Type type) { var result = m_CommandSourceTypes.RemoveAll(d => d == type) > 0; OnCommandSourcesChanged?.Invoke(); return(result); }
public void RemoveCommandSource(ICommandSource commandSource) { if (commandSource == null) { throw new ArgumentNullException(nameof(commandSource)); } m_CommandSources.Remove(commandSource); OnCommandSourcesChanged?.Invoke(); }
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); }
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(); }
public void RemoveCommandSource(ICommandSource commandSource) { m_CommandSources.Remove(commandSource); OnCommandSourcesChanged?.Invoke(); }
public void AddCommandSource(ICommandSource commandSource) { m_CommandSources.Add(commandSource); OnCommandSourcesChanged?.Invoke(); }