Exemplo n.º 1
0
 private DynamicHookGen(DynamicHookGen parent, string name)
 {
     Parent       = parent;
     Name         = name;
     NodeHookType = parent.NodeHookType;
     OwnLendID    = parent.NextLendID++;
 }
Exemplo n.º 2
0
 private DynamicHookGen(DynamicHookGen source)
 {
     Parent       = source.Parent;
     Name         = source.Name;
     NodeHookType = source.NodeHookType;
     OwnLendID    = source.OwnLendID;
     Actions.AddRange(source.Actions);
 }
Exemplo n.º 3
0
        public override bool TryInvoke(InvokeBinder binder, object[] args, out object result)
        {
            if (args.Length != 1 ||
                !(args[0] is Type type))
            {
                throw new ArgumentException("Expected type.");
            }

            result = new DynamicHookGen(type, NodeHookType);
            return(true);
        }
Exemplo n.º 4
0
 public static DynamicHookGen operator -(DynamicHookGen ctx, Delegate target)
 {
     ctx = new DynamicHookGen(ctx);
     ctx.Actions.Add(new Tuple <ActionType, Delegate>(ActionType.Remove, target));
     return(ctx);
 }
Exemplo n.º 5
0
 public override bool TryGetMember(GetMemberBinder binder, out object result)
 {
     result = new DynamicHookGen(this, binder.Name);
     return(true);
 }