Пример #1
0
        /// <summary>
        /// Removes the delete amendment and all other delete amendments that are targeting the same operative paragraph.
        /// </summary>
        /// <param name="section"></param>
        /// <returns></returns>
        public override bool Deny(OperativeSection section)
        {
            var count = section.DeleteAmendments.RemoveAll(n =>
                                                           n.TargetSectionId == this.TargetSectionId);

            return(count > 0);
        }
Пример #2
0
 /// <summary>
 /// Creates a new instance of a resolution with a new Id.
 /// </summary>
 public Resolution()
 {
     ResolutionId     = Guid.NewGuid().ToString();
     Preamble         = new ResolutionPreamble();
     OperativeSection = new OperativeSection();
     Header           = new ResolutionHeader();
     Date             = DateTime.Now;
 }
Пример #3
0
        /// <summary>
        /// Changes the text and removes the amendment.
        /// </summary>
        /// <param name="parentSection"></param>
        /// <returns></returns>
        public override bool Apply(OperativeSection parentSection)
        {
            parentSection.ChangeAmendments.Remove(this);
            var target = parentSection.FindOperativeParagraph(this.TargetSectionId);

            if (target == null)
            {
                return(false);
            }
            target.Text = this.NewText;
            return(true);
        }
Пример #4
0
        /// <summary>
        /// Sets the Virtual Paragraph to a real paragraph and remove the amendment.
        /// </summary>
        /// <param name="parentSection"></param>
        /// <returns></returns>
        public override bool Apply(OperativeSection parentSection)
        {
            var targetParagraph = parentSection.FindOperativeParagraph(this.TargetSectionId);

            if (targetParagraph == null)
            {
                return(false);
            }

            targetParagraph.IsVirtual = false;
            targetParagraph.Visible   = true;
            parentSection.AddAmendments.Remove(this);
            return(true);
        }
Пример #5
0
        /// <summary>
        /// Removes the operative section with all children and amendments that are on it.
        /// </summary>
        /// <param name="parentSection"></param>
        /// <returns></returns>
        public override bool Apply(OperativeSection parentSection)
        {
            var paragraph = parentSection.FindOperativeParagraph(this.TargetSectionId);

            if (!parentSection.Paragraphs.Contains(paragraph))
            {
                return(false);
            }

            parentSection.Paragraphs.Remove(paragraph);

            parentSection.AmendmentsForOperativeParagraph(this.TargetSectionId).ForEach(n => parentSection.RemoveAmendment(n));
            return(true);
        }
Пример #6
0
        /// <summary>
        /// Will delete the opld amendment and move all its settings to the currently virtual paragraph.
        /// </summary>
        /// <param name="parentSection"></param>
        /// <returns></returns>
        public override bool Apply(OperativeSection parentSection)
        {
            var placeholder = parentSection.FindOperativeParagraph(NewTargetSectionId);
            var target      = parentSection.FindOperativeParagraph(TargetSectionId);

            if (target == null || placeholder == null)
            {
                return(false);
            }

            placeholder.Children             = target.Children;
            placeholder.Corrected            = target.Corrected;
            placeholder.IsLocked             = false;
            placeholder.IsVirtual            = false;
            placeholder.Name                 = target.Name;
            placeholder.OperativeParagraphId = target.OperativeParagraphId;
            target.OperativeParagraphId      = Guid.NewGuid().ToString();
            this.TargetSectionId             = target.OperativeParagraphId;
            placeholder.Text                 = target.Text;
            placeholder.Visible              = true;
            parentSection.RemoveOperativeParagraph(target);
            return(true);
        }
Пример #7
0
 /// <summary>
 /// Removes the amendment.
 /// </summary>
 /// <param name="parentSection"></param>
 /// <returns></returns>
 public override bool Deny(OperativeSection parentSection)
 {
     parentSection.ChangeAmendments.Remove(this);
     return(true);
 }
Пример #8
0
 /// <summary>
 /// will delete the amendment and the virtual paragraph.
 /// </summary>
 /// <param name="parentResolution"></param>
 /// <returns></returns>
 public override bool Deny(OperativeSection parentResolution)
 {
     parentResolution.RemoveAmendment(this);
     return(true);
 }