public void GenerateUI(QCV.Base.IFilter instance) { _layouter.Controls.Clear(); MethodInfo[] event_methods = QCV.Base.MethodInfoScanner.FindEventMethods(instance); foreach (MethodInfo mi in event_methods) { Button b = new Button(); b.AutoSize = true; b.Text = mi.Name.Substring(2); // Remove On var lambda_mi = mi; var lambda_instance = instance; b.Click += new EventHandler((sender, ev) => { _cache.Add(lambda_instance, lambda_mi); }); _layouter.Controls.Add(b); } }
public void ExecutePendingEvents(QCV.Base.IFilter instance, Dictionary<string, object> bundle) { _ev_cache.InvokeEvents(instance, bundle); }
public void CacheEvent(QCV.Base.IFilter instance, System.Reflection.MethodInfo mi) { _ev_cache.Add(instance, mi); }
/// <summary> /// Cache an event. /// </summary> /// <param name="instance">Target filter</param> /// <param name="mi">Reflected method info</param> public void Add(QCV.Base.IFilter instance, MethodInfo mi) { this.AddRange(instance, new MethodInfo[] { mi }); }