| | | 1 | | using System; |
| | | 2 | | using System.Collections.Generic; |
| | | 3 | | using System.Text; |
| | | 4 | | using MUNity.Extensions.ResolutionExtensions; |
| | | 5 | | |
| | | 6 | | namespace MUNity.Models.Resolution |
| | | 7 | | { |
| | | 8 | | /// <summary> |
| | | 9 | | /// An Amendment to create the Text of an operative paragraph. |
| | | 10 | | /// </summary> |
| | | 11 | | public class ChangeAmendment : AbstractAmendment |
| | | 12 | | { |
| | | 13 | | /// <summary> |
| | | 14 | | /// The Text that the operative Paragraph should be changed to. |
| | | 15 | | /// </summary> |
| | 0 | 16 | | public string NewText { get; set; } |
| | | 17 | | |
| | | 18 | | /// <summary> |
| | | 19 | | /// Changes the text and removes the amendment. |
| | | 20 | | /// </summary> |
| | | 21 | | /// <param name="parentSection"></param> |
| | | 22 | | /// <returns></returns> |
| | | 23 | | public override bool Apply(OperativeSection parentSection) |
| | 0 | 24 | | { |
| | 0 | 25 | | parentSection.ChangeAmendments.Remove(this); |
| | 0 | 26 | | var target = parentSection.FindOperativeParagraph(this.TargetSectionId); |
| | 0 | 27 | | if (target == null) return false; |
| | 0 | 28 | | target.Text = this.NewText; |
| | 0 | 29 | | return true; |
| | 0 | 30 | | } |
| | | 31 | | |
| | | 32 | | /// <summary> |
| | | 33 | | /// Removes the amendment. |
| | | 34 | | /// </summary> |
| | | 35 | | /// <param name="parentSection"></param> |
| | | 36 | | /// <returns></returns> |
| | | 37 | | public override bool Deny(OperativeSection parentSection) |
| | 0 | 38 | | { |
| | 0 | 39 | | parentSection.ChangeAmendments.Remove(this); |
| | 0 | 40 | | return true; |
| | 0 | 41 | | } |
| | | 42 | | } |
| | | 43 | | } |