public InvokeHelper(Invokee <T> target, T arguments, Action <EventArgs> freeArgumentCallback) : base(freeArgumentCallback) { Debug.Assert(target != null); Target = target; Arguments = arguments; }
public CompiledExpression Compile(Expression expression) { Invokee inv = expression.ToEvaluator(Symbols); return((ITypedElement focus, EvaluationContext ctx) => { var closure = Closure.Root(focus, ctx); return inv(closure, InvokeeFactory.EmptyArgs); }); }
public CompiledExpression Compile(Expression expression) { Invokee inv = expression.ToEvaluator(Symbols); return((IElementNavigator focus, IElementNavigator containerResource) => { var closure = Closure.Root(focus, containerResource); return inv(closure, InvokeeFactory.EmptyArgs); }); }
// Update is called once per frame void Update() { while (ToInvoke.Count > 0) { Invokee i = ToInvoke[0]; i.Output = i.Method.Invoke(i.MethodInstance, null); i.Done = true; ToInvoke.RemoveAt(0); } }
void ClanMembershipStatusChanged(object sender, ClanMembershipEventArgs e) { m_isInClan = !string.IsNullOrEmpty(e.Tag); Invokee result = () => beginFormingANewClanToolStripMenuItem.Enabled = !m_isInClan; if (InvokeRequired) { Invoke(result); } else { result(); } }
public static Invokee Invoke(string functionName, IEnumerable <Invokee> arguments, Invokee invokee) { return((ctx, _) => { try { return invokee(ctx, arguments); } catch (Exception e) { throw new InvalidOperationException("Invocation of '{0}' failed: {1}".FormatWith(functionName, e.Message)); } }); }
public static Invokee Invoke(string functionName, IEnumerable <Invokee> arguments, Invokee invokee) { return((ctx, _) => { try { return invokee(ctx, arguments); } catch (Exception e) { throw new InvalidOperationException( $"Invocation of {formatFunctionName(functionName)} failed: {e.Message}"); } }); string formatFunctionName(string name) { if (name.StartsWith(BinaryExpression.BIN_PREFIX)) { return($"operator '{name.Substring(BinaryExpression.BIN_PREFIX_LEN)}'"); } else if (name.StartsWith(UnaryExpression.URY_PREFIX)) { return($"operator '{name.Substring(UnaryExpression.URY_PREFIX_LEN)}'"); } else { return($"function '{name}'"); } } }
public TableEntry(CallSignature signature, Invokee body) { Signature = signature; Body = body; }
internal void Add(CallSignature signature, Invokee body) { _entries.Add(new TableEntry(signature, body)); }
public static Invokee Invoke(string functionName, IEnumerable <Invokee> arguments, Invokee invokee) { Func <Closure, IEnumerable <IElementNavigator> > boundFunc = (ctx) => invokee(ctx, arguments); IEnumerable <IElementNavigator> lastResult = null; return((ctx, _) => { // if (lastResult != null) return lastResult; try { lastResult = boundFunc(ctx); return lastResult; } catch (Exception e) { throw new InvalidOperationException("Invocation of '{0}' failed: {1}".FormatWith(functionName, e.Message)); } }); }