public SpecialFormBindingInfo(string symbol, SpecialForm form, int minChildCount = 0, int maxChildCount = 0, string childRoles = null) 
       : base(symbol, BindingTargetType.SpecialForm) {
   Binding = new ConstantBinding(form, this);
   MinChildCount = minChildCount;
   MaxChildCount = Math.Max(minChildCount, maxChildCount); //if maxParamCount=0 then set it equal to minParamCount
   if (!string.IsNullOrEmpty(childRoles)) {
     ChildRoles = childRoles.Split(',');
     //TODO: add check that paramNames array is in accord with min/max param counts        
   }
 }
示例#2
0
 public SpecialFormBindingInfo(string symbol, SpecialForm form, int minChildCount = 0, int maxChildCount = 0, string childRoles = null)
     : base(symbol, BindingTargetType.SpecialForm)
 {
     Binding       = new ConstantBinding(form, this);
     MinChildCount = minChildCount;
     MaxChildCount = Math.Max(minChildCount, maxChildCount); //if maxParamCount=0 then set it equal to minParamCount
     if (!string.IsNullOrEmpty(childRoles))
     {
         ChildRoles = childRoles.Split(',');
         //TODO: add check that paramNames array is in accord with min/max param counts
     }
 }
示例#3
0
 public sealed class ClrMethodBindingTargetInfo : ClrInteropBindingTargetInfo, ICallTarget { //The object works as ICallTarget itself
     public ClrMethodBindingTargetInfo(Type declaringType, string methodName, object instance = null)
         : base(methodName, ClrTargetType.Method)
     {
         DeclaringType = declaringType;
         Instance      = instance;
         _invokeFlags  = BindingFlags.InvokeMethod | BindingFlags.Public | BindingFlags.NonPublic;
         if (Instance == null)
         {
             _invokeFlags |= BindingFlags.Static;
         }
         else
         {
             _invokeFlags |= BindingFlags.Instance;
         }
         _binding = new ConstantBinding(this, this);
         //The object works as CallTarget itself; the "as" conversion is not needed in fact, we do it just to underline the role
     }
示例#4
0
 public ClrTypeBindingTargetInfo(Type type) : base(type.Name, ClrTargetType.Type) {
   _binding = new ConstantBinding(type, this);
 }
示例#5
0
 public ClrNamespaceBindingTargetInfo(string ns) : base(ns, ClrTargetType.Namespace) {
   _binding = new ConstantBinding(ns, this); 
 }
 public ClrTypeBindingTargetInfo(Type type)
     : base(type.Name, ClrTargetType.Type)
 {
     _binding = new ConstantBinding(type, this);
 }
示例#7
0
 public ClrNamespaceBindingTargetInfo(string ns) : base(ns, ClrTargetType.Namespace)
 {
     _binding = new ConstantBinding(ns, this);
 }