コード例 #1
0
        public void Cleanup()
        {
            this._reload = false;

            // Clear out pending operations and state to prevent any unintended loads after the completion of a test
            this._dds.AutoLoad  = false;
            this._dds.QueryName = null; // prevents any straggler load from being invoked
            this._dds.CancelLoad();
            this._dds.CancelSubmit();

            this._dds.RefreshInterval = TimeSpan.Zero; // Blocks the refresh interval
            this._dds.LoadSize        = 0;             // Blocks progressive loading

            this._loadTimer            = null;
            this._progressiveLoadTimer = null;
            this._refreshLoadTimer     = null;

            // Unsubscribe from all events
            this._dds.Loaded            -= new RoutedEventHandler(this.DomainDataSourceLoaded);
            this._dds.LoadingData       -= new EventHandler <OpenRiaServices.Controls.LoadingDataEventArgs>(this.DomainDataSourceLoadingData);
            this._dds.LoadedData        -= new EventHandler <LoadedDataEventArgs>(this.DomainDataSourceLoadedData);
            this._dds.SubmittingChanges -= new EventHandler <SubmittingChangesEventArgs>(this.DomainDataSourceSubmittingChanges);
            this._dds.SubmittedChanges  -= new EventHandler <SubmittedChangesEventArgs>(this.DomainDataSourceSubmittedChanges);

            this._view.PageChanged -= new EventHandler <EventArgs>(this.ViewPageChanged);

            this._comboBox.Loaded -= new RoutedEventHandler(this.ComboBoxLoaded);
            this._textBox.Loaded  -= new RoutedEventHandler(this.TextBoxLoaded);
        }
コード例 #2
0
 protected ProgressiveLoadTimer UseProgressiveLoadTimer()
 {
     if (this._progressiveLoadTimer == null)
     {
         this._progressiveLoadTimer = new ProgressiveLoadTimer();
         this._progressiveLoadTimer.UseWithDDS(this._dds);
     }
     return(this._progressiveLoadTimer);
 }