private void MainWindow_Loaded(object sender, RoutedEventArgs e) { try { _mgr = new BITS.BackgroundCopyManager1_5(); } catch (System.Runtime.InteropServices.COMException ex) { MessageBox.Show( String.Format(Properties.Resources.ErrorCantConnectToBitsException, ex.HResult, ex.Message), Properties.Resources.ErrorTitle ); } if (_mgr == null) { _uiJobDetails.Visibility = Visibility.Hidden; UpdateMenu(); MessageBox.Show(Properties.Resources.ErrorCantConnectToBits, Properties.Resources.ErrorTitle); } else { RefreshJobList(); _uiJobList.Focus(); _timer = new DispatcherTimer(); _timer.Tick += Timer_Tick; _timer.Interval = new TimeSpan(0, 0, 10); _timer.Start(); } }
public QuickFileDownloadWindow(BITS.IBackgroundCopyManager mgr) { _mgr = mgr; InitializeComponent(); Loaded += QuickFileDownloadControl_Loaded; }