/// <summary> /// Creates a new tool method information instance. /// </summary> /// <param name="trigger">The trigger.</param> /// <param name="method">The method.</param> public ToolMethodInfo(ToolMethodTrigger trigger, ToolMethod method) { // Validate the arguments. if (null == method) throw new ArgumentNullException("method"); // Set the properties. this.Trigger = trigger; this.Method = method; }
/// <summary> /// Adds a new method to the list of methods. /// </summary> /// <param name="trigger">The trigger.</param> /// <param name="method">The method.</param> private void OnAddMethod(ToolMethodTrigger trigger, ToolMethod method) { // Compute the method information. ToolMethodInfo info = new ToolMethodInfo(trigger, method); // Check whether the item already exists. if (this.methods.Contains(info)) return; // Add the item to the dictionary. this.methods.Add(info); // Add the method item. ListViewItem item = new ListViewItem(new string[] { trigger.Description, method.Name, method.Tool.Info.Name, method.Tool.Info.Id.Version.ToString() }); item.ImageKey = "Cube"; item.Tag = info; this.listViewMethods.Items.Add(item); // Raise the event. if (null != this.Changed) this.Changed(this, EventArgs.Empty); }