public void UpdateDocumentEntriesState(IATETermsControl iateTermsControl) { if (iateTermsControl != null && _editorController != null) { _activeDocumentId = _editorController.ActiveDocument.Files?.ToList()[0].Id.ToString(); var documentEntries = _documentEntriesState.FirstOrDefault(a => a.DocumentId == _activeDocumentId); if (documentEntries != null) { iateTermsControl.UpdateEntriesInView(documentEntries.Entries, _editorController.ActiveDocument.Project.GetProjectInfo().SourceLanguage, documentEntries.SelectedEntry); } } }
public void UpdateDocumentEntriesState(IATETermsControl iateTermsControl) { if (iateTermsControl != null && _editorController != null) { var activeFile = _editorController.ActiveDocument.Files?.ToList()[0]; if (activeFile is null) { return; } _activeDocumentId = activeFile.Id.ToString(); var documentEntries = _documentEntriesState.FirstOrDefault(a => a.DocumentId == _activeDocumentId); if (documentEntries is null) { return; } var projectInfo = _editorController.ActiveDocument.Project.GetProjectInfo(); iateTermsControl.UpdateEntriesInView(documentEntries.Entries, projectInfo.SourceLanguage, activeFile.Language, documentEntries.SelectedEntry); } }