/// <summary> /// Add a task <--> delegate mapping to this worker. A task name is a short string that the worker registers /// with the manager, for example "reverse". The delegate is a callback that the worker calls when it receives a /// packet of work to do that has a task name matching the registered name. /// </summary> /// <param name="taskname"> /// A <see cref="System.String"/> that is the 'name' of the task being registered with the server /// </param> /// <param name="function"> /// A <see cref="taskdelegate"/> that is the actual callback function /// (must match the <see cref="taskdelegate"/> specification) /// </param> public void registerFunction(string taskname, taskdelegate function) { if (!methodMap.ContainsKey(taskname)) { c.sendPacket(new CanDo(taskname)); } methodMap[taskname] = function; }
/// <summary> /// Add a task <--> delegate mapping to this worker. A task name is a short string that the worker registers /// with the manager, for example "reverse". The delegate is a callback that the worker calls when it receives a /// packet of work to do that has a task name matching the registered name. /// </summary> /// <param name="taskname"> /// A <see cref="System.String"/> that is the 'name' of the task being registered with the server /// </param> /// <param name="function"> /// A <see cref="taskdelegate"/> that is the actual callback function /// (must match the <see cref="taskdelegate"/> specification) /// </param> public void registerFunction(string taskname, taskdelegate function) { if(!methodMap.ContainsKey(taskname)) { c.sendPacket(new CanDo(taskname)); } methodMap[taskname] = function; }