public FSData(string path, FSDataContainer owner) { _isChecked = false; _parent = null; _owner = owner; try { _node = new DirectoryInfo(path); } catch (IOException) { try { _node = new FileInfo(path); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error: Unhandled Exception", MessageBoxButton.OK); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error: Unhandled Exception", MessageBoxButton.OK); } LoadChildren(); }
public FSData(FileSystemInfo d, FSData parent, FSDataContainer owner) { _isChecked = false; _parent = parent; _node = d; _owner = owner; LoadChildren(); }
private void LoadFolders() { txtMessage.Text = $"{Properties.Resources.txtMessageSearch}\n{location}"; txtLocation.IsEnabled = false; btnFilePicker.IsEnabled = false; LoadFoldersDelegate load_folders = ((string path) => { FSDataContainer newRoot = new FSDataContainer(path); return(newRoot); }); load_folders.BeginInvoke(location, FoldersLoaded, this); }
private void FoldersLoaded(IAsyncResult theResults) { AsyncResult results = (AsyncResult)theResults; LoadFoldersDelegate source = (LoadFoldersDelegate)results.AsyncDelegate; this.Dispatcher.Invoke(DispatcherPriority.Background, (Action)(() => { root = source.EndInvoke(results); tvDirectory.Items.Refresh(); txtMessage.Text = $"{Properties.Resources.txtMessageDone}\n{location}"; txtLocation.IsEnabled = true; btnFilePicker.IsEnabled = true; })); }