public void OpenBlueprint(Guid blueprintId) { ChangeContentPage(Constants.ContentPage.Loading); IBlueprintStorage storage = LoaderService.LoadBlueprint(blueprintId).GetAwaiter().GetResult(); if (storage == null) { UpdateStatus($"Failed to open Blueprint!"); ChangeContentPage(Constants.ContentPage.Error); return; } ActiveBlueprintStorage = storage; ChangeContentPage(Constants.ContentPage.ViewBlueprint); ListManager.PrependRegistryItemToList((BlueprintRegistryItem)ActiveBlueprintStorage.BlueprintRegistryItem); OnLoadedBlueprint?.Invoke(this, ActiveBlueprintStorage.Blueprint); }
public void CreateNewBlueprint() { IBlueprint blueprint = ServiceProvider.GetService <IBlueprint>(); ActiveBlueprintStorage = new BlueprintStorage() { Id = blueprint.Id, StorageType = Constants.StorageType.UnSaved, Blueprint = blueprint, BlueprintRegistryItem = new BlueprintRegistryItem() { Id = blueprint.Id, Key = AppSettings.LocalEncryptionKey, Name = blueprint.Name } }; ActiveBlueprintStorage.BlueprintRegistryItem.SetFilePath(AppSettings.DefaultSaveFolder); ChangeContentPage(Constants.ContentPage.CreateBlueprint); OnLoadedBlueprint?.Invoke(this, blueprint); }