/// <summary> /// Createa a new tool method instance. /// </summary> /// <param name="tool">The tool.</param> /// <param name="id">The tool method identifier.</param> /// <param name="name">The method name.</param> /// <param name="description">The method description.</param> /// <param name="action">The action.</param> public ToolMethod(Tool tool, Guid id, string name, string description, ToolMethodAction action) { // Validate the arguments. if (null == tool) throw new ArgumentNullException("tool"); if (null == action) throw new ArgumentNullException("action"); this.tool = tool; this.id = new ToolMethodId(tool.Info.Id.Guid, tool.Info.Id.Version, id); this.name = name; this.description = description; this.action = action; }
/// <summary> /// Adds a method to the current tool. /// </summary> /// <param name="id">The method identifier.</param> /// <param name="name">The method name.</param> /// <param name="description">The method description.</param> /// <param name="action">The method action.</param> public void AddMethod(Guid id, string name, string description, ToolMethodAction action) { this.methods.Add(id, new ToolMethod(this, id, name, description, action)); }