private void LoadFigures() { _disabledSaving = true; try { var figures = _appService.FigureStorage.LoadFigures(); foreach (var figure in figures) { var descriptor = (IFigureDescriptor)_appService.PluginLibrary.Get(figure.Key); if (descriptor == null) { _logger.Error($"Plugin '{figure.Key}' can't be found"); continue; } _appService.AddFigure(descriptor, figure); } } catch (Exception ex) { _logger.Error($"Failed to load figures: {ex.ToString()}"); } _disabledSaving = false; }
public void Add(object o) { if (o is LibraryFigureViewModel figure) { _appService.AddFigure(figure.Descriptor); } }