Beispiel #1
0
        /// <summary>
        /// Create a new instance of this vote block using a different marker.
        /// </summary>
        /// <param name="marker">Marker text.</param>
        /// <param name="markerType">Marker type.</param>
        /// <param name="markerValue">Marker value.</param>
        /// <returns>Returns a copy of the current VoteLineBlock with the markers changed.</returns>
        public VoteLineBlock WithMarker(string marker, MarkerType markerType, int markerValue)
        {
            /*
             * Scenarios:
             *
             * 1) Merge votes. The voter's new vote needs to keep the same vote marker as the old vote.
             * -- Can change at the VoteLineBlock level with no issue. No options needed.
             *
             * 2) When a vote is put into storage, the key vote is stripped of marker info
             * -- Can change at the VoteLineBlock level with no issue. No options needed.
             *
             * 3) When normalizing a plan, the first line's content may be changed (eg: proposed plan ⇒ plan).
             *    The remaining lines are copied over.
             * -- The remaining lines do not need to be changed. The VoteLineBlock as a whole is set to MarkerType.None.
             * -- Can change at the VoteLineBlock level with no issue. No options needed.
             *
             * 4) When extracting a reference plan to insert into a vote, it needs to use the
             *    user's marker information.
             * -- Can change at the VoteLineBlock level with no issue. No options needed.
             *
             */

            VoteLineBlock partition = new VoteLineBlock(Lines);

            partition.Marker      = marker;
            partition.MarkerType  = markerType;
            partition.MarkerValue = markerValue;

            return(partition);
        }
Beispiel #2
0
        public VoteLineBlock WithTask(string task)
        {
            VoteLineBlock partition = new VoteLineBlock(Lines);

            partition.Task = task;

            return(partition);
        }
Beispiel #3
0
        public VoteLineBlock Clone()
        {
            var copy = new VoteLineBlock(Lines);

            copy.Task        = Task;
            copy.Marker      = Marker;
            copy.MarkerType  = MarkerType;
            copy.MarkerValue = MarkerValue;

            return(copy);
        }