示例#1
0
        internal EntryEditorVM OpenEntryEditor(string tableName, string entryId)
        {
            var repository = repositoryProvider.GetRepository(tableName);

            string entryEditorKey = $"{tableName}#{entryId}";

            EntryEditorVM entryEditor = null;

            if (!_openedEntryEditors.TryGetValue(entryEditorKey, out entryEditor))
            {
                entryEditor = dbEntryEditorFactory.Create(repository);
                _openedEntryEditors.Add(entryEditorKey, entryEditor);
                entryEditor.ClosedAction = () => OnEntryEditorClosed(entryEditor);
                entryEditor.EditEntry(entryId);
                EntryEditorOpeningAction?.Invoke(entryEditor);
            }
            else
            {
                entryEditor.Activate();
            }

            return(entryEditor);
        }