| | 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 Add Amendment is a type of amendment that is creating a new Operative Paragraph on a given position when accp |
| | 10 | | /// This logic will create a virtual operative paragraph at the point where the new Amendment will be added when it |
| | 11 | | /// </summary> |
| | 12 | | public class AddAmendment : AbstractAmendment |
| | 13 | | { |
| | 14 | | /// <summary> |
| | 15 | | /// Sets the Virtual Paragraph to a real paragraph and remove the amendment. |
| | 16 | | /// </summary> |
| | 17 | | /// <param name="parentSection"></param> |
| | 18 | | /// <returns></returns> |
| | 19 | | public override bool Apply(OperativeSection parentSection) |
| 0 | 20 | | { |
| 0 | 21 | | var targetParagraph = parentSection.FindOperativeParagraph(this.TargetSectionId); |
| 0 | 22 | | if (targetParagraph == null) |
| 0 | 23 | | return false; |
| | 24 | |
|
| 0 | 25 | | targetParagraph.IsVirtual = false; |
| 0 | 26 | | targetParagraph.Visible = true; |
| 0 | 27 | | parentSection.AddAmendments.Remove(this); |
| 0 | 28 | | return true; |
| 0 | 29 | | } |
| | 30 | |
|
| | 31 | | /// <summary> |
| | 32 | | /// will delete the amendment and the virtual paragraph. |
| | 33 | | /// </summary> |
| | 34 | | /// <param name="parentResolution"></param> |
| | 35 | | /// <returns></returns> |
| | 36 | | public override bool Deny(OperativeSection parentResolution) |
| 0 | 37 | | { |
| 0 | 38 | | parentResolution.RemoveAmendment(this); |
| 0 | 39 | | return true; |
| 0 | 40 | | } |
| | 41 | | } |
| | 42 | | } |