Exemplo n.º 1
0
        private void RemoveUnbound(WorkGroupCondition condition)
        {
            int i   = 0;
            int num = this.listViewUnbound.Items.Count;

            while (i < num)
            {
                int num2 = (i + num) / 2;
                WorkGroupControl.ConditionItem conditionItem = (WorkGroupControl.ConditionItem) this.listViewUnbound.Items[num2];
                int num3 = condition.CompareTo(conditionItem.Condition);
                if (num3 < 0)
                {
                    num = num2;
                }
                else
                {
                    if (num3 <= 0)
                    {
                        this.listViewUnbound.Items.RemoveAt(num2);
                        return;
                    }
                    i = num2 + 1;
                }
            }
        }
Exemplo n.º 2
0
        private void AddUnbound(WorkGroupCondition condition)
        {
            int i   = 0;
            int num = this.listViewUnbound.Items.Count;

            while (i < num)
            {
                int num2 = (i + num) / 2;
                WorkGroupControl.ConditionItem conditionItem = (WorkGroupControl.ConditionItem) this.listViewUnbound.Items[num2];
                int num3 = condition.CompareTo(conditionItem.Condition);
                if (num3 < 0)
                {
                    num = num2;
                }
                else
                {
                    if (num3 <= 0)
                    {
                        return;
                    }
                    i = num2 + 1;
                }
            }
            this.listViewUnbound.Items.Insert(i, new WorkGroupControl.ConditionItem(condition));
        }