예제 #1
0
        /// <summary>
        /// Renumber the item and any children items
        /// </summary>
        /// <param name="startAt">The number to start renumbering at</param>
        /// <returns>The last number used for renumbering</returns>
        public int Renumber(int startAt)
        {
            int ret = startAt;

            Title = new NumberedTitle(ret, Title.Title);
            if (m_Children != null)
            {
                foreach (var child in Children)
                {
                    if (!String.Equals(child.Model.Code.CodeType, IcdCodeStrings.CodeType_Divider))
                    {
                        ++ret;
                        ret = child.Renumber(ret);
                    }
                }
            }
            return(ret);
        }
예제 #2
0
        /// <summary>
        /// Initiate a new ListItemVM object
        /// </summary>
        /// <param name="number">The number to be associated to the item</param>
        /// <param name="item">The IcdCodeItem object that will serve as the model</param>
        /// <param name="parentTitle">The object's parent's title</param>
        public ListItemVM(int number, IcdCodeItem item, IEnumerable <string> parentTitle, bool showCode = false)
        {
            SpecificityComplete = false;
            HasOwnComment       = true;
            m_TrueChildren      = new List <ListItemVM>();
            Model   = item;
            Comment = CommentStart;
            Title   = new NumberedTitle(number,
                                        (showCode) ?
                                        (item.Code.CodeType.Equals(IcdCodeStrings.CodeType_Divider)) ?
                                        item.Code.Title
                                : String.Format("{0}: {1}", item.Code.Code, item.Code.Title)
                            : item.Code.Title);
            ParentTitle = parentTitle;

            m_Comment  = item.Comment;
            m_IsChosen = item.Enabled;

            CommentCommand = new ActionCommand(ModifyComment);

            ToggleChosenCmnd = new ActionCommand(() => IsChosen = !IsChosen);
        }