/// <exception cref="BadSyntaxException"> /// The <paramref name="text"/> does not fit to the syntax. /// </exception> /// <exception cref="ReservedNameException"> /// The <paramref name="text"/> contains a reserved name. /// </exception> protected override void Modify(ListViewItem item, string text) { if (!(item.Tag is Parameter tag)) { return; } var command = new RenameDelegateParameterCommand(tag, parent, text); command.Execute(); diagram.TrackCommand(command); item.Tag = command.Parameter; item.Text = command.Parameter.ToString(); }
protected override bool ValidateDeclarationLine() { if (NeedValidation && shape.ActiveParameter != null) { try { var command = new RenameDelegateParameterCommand(shape.ActiveParameter, shape.DelegateType, DeclarationText); command.Execute(); shape.Diagram.TrackCommand(command); RefreshValues(); } catch (BadSyntaxException ex) { SetError(ex.Message); return(false); } } return(true); }