Beispiel #1
0
        private ListViewItem MakeListViewItem(Paragraph p, string lineNumbers, string newText)
        {
            var item = new ListViewItem(string.Empty)
            {
                Tag = p, Checked = true
            };
            var subItem = new ListViewItem.ListViewSubItem(item, lineNumbers.TrimEnd(','));

            item.SubItems.Add(subItem);
            subItem = new ListViewItem.ListViewSubItem(item, UiUtil.GetListViewTextFromString(newText));
            item.SubItems.Add(subItem);

            var fixItem = new FixListItem {
                Checked = true
            };

            _fixItems.Add(fixItem);

            foreach (var number in lineNumbers.TrimEnd(',').Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
            {
                int key = Convert.ToInt32(number);
                fixItem.LineNumbers.Add(key);
                if (!_isFixAllowedList.ContainsKey(key))
                {
                    _isFixAllowedList.Add(key, true);
                }
            }

            return(item);
        }
        private ListViewItem MakeListViewItem(Paragraph p, List <int> lineNumbers, string newText)
        {
            var fixItem = new FixListItem {
                Checked = true
            };

            fixItem.LineNumbers.AddRange(lineNumbers);
            _fixItems.Add(fixItem);

            var item = new ListViewItem(string.Empty)
            {
                Tag = p, Checked = true
            };

            item.SubItems.Add(string.Join(",", lineNumbers));
            item.SubItems.Add(UiUtil.GetListViewTextFromString(newText));
            return(item);
        }