Esempio n. 1
0
        protected bool doCompare(Watcher.WatchCondition condition, dynamic a, dynamic b)
        {
            switch (condition)
            {
            case Watcher.WatchCondition.EqualTo:
                return(a == b);

            case Watcher.WatchCondition.GreaterThan:
                return(a > b);

            case Watcher.WatchCondition.GreaterThanEqualTo:
                return(a >= b);

            case Watcher.WatchCondition.LessThan:
                return(a < b);

            case Watcher.WatchCondition.LessThanEqualTo:
                return(a <= b);

            case Watcher.WatchCondition.Not:
                return(a != b);
            }

            return(false);
        }
Esempio n. 2
0
        public void addGenericWatcher(object value, Watcher.WatchCondition condition, string identifier)
        {
            Watcher watch = new Watcher();

            watch.referenceValue = value;
            watch.condition      = condition;
            watch.label          = identifier;
            watch.processed      = false;

            mWatchers.Add(watch);
        }