public override bool Equals(Object obj) { if ((obj == null) || !this.GetType().Equals(obj.GetType())) { return(false); } else { BoolType i = (BoolType)obj; return(i.value == this.value); } }
ISet <Event> ApplyFilter(ISet <Event> s, Event context) { if (this.filter == null) { return(s); } var result = new HashSet <Event>(); try { var val = this.filter.Eval(context); if (val.GetType() == typeof(IntType)) { IntType v = (IntType)val; if (s.Count > v.value) { result.Add(s.ElementAt(v.value)); } return(result); } } catch { } foreach (var e in s) { var val = this.filter.Eval(e); if (val.GetType() == typeof(BoolType)) { BoolType v = (BoolType)val; if (v.value) { result.Add(e); } } } return(result); //throw new Exception("Bad filter type: " + val.GetType()); }