private void SetHeadings() { try { Headings.Clear(); LASSectionModel lasSectionModel = Sections[SelectedCurveSectionIndex]; lasSectionModel.Content.ForEach(content => { LASInformationModel lasInformationModel = new LASInformationModel(); string[] splitContent = content.SplitOnWhitespace(); lasInformationModel.Name = splitContent[0]; lasInformationModel.MeasurementUnit = splitContent[1]; Headings.Add(lasInformationModel); }); } catch { // ignored } }
protected virtual async void LoadLASFileCallback(FlyoutMessageModel flyoutMessage) { ResetProperties(); ProgressDialogController progressDialogController = await _dialogCoordinator.ShowProgressAsync(this, "Please wait...", "Awaiting user to select file..."); progressDialogController.Maximum = 100; await Task.Run(() => { progressDialogController.SetProgress(33); progressDialogController.SetMessage("Opening file..."); progressDialogController.SetProgress(66); progressDialogController.SetMessage("Reading Sections..."); using (StreamReader reader = new StreamReader(flyoutMessage.FileName)) { string line = reader.ReadLine(); while (!reader.EndOfStream) { if (line != null && line.StartsWith("~")) { LASSectionModel newSection = new LASSectionModel { Name = line }; newSection.Content = new List <string>(); line = reader.ReadLine(); while (line != null && !line.StartsWith("~")) { newSection.Content.Add(line); line = reader.ReadLine(); } Sections.Add(newSection); } } } }); await progressDialogController.CloseAsync(); }