Exemplo n.º 1
0
 /*TODO decide if this should actually be public.
  * Advantage is that less are created, disadvantage it can be misused by mistake and tons of dict items could be created
  * Maybe use WeakReference and check the dict every once in a while?
  */
 public static ConstantReader CacheOrCreate(object value)
 {
     if (null == value) return NullValue;
     ConstantReader val;
     if(!SavedValues.TryGetValue(value, out val))
     {
         val = new ConstantReader(value);
         SavedValues[val] = val;
     }
     return val;
 }
Exemplo n.º 2
0
 public CreateTimerAction()
 {
     Recurring = new ConstantReader(false);
 }