Event args passed to the LoadCompletedEventHandler when LoadAsync completes
Inheritance: System.EventArgs
示例#1
0
文件: DAL.cs 项目: Fedorm/core-master
 private void context_LoadCompleted(object sender, Microsoft.Synchronization.ClientServices.IsolatedStorage.LoadCompletedEventArgs e)
 {
     if (_syncAfterLoad)
     {
         RefreshAsync(syncEvent);
         _syncAfterLoad = false;
     }
     else
     if (syncEvent != null)
     {
         syncEvent(this, new SyncEventArgs());
     }
 }
示例#2
0
 /// <summary>
 /// Called when the context is don laoding
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void ModelLoadCompleted(object sender, LoadCompletedEventArgs e)
 {
     // This callback is not guaranteed to occur on the UI thread, so dispatch on the
     // UI thread.
     Dispatcher.BeginInvoke(() =>
         {
             if (e.Exception == null)
             {
                 Bind();
             }
             else
             {
                 MessageBox.Show("Loading the context failed: " + e.Exception.ToString());
             }
         });
 }
示例#3
0
        /// <summary>
        /// Handles the context LoadCompleted event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ContextLoadCompleted(object sender, LoadCompletedEventArgs e)
        {
            if (e.Exception == null)
            {
                loaded = true;
                // Notify that all of the collections changed
                OnPropertyChanged("Tags");
                OnPropertyChanged("Statuses");
                OnPropertyChanged("Priorities");
                OnPropertyChanged("User");
                OnPropertyChanged("UserTags");
                OnPropertyChanged("Lists");

                var loadCompleted = LoadCompleted;

                if (loadCompleted != null)
                {
                    loadCompleted(this, e);
                }
            }
            else if (e.Exception is ArgumentException)
            {
                context.ClearCache();
                context.LoadAsync();
            }
        }