Example #1
0
 public UpdateComponentCompletedEventArgs(UpdateableComponent component,
                                          UpdateInfo updateInfo,
                                          object userState,
                                          Exception error)
 {
     Component  = component;
     UpdateInfo = updateInfo;
     UserState  = userState;
     Error      = error;
 }
Example #2
0
        public void UpdateComponentAsync(UpdateableComponent component, object userState)
        {
            UpdateComponentArgs args = new UpdateComponentArgs();

            args.Component = component;
            args.UserState = userState;

            Trace.WriteLine(String.Format("Starting update of component {0}, UserState={1}.",
                                          args.Component.Assembly,
                                          args.UserState ?? "(null)"));

            BackgroundWorker bgw = new BackgroundWorker();

            bgw.WorkerSupportsCancellation = false;
            bgw.WorkerReportsProgress      = false;
            bgw.DoWork             += UpdateComponent_DoWork;
            bgw.RunWorkerCompleted += UpdateComponent_RunWorkerCompleted;
            bgw.RunWorkerAsync(args);
        }