public async Task LoadProperties(MetadataViewModelBase obj) { obj.IsBusy = true; Root.IsLoadingInProcess = true; try { Root.DbLoader.Connection.InitialCatalog = obj.Model.DataBaseName; await Root.DbLoader.LoadProperties(obj.Model); } catch (DbException e) { MessageBox.Show(e.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); } finally { obj.IsBusy = false; Root.IsLoadingInProcess = false; if (Root.IsDefaultDatabase) { Root.DbLoader.Connection.InitialCatalog = string.Empty; } } }
protected MetadataViewModelBase(MetadataViewModelBase parent, bool canBeChild) : base(parent, canBeChild) { Root = parent?.Root; }
public void RefreshProperties(MetadataViewModelBase obj) { obj.Model.DeleteProperties(); obj.Model.IsPropertyLoaded = false; }
public CategoryViewModel(MetadataViewModelBase parent, DbEntityEnum type) : base(parent, true) { Type = type; Model = parent.Model; }
public DbObjectViewMolel(MetadataViewModelBase parent, DbObject model) : base(parent, parent.Root.DbLoader.Hierarchy.IsPossibleChilds(model.Type)) { Model = model; }