GetItemText() public method

public GetItemText ( object item ) : string
item object
return string
Beispiel #1
0
            int IComparer.Compare(object item1, object item2)
            {
                if (item1 is null)
                {
                    if (item2 is null)
                    {
                        return(0); //both null, then they are equal
                    }

                    return(-1); //item1 is null, but item2 is valid (greater)
                }
                if (item2 is null)
                {
                    return(1); //item2 is null, so item 1 is greater
                }

                if (item1 is Entry entry1)
                {
                    item1 = entry1.item;
                }

                if (item2 is Entry entry2)
                {
                    item2 = entry2.item;
                }

                string itemName1 = _listControl.GetItemText(item1);
                string itemName2 = _listControl.GetItemText(item2);

                CompareInfo compInfo = Application.CurrentCulture.CompareInfo;

                return(compInfo.Compare(itemName1, itemName2, CompareOptions.StringSort));
            }
Beispiel #2
0
        int IComparer <Entry> .Compare(Entry?entry1, Entry?entry2)
        {
            if (entry1 is null)
            {
                if (entry2 is null)
                {
                    return(0); //both null, then they are equal
                }

                return(-1); //item1 is null, but item2 is valid (greater)
            }
            if (entry2 is null)
            {
                return(1); //item2 is null, so item 1 is greater
            }

            string itemName1 = _listControl.GetItemText(entry1.Item);
            string itemName2 = _listControl.GetItemText(entry2.Item);

            CompareInfo compInfo = Application.CurrentCulture.CompareInfo;

            return(compInfo.Compare(itemName1, itemName2, CompareOptions.StringSort));
        }
Beispiel #3
0
				public int Compare(object x, object y)
				{
					return string.Compare(owner.GetItemText(x), owner.GetItemText(y));
				}