Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public static bool HasNumericEntryBehavior(this NyEntry entry)
 {
     return(entry.Behaviors.Where(x => x.GetType() == typeof(NumericEntryBehavior)).Any());
 }
Ejemplo n.º 3
0
 public static NumericEntryBehavior GetNumericEntryBehavior(this NyEntry entry)
 {
     return(entry.Behaviors.Where(x => x.GetType() == typeof(NumericEntryBehavior)).FirstOrDefault() as NumericEntryBehavior);
 }