public void GetFiles() { try { var fullFileList = new List <LocalFileDto>(); foreach (var drive in DriveList.ToArray()) { if (drive.IsSelected) { fullFileList.AddRange(DriveOperations.GetPathFiles(drive.DriveLetter)); } } Dispatcher.Invoke(() => { lvFiles.ItemsSource = fullFileList; }); } catch { Dispatcher.Invoke(() => { tbxErrorMessage.Text = "Can't retriving file information"; }); } finally { Dispatcher.Invoke(() => { loadingControl.Visibility = Visibility.Hidden; }); } }
private void GetDrives() { try { DriveList = new ObservableCollection <DriveDto>(); var driveList = DriveOperations.GetLocalDrives(); foreach (var drive in driveList) { DriveList.Add(drive); } this.DataContext = this; } catch { tbxErrorMessage.Text = "Can't access drive information"; } }
/// <summary> /// Service Start /// </summary> protected override void Start() { InitializeState(); base.Start(); // Add Encoder Notifications to the main interleave base.MainPortInterleave.CombineWith(new Interleave( new ExclusiveReceiverGroup( Arbiter.ReceiveWithIterator<brick.LegoSensorUpdate>(true, _legoBrickNotificationPort, NotificationHandler) ), new ConcurrentReceiverGroup())); // Wait one time for an InternalDrivePower command Activate(Arbiter.ReceiveWithIterator<DriveDistance>(false, _internalDrivePowerPort, InternalDrivePowerHandler)); // Set up the reliable port using DSS forwarder to ensure exception and timeout conversion to fault. _reliableMainPort = ServiceForwarder<DriveOperations>(this.ServiceInfo.Service); _reliableMainPort.ConnectToBrick(_state); }