BrightIdeasSoftware.DataSourceAdapter.HandleCurrencyManagerPositionChanged C# (CSharp) Метод

HandleCurrencyManagerPositionChanged() защищенный Метод

Called by the CurrencyManager when the currently selected item changes. We update the ListView selection so that we stay in sync with any other controls bound to the same source.
protected HandleCurrencyManagerPositionChanged ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
Результат void
        protected virtual void HandleCurrencyManagerPositionChanged(object sender, EventArgs e)
        {
            int index = this.CurrencyManager.Position;

            // Make sure the index is sane (-1 pops up from time to time)
            if (index < 0 || index >= this.ListView.GetItemCount())
                return;

            // Avoid recursion. If we are currently changing the index, don't
            // start the process again.
            if (this.isChangingIndex)
                return;

            try {
                this.isChangingIndex = true;

                this.ChangePosition(index);
            }
            finally {
                this.isChangingIndex = false;
            }
        }