private async void OpenFile(string filename) { Text = $"{APP_TITLE} - {PathUtils.GetFilename(filename)}"; Configs.Instance.AddRecent(filename); BeginLoading("Loading: " + filename); while (openedForms.Count > 0) { openedForms[0].Close(); } try { mapping = await Task.Run(() => new Mapping(filename)); } catch (Exception e) { HandleMappingLoadingException(e, filename); EndLoading("Loading failed."); return; } pdbfiles.Clear(); BuildMapping(); EnableMappingActions(true); EndLoading("Mapping loaded in " + mapping.TimingTotal + " ms"); AttachRelatedPdbs(Configs.Instance.GetRecentPdb(mapping.Filename), false); AttachRelatedPdbs(pdbToAttach, true); pdbToAttach = null; tbSearch.AutoCompleteCustomSource = mapping.GetNewNamesCollection(); }
private async void ReloadFile() { BeginLoading($"Reloading: {mappingFilename}"); while (openedForms.Count > 0) { openedForms[0].Close(); } try { if (mapping != null) { await Task.Run(() => mapping.Reload()); } else { mapping = await Task.Run(() => new Mapping(mappingFilename)); } } catch (Exception e) { HandleMappingLoadingException(e, mappingFilename); EndLoading("Reloading failed."); return; } BuildMapping(); EnableMappingActions(true); EndLoading($"Mapping reloaded in {mapping.LoadTime} ms"); tbSearch.AutoCompleteCustomSource = mapping.GetNewNamesCollection(); }
private async void ReloadFile() { BeginLoading("Reloading: " + mapping.Filename); while (openedForms.Count > 0) { openedForms[0].Close(); } try { await Task.Run(() => mapping.Reload()); } catch (Exception e) { HandleMappingLoadingException(e, mapping.Filename); EndLoading("Reloading failed."); return; } BuildMapping(); EnableMappingActions(true); EndLoading("Mapping reloaded in " + mapping.TimingTotal + " ms"); tbSearch.AutoCompleteCustomSource = mapping.GetNewNamesCollection(); }