public void Searcher(ActorRoot _inActor, RES_FUNCEFT_TYPE _propertyType, PropertyDelegate _delegate) { ulong num = _delegate(_inActor, _propertyType); if (num < this.maxValue) { this.targetList.Clear(); this.maxValue = num; this.targetList.Add(_inActor); } else if (num == this.maxValue) { this.targetList.Add(_inActor); } }
/// <summary> /// Does magic cross thread stuff, mostly used for GUI updates from background threads. /// </summary> /// <param name="control">Control that might be on a different Thread</param> /// <param name="propertyName">Method or Property to set or execute</param> /// <param name="propertyValue">object in setting property</param> public static void SetProperty(Control control, string propertyName, object propertyValue) { if (control.InvokeRequired) { PropertyDelegate d = SetProperty; control.Invoke(d, control, propertyName, propertyValue); } else { var property = control.GetType().GetProperty(propertyName); if (property == null) { throw new Exception( $"Could not find Property {propertyName} on {control.GetType()}"); } //Set Property property.SetValue(control, propertyValue); } }
public PropertyConstraint(PropertyDelegate <TType, TProperty> getter, IConstraint <TProperty> constraint) { _getter = getter; _constraint = constraint; }