Ejemplo n.º 1
0
        public void SaveDocumentEntriesState(IATETermsControl iateTermsControl)
        {
            if (iateTermsControl != null && _editorController != null)
            {
                var entries       = iateTermsControl.GetEntries();
                var selectedEntry = iateTermsControl.GetSelectedEntry();

                var documentEntries = _documentEntriesState.FirstOrDefault(a => a.DocumentId == _activeDocumentId);

                if (documentEntries != null)
                {
                    documentEntries.Entries       = entries;
                    documentEntries.SelectedEntry = selectedEntry;
                }
                else
                {
                    _documentEntriesState.Add(new DocumentEntryState
                    {
                        DocumentId    = _activeDocumentId,
                        Entries       = entries,
                        SelectedEntry = selectedEntry
                    });
                }
            }
        }
Ejemplo n.º 2
0
        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);
                }
            }
        }
Ejemplo n.º 3
0
        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);
            }
        }