예제 #1
0
            public string GetCheckedItemsStringValue()
            {
                StringBuilder sb = new StringBuilder("");

                for (int i = 0; i < cclb.CheckedItems.Count; i++)
                {
                    sb.Append(cclb.GetItemText(cclb.CheckedItems[i])).Append(ccbParent.ValueSeparator);
                }
                if (sb.Length > 0)
                {
                    sb.Remove(sb.Length - ccbParent.ValueSeparator.Length, ccbParent.ValueSeparator.Length);
                }
                return(sb.ToString());
            }
예제 #2
0
        public override string GetTextValue()
        {
            if (listBox.CheckedItems.Count == 0)
            {
                return(TextForNone);
            }
            if (listBox.CheckedItems.Count == listBox.Items.Count)
            {
                return(TextForAll);
            }

            if (CustomTextBuilder != null)
            {
                return(CustomTextBuilder(this));
            }
            else
            {
                StringBuilder sb = new StringBuilder("");
                for (int i = 0; i < listBox.CheckedItems.Count; i++)
                {
                    if (i != 0)
                    {
                        sb.Append(ValueSeparator);
                    }
                    sb.Append(listBox.GetItemText(listBox.CheckedItems[i]));
                }
                return(sb.ToString());
            }
        }
예제 #3
0
            public string GetItemsStringValue(IEnumerable <object> checkedItems)
            {
                var sb = new StringBuilder();

                foreach (var checkedItem in checkedItems)
                {
                    if (sb.Length > 0)
                    {
                        sb.Append(_ccbParent.ValueSeparator);
                    }
                    sb.Append(_cclb.GetItemText(checkedItem));
                }
                return(sb.ToString());
            }