Mono.Terminal.ListView.ProviderChanged C# (CSharp) Method

ProviderChanged() public method

This method can be invoked by the model to notify the view that the contents of the model have changed.
Invoke this method to invalidate the contents of the ListView and force the ListView to repaint the contents displayed.
public ProviderChanged ( ) : void
return void
        public void ProviderChanged()
        {
            if (provider.Items != items){
                items = provider.Items;
                if (top > items){
                    if (items > 1)
                        top = items-1;
                    else
                        top = 0;
                }
                if (selected > items){
                    if (items > 1)
                        selected = items - 1;
                    else
                        selected = 0;
                }
            }
            Redraw ();
        }