Example #1
0
    static int Main(string[] args)
    {
        ItemX treeItem = new ItemX();

        Console.WriteLine("Pass");
        return(100);
    }
Example #2
0
        public int Compare(string x, string y)
        {
            int compareResult = 0;

            String ItemX, ItemY;

            ItemX = x;
            ItemY = y;

            try
            {
                if (ItemX.StartsWith("_", StringComparison.CurrentCultureIgnoreCase) && !ItemY.StartsWith("_", StringComparison.CurrentCultureIgnoreCase))
                {
                    compareResult = 1;
                }
                else if (!ItemX.StartsWith("_", StringComparison.CurrentCultureIgnoreCase) && ItemY.StartsWith("_", StringComparison.CurrentCultureIgnoreCase))
                {
                    compareResult = -1;
                }
                else
                {
                    compareResult = ItemComparer.Compare(ItemX, ItemY);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "AutoCompleteListSorter");
            }

            if (OrderOfSort == SortOrder.Ascending)
            {
                return(compareResult);
            }
            else if (OrderOfSort == SortOrder.Descending)
            {
                return(-compareResult);
            }
            else
            {
                return(0);
            }
        }
Example #3
0
 public void AddItems(ItemX item)
 {
     this.Items.Add(item);
 }