Example #1
0
        public void SetModel(string modelName)
        {
            var repository = workspaceMan.GetRepository(modelName);

            if (repository == null)
            {
                throw new InvalidOperationException($"Repository with name '{modelName}' not found.");
            }

            _edited = repository;

            //var vm = application.GetInterface<DbTableFactory>().CreateTable(_edited);
            UpdateVM(_edited);

            tableName             = modelName;
            TablePresentationName = modelName;

            UpdateTitle();

            if (_newEntryCreator != null)
            {
                _newEntryCreator.Close();
                _newEntryCreator = null;
            }
        }
Example #2
0
        public EntryRefIdSelectorVM(IWorkspaceMan workspaceMan, Type type)
        {
            Items = new BindingList <string>();

            var repository = workspaceMan.GetRepository(type);

            Items.UpdateAfter(() =>
            {
                repository.Entries.ForEach(item => Items.Add(item.Id));
            });
        }
Example #3
0
 protected EntryEditorBaseVM(IWorkspaceMan workspaceMan, IDialogProvider dialogProvider)
 {
     WorkspaceMan        = workspaceMan;
     this.dialogProvider = dialogProvider;
     repository          = WorkspaceMan.GetRepository <E>();
 }