Example #1
0
 public static object GetDefaultValue(TypeBinding binding)
 {
     TypeModel model;
     if (!models.TryGetValue (binding, out model)) {
         throw new InvalidOperationException("No implementation for typebinding " + binding.ToString ());
     }
     return model.DefaultValue;
 }
Example #2
0
 public static object EvaluateUnaryOperator(TypeBinding type, string oper, object operand)
 {
     TypeModel model;
     Func<object,object> unOp;
     if (!models.TryGetValue (type, out model)) {
         throw new InvalidOperationException("No implementation for typebinding " + type.ToString ());
     }
     if (!model.UnaryOperatorImplementations.TryGetValue (oper, out unOp)) {
         throw new InvalidOperationException("Type model for type binding " + type.ToString() + " does not implement operator " + oper);
     }
     return unOp(operand);
 }