示例#1
0
 public AsyncLoadingUIController(ITableAdapter tableAdapter, AsyncBufferredTableData <TTuple> data)
 {
     _Adapter   = tableAdapter;
     _AsyncData = data;
     _AsyncData.Source.LoadingSessionStarted += OnAsyncDataLoadingStarted;
     _AsyncData.Source.SingleTaskFinished    += OnAsyncDataSingleTaskFinished;
     _AsyncData.Source.LoadingSessionEnded   += OnAsyncDataLoadingSessionEnded;
 }
示例#2
0
        void Dispose()
        {
            // Unsubscribing from events makes this object available for GC

            if (_AsyncData != null && _AsyncData.Source != null)
            {
                _AsyncData.Source.LoadingSessionStarted -= OnAsyncDataLoadingStarted;
                _AsyncData.Source.SingleTaskFinished    -= OnAsyncDataSingleTaskFinished;
                _AsyncData.Source.LoadingSessionEnded   -= OnAsyncDataLoadingSessionEnded;
            }
            if (_Adapter != null)
            {
                _Adapter.ItemsRefreshed -= OnAdapterItemsRefreshed;
            }

            _Adapter   = null;
            _AsyncData = null;
        }