public static NumericEntryBehavior AddNumericEntryBehavior(this NyEntry entry, NumericEntryBehavior numericBehavior = null) { var b = entry.Behaviors.Where(x => x.GetType() == typeof(NumericEntryBehavior)).FirstOrDefault() as NumericEntryBehavior; if (b == null) { b = numericBehavior ?? new NumericEntryBehavior(); entry.Behaviors.Add(b); } return(b); }
public static bool HasNumericEntryBehavior(this NyEntry entry) { return(entry.Behaviors.Where(x => x.GetType() == typeof(NumericEntryBehavior)).Any()); }
public static NumericEntryBehavior GetNumericEntryBehavior(this NyEntry entry) { return(entry.Behaviors.Where(x => x.GetType() == typeof(NumericEntryBehavior)).FirstOrDefault() as NumericEntryBehavior); }