public RubyPart(RubyPartDefinition definition, Proc createInstance) { if (definition == null) throw new ArgumentNullException("definition"); if (createInstance == null) throw new ArgumentNullException("createInstance"); _definition = definition; _instance = new DelayedInit<object>(() => createInstance.Call(createInstance)); }
public static object Trap( RubyContext/*!*/ context, object self, object signalId, Proc proc) { if ((signalId is MutableString) && ((MutableString)signalId).ConvertToString() == "INT") { context.InterruptSignalHandler = delegate() { proc.Call(); }; } else { // TODO: For now, just ignore unknown signals. This should be changed to throw an // exception. We are not doing it yet as it is close to the V1 RTM, and throwing // an exception might cause some app to misbehave whereas it might have happenned // to work if no exception is thrown } return null; }
public static object Trap( RubyContext /*!*/ context, object self, object signalId, Proc proc) { if ((signalId is MutableString) && ((MutableString)signalId).ConvertToString() == "INT") { context.InterruptSignalHandler = delegate() { proc.Call(); }; } else { // TODO: For now, just ignore unknown signals. This should be changed to throw an // exception. We are not doing it yet as it is close to the V1 RTM, and throwing // an exception might cause some app to misbehave whereas it might have happenned // to work if no exception is thrown } return(null); }
public static object Call(Proc/*!*/ self, object arg1) { RequireParameterCount(self, 1); return self.Call(arg1); }
public static object Call(Proc/*!*/ self) { RequireParameterCount(self, 0); return self.Call(); }
public static object Call(Proc/*!*/ self, object arg1, object arg2, object arg3, object arg4) { RequireParameterCount(self, 4); return self.Call(arg1, arg2, arg3, arg4); }
public static object Call(Proc /*!*/ self, object arg1, object arg2, object arg3, object arg4) { RequireParameterCount(self, 4); return(self.Call(arg1, arg2, arg3, arg4)); }
public static object Call(Proc /*!*/ self, object arg1) { RequireParameterCount(self, 1); return(self.Call(arg1)); }
public static object Call(Proc /*!*/ self) { RequireParameterCount(self, 0); return(self.Call()); }
public static Func<IRequest, bool> ToRequestPredicate(Proc proc) { return r => (bool)proc.Call(r); }
public static object Call(BlockParam block, Proc /*!*/ self, object arg1, object arg2, object arg3, object arg4) { RequireParameterCount(self, 4); return(self.Call(block != null ? block.Proc : null, arg1, arg2, arg3, arg4)); }
public static object Call(BlockParam block, Proc /*!*/ self) { RequireParameterCount(self, 0); return(self.Call(block != null ? block.Proc : null)); }
public static object Call(BlockParam block, Proc/*!*/ self, object arg1, object arg2, object arg3, object arg4) { RequireParameterCount(self, 4); return self.Call(block != null ? block.Proc : null, arg1, arg2, arg3, arg4); }
public static object Call(BlockParam block, Proc/*!*/ self) { RequireParameterCount(self, 0); return self.Call(block != null ? block.Proc : null); }