public RelayCommand(Action execute, PredicateDelegate canExecute) { if (execute == null) throw new ArgumentNullException("execute"); _execute = execute; _canExecute = (object obj) => { return canExecute(); }; }
public RelayCommand(Action execute, Predicate<object> canExecute) { if (execute == null) throw new ArgumentNullException("execute"); _execute = execute; _canExecute = canExecute; }
public void RemoveFilter(Predicate<object> filter) { if (m_filters.Contains(filter)) { m_filters.Remove(filter); TriggerEvent(this, new GroupFilterEventArgs(GroupFilterEvent.FILTER_MODIFIED)); } }
public void Set(Predicate<object> _filter) { Debug.Assert(_filter != null); Clear(); m_filter = new Predicate<object>(_filter); m_parent.AddFilter(m_filter); }
/// <summary> /// Initializes a new instance of the <see cref="RelayCommand"/> class. /// </summary> /// <param name="execute">The execute.</param> /// <param name="canExecute">The can execute.</param> /// <exception cref="System.ArgumentNullException">execute</exception> public RelayCommand(Action<object> execute, Predicate<object> canExecute) { if (execute == null) { throw new ArgumentNullException("execute"); } this.execute = execute; this.canExecute = canExecute; }
/// <summary> /// Gets all worker roles that matches given predicate. /// </summary> /// <param name="predicate">The matching predicate</param> /// <returns>Matched items</returns> public IEnumerable<WorkerRole> GetWorkerRoles(Predicate<WorkerRole> predicate) { return Array.FindAll<WorkerRole>(Definition.WorkerRole, predicate); }
public AssemblySpecification(Predicate<string> filter) { This = new None<Assembly>(); Filter = filter; }
private static int ReadInputUntilValid(Predicate<int> condition, string errorMessage = "Invalid Selection!") { var conditionMet = false; var input = -1; while (!conditionMet) { input = ReadInputUntilValid(); conditionMet = condition(input); if (!conditionMet) { Console.WriteLine(errorMessage); } } return input; }
public void AddFilter(Predicate<object> filter) { m_filters.Add(filter); TriggerEvent(this, new GroupFilterEventArgs(GroupFilterEvent.FILTER_MODIFIED)); }
public Predicate Or(Predicate predicate) { return new Predicate(this.condition || predicate.Evaluate()); }
public Predicate And(Predicate predicate) { return new Predicate(this.condition && predicate.Evaluate()); }